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"
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_IO} -c "open -o driver=vpc ${TEST_IMG}" -c 'map'
58 echo === Testing VPC with current_size force
===
61 ${QEMU_IO} -c "open -o driver=vpc,force_size_calc=current_size ${TEST_IMG}" -c 'map'
64 echo === Testing VPC with chs force
===
67 ${QEMU_IO} -c "open -o driver=vpc,force_size_calc=chs ${TEST_IMG}" -c 'map'
72 echo === Testing Hyper-V Autodetect
===
74 _use_sample_img hyperv2012r2-dynamic.vhd.bz2
76 ${QEMU_IO} -c "open -o driver=vpc ${TEST_IMG}" -c 'map'
79 echo === Testing Hyper-V with current_size force
===
82 ${QEMU_IO} -c "open -o driver=vpc,force_size_calc=current_size ${TEST_IMG}" -c 'map'
85 echo === Testing Hyper-V with chs force
===
88 ${QEMU_IO} -c "open -o driver=vpc,force_size_calc=chs ${TEST_IMG}" -c 'map'
93 echo === Testing d2v Autodetect
===
95 _use_sample_img d2v-zerofilled.vhd.bz2
97 ${QEMU_IO} -c "open -o driver=vpc ${TEST_IMG}" -c 'map'
100 echo === Testing d2v with current_size force
===
103 ${QEMU_IO} -c "open -o driver=vpc,force_size_calc=current_size ${TEST_IMG}" -c 'map'
106 echo === Testing d2v with chs force
===
109 ${QEMU_IO} -c "open -o driver=vpc,force_size_calc=chs ${TEST_IMG}" -c 'map'
114 echo === Testing Image create
, default
===
117 TEST_IMG
="${TEST_DIR}/vpc-create-test.vpc"
122 echo === Read created image
, default opts
====
125 ${QEMU_IO} -c "open -o driver=vpc ${TEST_IMG}" -c 'map'
128 echo === Read created image
, force_size_calc
=chs
====
131 ${QEMU_IO} -c "open -o driver=vpc,force_size_calc=chs ${TEST_IMG}" -c 'map'
134 echo === Read created image
, force_size_calc
=current_size
====
137 ${QEMU_IO} -c "open -o driver=vpc,force_size_calc=current_size ${TEST_IMG}" -c 'map'
140 echo === Testing Image create
, force_size
===
143 _make_test_img
-o force_size
4G
146 echo === Read created image
, default opts
====
149 ${QEMU_IO} -c "open -o driver=vpc ${TEST_IMG}" -c 'map'
152 echo === Read created image
, force_size_calc
=chs
====
155 ${QEMU_IO} -c "open -o driver=vpc,force_size_calc=chs ${TEST_IMG}" -c 'map'
158 echo === Read created image
, force_size_calc
=current_size
====
161 ${QEMU_IO} -c "open -o driver=vpc,force_size_calc=current_size ${TEST_IMG}" -c 'map'