tests/acceptance: verify s390x device detection
[qemu/kevin.git] / tests / qemu-iotests / 146
blobddc3c1fd8041c3750ce49f7594b1fb6ed3b17095
1 #!/usr/bin/env bash
3 # Test VHD image format creator detection and override
5 # Copyright (C) 2016 Red Hat, Inc.
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 2 of the License, or
10 # (at your option) any later version.
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with this program. If not, see <http://www.gnu.org/licenses/>.
21 # creator
22 owner=jcody@redhat.com
24 seq=`basename $0`
25 echo "QA output created by $seq"
27 status=1 # failure is the default!
29 _cleanup()
31 _cleanup_qemu
32 _cleanup_test_img
34 trap "_cleanup; exit \$status" 0 1 2 3 15
36 # get standard environment, filters and checks
37 . ./common.rc
38 . ./common.filter
39 . ./common.qemu
41 _supported_fmt vpc
42 _supported_proto file
43 _supported_os Linux
46 qemu_comm_method="monitor"
47 silent=
49 echo
50 echo === Testing VPC Autodetect ===
51 echo
52 _use_sample_img virtualpc-dynamic.vhd.bz2
54 $QEMU_IMG map --output=json --image-opts \
55 "driver=vpc,file.filename=$TEST_IMG" \
56 | _filter_qemu_img_map
58 echo
59 echo === Testing VPC with current_size force ===
60 echo
62 $QEMU_IMG map --output=json --image-opts \
63 "driver=vpc,force_size_calc=current_size,file.filename=$TEST_IMG" \
64 | _filter_qemu_img_map
66 echo
67 echo === Testing VPC with chs force ===
68 echo
70 $QEMU_IMG map --output=json --image-opts \
71 "driver=vpc,force_size_calc=chs,file.filename=$TEST_IMG" \
72 | _filter_qemu_img_map
74 _cleanup_test_img
76 echo
77 echo === Testing Hyper-V Autodetect ===
78 echo
79 _use_sample_img hyperv2012r2-dynamic.vhd.bz2
81 $QEMU_IMG map --output=json --image-opts \
82 "driver=vpc,file.filename=$TEST_IMG" \
83 | _filter_qemu_img_map
85 echo
86 echo === Testing Hyper-V with current_size force ===
87 echo
89 $QEMU_IMG map --output=json --image-opts \
90 "driver=vpc,force_size_calc=current_size,file.filename=$TEST_IMG" \
91 | _filter_qemu_img_map
93 echo
94 echo === Testing Hyper-V with chs force ===
95 echo
97 $QEMU_IMG map --output=json --image-opts \
98 "driver=vpc,force_size_calc=chs,file.filename=$TEST_IMG" \
99 | _filter_qemu_img_map
101 _cleanup_test_img
103 echo
104 echo === Testing d2v Autodetect ===
105 echo
106 _use_sample_img d2v-zerofilled.vhd.bz2
108 $QEMU_IMG map --output=json --image-opts \
109 "driver=vpc,file.filename=$TEST_IMG" \
110 | _filter_qemu_img_map
112 echo
113 echo === Testing d2v with current_size force ===
114 echo
116 $QEMU_IMG map --output=json --image-opts \
117 "driver=vpc,force_size_calc=current_size,file.filename=$TEST_IMG" \
118 | _filter_qemu_img_map
120 echo
121 echo === Testing d2v with chs force ===
122 echo
124 $QEMU_IMG map --output=json --image-opts \
125 "driver=vpc,force_size_calc=chs,file.filename=$TEST_IMG" \
126 | _filter_qemu_img_map
128 _cleanup_test_img
130 echo
131 echo === Testing Image create, default ===
132 echo
134 TEST_IMG="${TEST_DIR}/vpc-create-test.vpc"
136 _make_test_img 4G
138 echo
139 echo === Read created image, default opts ====
140 echo
142 $QEMU_IMG map --output=json --image-opts \
143 "driver=vpc,file.filename=$TEST_IMG" \
144 | _filter_qemu_img_map
146 echo
147 echo === Read created image, force_size_calc=chs ====
148 echo
150 $QEMU_IMG map --output=json --image-opts \
151 "driver=vpc,force_size_calc=chs,file.filename=$TEST_IMG" \
152 | _filter_qemu_img_map
154 echo
155 echo === Read created image, force_size_calc=current_size ====
156 echo
158 $QEMU_IMG map --output=json --image-opts \
159 "driver=vpc,force_size_calc=current_size,file.filename=$TEST_IMG" \
160 | _filter_qemu_img_map
162 echo
163 echo === Testing Image create, force_size ===
164 echo
166 _make_test_img -o force_size 4G
168 echo
169 echo === Read created image, default opts ====
170 echo
172 $QEMU_IMG map --output=json --image-opts \
173 "driver=vpc,file.filename=$TEST_IMG" \
174 | _filter_qemu_img_map
176 echo
177 echo === Read created image, force_size_calc=chs ====
178 echo
180 $QEMU_IMG map --output=json --image-opts \
181 "driver=vpc,force_size_calc=chs,file.filename=$TEST_IMG" \
182 | _filter_qemu_img_map
184 echo
185 echo === Read created image, force_size_calc=current_size ====
186 echo
188 $QEMU_IMG map --output=json --image-opts \
189 "driver=vpc,force_size_calc=current_size,file.filename=$TEST_IMG" \
190 | _filter_qemu_img_map
192 echo "*** done"
193 rm -f $seq.full
194 status=0