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/>.
22 owner
=jcody@redhat.com
25 echo "QA output created by $seq"
27 status
=1 # failure is the default!
34 trap "_cleanup; exit \$status" 0 1 2 3 15
36 # get standard environment, filters and checks
46 qemu_comm_method
="monitor"
50 echo === Testing VPC Autodetect
===
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
59 echo === Testing VPC with current_size force
===
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
67 echo === Testing VPC with chs force
===
70 $QEMU_IMG map
--output=json
--image-opts \
71 "driver=vpc,force_size_calc=chs,file.filename=$TEST_IMG" \
72 | _filter_qemu_img_map
77 echo === Testing Hyper-V Autodetect
===
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
86 echo === Testing Hyper-V with current_size force
===
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
94 echo === Testing Hyper-V with chs force
===
97 $QEMU_IMG map
--output=json
--image-opts \
98 "driver=vpc,force_size_calc=chs,file.filename=$TEST_IMG" \
99 | _filter_qemu_img_map
104 echo === Testing d2v Autodetect
===
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
113 echo === Testing d2v with current_size force
===
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
121 echo === Testing d2v with chs force
===
124 $QEMU_IMG map
--output=json
--image-opts \
125 "driver=vpc,force_size_calc=chs,file.filename=$TEST_IMG" \
126 | _filter_qemu_img_map
131 echo === Testing Image create
, default
===
134 TEST_IMG
="${TEST_DIR}/vpc-create-test.vpc"
139 echo === Read created image
, default opts
====
142 $QEMU_IMG map
--output=json
--image-opts \
143 "driver=vpc,file.filename=$TEST_IMG" \
144 | _filter_qemu_img_map
147 echo === Read created image
, force_size_calc
=chs
====
150 $QEMU_IMG map
--output=json
--image-opts \
151 "driver=vpc,force_size_calc=chs,file.filename=$TEST_IMG" \
152 | _filter_qemu_img_map
155 echo === Read created image
, force_size_calc
=current_size
====
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
163 echo === Testing Image create
, force_size
===
166 _make_test_img
-o force_size
4G
169 echo === Read created image
, default opts
====
172 $QEMU_IMG map
--output=json
--image-opts \
173 "driver=vpc,file.filename=$TEST_IMG" \
174 | _filter_qemu_img_map
177 echo === Read created image
, force_size_calc
=chs
====
180 $QEMU_IMG map
--output=json
--image-opts \
181 "driver=vpc,force_size_calc=chs,file.filename=$TEST_IMG" \
182 | _filter_qemu_img_map
185 echo === Read created image
, force_size_calc
=current_size
====
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