4 # Test VHD image format creator detection and override
6 # Copyright (C) 2016 Red Hat, Inc.
8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 2 of the License, or
11 # (at your option) any later version.
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this program. If not, see <http://www.gnu.org/licenses/>.
23 owner
=codyprime@gmail.com
26 echo "QA output created by $seq"
28 status
=1 # failure is the default!
35 trap "_cleanup; exit \$status" 0 1 2 3 15
37 # get standard environment, filters and checks
47 qemu_comm_method
="monitor"
51 echo === Testing VPC Autodetect
===
53 _use_sample_img virtualpc-dynamic.vhd.bz2
55 $QEMU_IMG map
--output=json
--image-opts \
56 "driver=vpc,file.filename=$TEST_IMG" \
57 | _filter_qemu_img_map
60 echo === Testing VPC with current_size force
===
63 $QEMU_IMG map
--output=json
--image-opts \
64 "driver=vpc,force_size_calc=current_size,file.filename=$TEST_IMG" \
65 | _filter_qemu_img_map
68 echo === Testing VPC with chs force
===
71 $QEMU_IMG map
--output=json
--image-opts \
72 "driver=vpc,force_size_calc=chs,file.filename=$TEST_IMG" \
73 | _filter_qemu_img_map
78 echo === Testing Hyper-V Autodetect
===
80 _use_sample_img hyperv2012r2-dynamic.vhd.bz2
82 $QEMU_IMG map
--output=json
--image-opts \
83 "driver=vpc,file.filename=$TEST_IMG" \
84 | _filter_qemu_img_map
87 echo === Testing Hyper-V with current_size force
===
90 $QEMU_IMG map
--output=json
--image-opts \
91 "driver=vpc,force_size_calc=current_size,file.filename=$TEST_IMG" \
92 | _filter_qemu_img_map
95 echo === Testing Hyper-V with chs force
===
98 $QEMU_IMG map
--output=json
--image-opts \
99 "driver=vpc,force_size_calc=chs,file.filename=$TEST_IMG" \
100 | _filter_qemu_img_map
105 echo === Testing d2v Autodetect
===
107 _use_sample_img d2v-zerofilled.vhd.bz2
109 $QEMU_IMG map
--output=json
--image-opts \
110 "driver=vpc,file.filename=$TEST_IMG" \
111 | _filter_qemu_img_map
114 echo === Testing d2v with current_size force
===
117 $QEMU_IMG map
--output=json
--image-opts \
118 "driver=vpc,force_size_calc=current_size,file.filename=$TEST_IMG" \
119 | _filter_qemu_img_map
122 echo === Testing d2v with chs force
===
125 $QEMU_IMG map
--output=json
--image-opts \
126 "driver=vpc,force_size_calc=chs,file.filename=$TEST_IMG" \
127 | _filter_qemu_img_map
132 echo === Testing Image create
, default
===
135 TEST_IMG
="${TEST_DIR}/vpc-create-test.vpc"
140 echo === Read created image
, default opts
====
143 $QEMU_IMG map
--output=json
--image-opts \
144 "driver=vpc,file.filename=$TEST_IMG" \
145 | _filter_qemu_img_map
148 echo === Read created image
, force_size_calc
=chs
====
151 $QEMU_IMG map
--output=json
--image-opts \
152 "driver=vpc,force_size_calc=chs,file.filename=$TEST_IMG" \
153 | _filter_qemu_img_map
156 echo === Read created image
, force_size_calc
=current_size
====
159 $QEMU_IMG map
--output=json
--image-opts \
160 "driver=vpc,force_size_calc=current_size,file.filename=$TEST_IMG" \
161 | _filter_qemu_img_map
164 echo === Testing Image create
, force_size
===
167 _make_test_img
-o force_size
4G
170 echo === Read created image
, default opts
====
173 $QEMU_IMG map
--output=json
--image-opts \
174 "driver=vpc,file.filename=$TEST_IMG" \
175 | _filter_qemu_img_map
178 echo === Read created image
, force_size_calc
=chs
====
181 $QEMU_IMG map
--output=json
--image-opts \
182 "driver=vpc,force_size_calc=chs,file.filename=$TEST_IMG" \
183 | _filter_qemu_img_map
186 echo === Read created image
, force_size_calc
=current_size
====
189 $QEMU_IMG map
--output=json
--image-opts \
190 "driver=vpc,force_size_calc=current_size,file.filename=$TEST_IMG" \
191 | _filter_qemu_img_map