qapi: Improve reporting of missing / unknown definition keys
[qemu/ar7.git] / tests / qemu-iotests / 146
blob2e43abddfc5c97072f8f8fe2e897de13a1051ecf
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_IO} -c "open -o driver=vpc ${TEST_IMG}" -c 'map'
56 echo
57 echo === Testing VPC with current_size force ===
58 echo
60 ${QEMU_IO} -c "open -o driver=vpc,force_size_calc=current_size ${TEST_IMG}" -c 'map'
62 echo
63 echo === Testing VPC with chs force ===
64 echo
66 ${QEMU_IO} -c "open -o driver=vpc,force_size_calc=chs ${TEST_IMG}" -c 'map'
68 _cleanup_test_img
70 echo
71 echo === Testing Hyper-V Autodetect ===
72 echo
73 _use_sample_img hyperv2012r2-dynamic.vhd.bz2
75 ${QEMU_IO} -c "open -o driver=vpc ${TEST_IMG}" -c 'map'
77 echo
78 echo === Testing Hyper-V with current_size force ===
79 echo
81 ${QEMU_IO} -c "open -o driver=vpc,force_size_calc=current_size ${TEST_IMG}" -c 'map'
83 echo
84 echo === Testing Hyper-V with chs force ===
85 echo
87 ${QEMU_IO} -c "open -o driver=vpc,force_size_calc=chs ${TEST_IMG}" -c 'map'
89 _cleanup_test_img
91 echo
92 echo === Testing d2v Autodetect ===
93 echo
94 _use_sample_img d2v-zerofilled.vhd.bz2
96 ${QEMU_IO} -c "open -o driver=vpc ${TEST_IMG}" -c 'map'
98 echo
99 echo === Testing d2v with current_size force ===
100 echo
102 ${QEMU_IO} -c "open -o driver=vpc,force_size_calc=current_size ${TEST_IMG}" -c 'map'
104 echo
105 echo === Testing d2v with chs force ===
106 echo
108 ${QEMU_IO} -c "open -o driver=vpc,force_size_calc=chs ${TEST_IMG}" -c 'map'
110 _cleanup_test_img
112 echo
113 echo === Testing Image create, default ===
114 echo
116 TEST_IMG="${TEST_DIR}/vpc-create-test.vpc"
118 _make_test_img 4G
120 echo
121 echo === Read created image, default opts ====
122 echo
124 ${QEMU_IO} -c "open -o driver=vpc ${TEST_IMG}" -c 'map'
126 echo
127 echo === Read created image, force_size_calc=chs ====
128 echo
130 ${QEMU_IO} -c "open -o driver=vpc,force_size_calc=chs ${TEST_IMG}" -c 'map'
132 echo
133 echo === Read created image, force_size_calc=current_size ====
134 echo
136 ${QEMU_IO} -c "open -o driver=vpc,force_size_calc=current_size ${TEST_IMG}" -c 'map'
138 echo
139 echo === Testing Image create, force_size ===
140 echo
142 _make_test_img -o force_size 4G
144 echo
145 echo === Read created image, default opts ====
146 echo
148 ${QEMU_IO} -c "open -o driver=vpc ${TEST_IMG}" -c 'map'
150 echo
151 echo === Read created image, force_size_calc=chs ====
152 echo
154 ${QEMU_IO} -c "open -o driver=vpc,force_size_calc=chs ${TEST_IMG}" -c 'map'
156 echo
157 echo === Read created image, force_size_calc=current_size ====
158 echo
160 ${QEMU_IO} -c "open -o driver=vpc,force_size_calc=current_size ${TEST_IMG}" -c 'map'
162 echo "*** done"
163 rm -f $seq.full
164 status=0