megasas: Implement DCMD_CLUSTER_RESET_LD
[qemu/ar7.git] / tests / qemu-iotests / 087
blobd7454d13da53cfd6221058697aaafe65fe69e512
1 #!/bin/bash
3 # Test unsupported blockdev-add cases
5 # Copyright (C) 2014 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=kwolf@redhat.com
24 seq=`basename $0`
25 echo "QA output created by $seq"
27 here=`pwd`
28 tmp=/tmp/$$
29 status=1 # failure is the default!
31 # get standard environment, filters and checks
32 . ./common.rc
33 . ./common.filter
35 _supported_fmt qcow2
36 _supported_proto file
37 _supported_os Linux
39 function do_run_qemu()
41 echo Testing: "$@"
42 $QEMU -nographic -qmp stdio -serial none "$@"
43 echo
46 function run_qemu()
48 do_run_qemu "$@" 2>&1 | _filter_testdir | _filter_qmp | sed -e 's/\("actual-size":\s*\)[0-9]\+/\1SIZE/g'
51 size=128M
53 _make_test_img $size
55 echo
56 echo === Missing ID ===
57 echo
59 run_qemu <<EOF
60 { "execute": "qmp_capabilities" }
61 { "execute": "blockdev-add",
62 "arguments": {
63 "options": {
64 "driver": "$IMGFMT",
65 "file": {
66 "driver": "file",
67 "filename": "$TEST_IMG"
72 { "execute": "quit" }
73 EOF
75 echo
76 echo === Duplicate ID ===
77 echo
79 run_qemu <<EOF
80 { "execute": "qmp_capabilities" }
81 { "execute": "blockdev-add",
82 "arguments": {
83 "options": {
84 "driver": "$IMGFMT",
85 "id": "disk",
86 "node-name": "test-node",
87 "file": {
88 "driver": "file",
89 "filename": "$TEST_IMG"
94 { "execute": "blockdev-add",
95 "arguments": {
96 "options": {
97 "driver": "$IMGFMT",
98 "id": "disk",
99 "file": {
100 "driver": "file",
101 "filename": "$TEST_IMG"
106 { "execute": "blockdev-add",
107 "arguments": {
108 "options": {
109 "driver": "$IMGFMT",
110 "id": "test-node",
111 "file": {
112 "driver": "file",
113 "filename": "$TEST_IMG"
118 { "execute": "blockdev-add",
119 "arguments": {
120 "options": {
121 "driver": "$IMGFMT",
122 "id": "disk2",
123 "node-name": "disk",
124 "file": {
125 "driver": "file",
126 "filename": "$TEST_IMG"
131 { "execute": "blockdev-add",
132 "arguments": {
133 "options": {
134 "driver": "$IMGFMT",
135 "id": "disk2",
136 "node-name": "test-node",
137 "file": {
138 "driver": "file",
139 "filename": "$TEST_IMG"
144 { "execute": "blockdev-add",
145 "arguments": {
146 "options": {
147 "driver": "$IMGFMT",
148 "id": "disk3",
149 "node-name": "disk3",
150 "file": {
151 "driver": "file",
152 "filename": "$TEST_IMG"
157 { "execute": "quit" }
160 echo
161 echo === aio=native without O_DIRECT ===
162 echo
164 run_qemu <<EOF
165 { "execute": "qmp_capabilities" }
166 { "execute": "blockdev-add",
167 "arguments": {
168 "options": {
169 "driver": "$IMGFMT",
170 "id": "disk",
171 "aio": "native",
172 "file": {
173 "driver": "file",
174 "filename": "$TEST_IMG"
179 { "execute": "quit" }
182 echo
183 echo === Encrypted image ===
184 echo
186 _make_test_img -o encryption=on $size
187 run_qemu -S <<EOF
188 { "execute": "qmp_capabilities" }
189 { "execute": "blockdev-add",
190 "arguments": {
191 "options": {
192 "driver": "$IMGFMT",
193 "id": "disk",
194 "file": {
195 "driver": "file",
196 "filename": "$TEST_IMG"
201 { "execute": "quit" }
204 run_qemu <<EOF
205 { "execute": "qmp_capabilities" }
206 { "execute": "blockdev-add",
207 "arguments": {
208 "options": {
209 "driver": "$IMGFMT",
210 "id": "disk",
211 "file": {
212 "driver": "file",
213 "filename": "$TEST_IMG"
218 { "execute": "quit" }
221 echo
222 echo === Missing driver ===
223 echo
225 _make_test_img -o encryption=on $size
226 run_qemu -S <<EOF
227 { "execute": "qmp_capabilities" }
228 { "execute": "blockdev-add",
229 "arguments": {
230 "options": {
231 "id": "disk"
235 { "execute": "quit" }
238 # success, all done
239 echo "*** done"
240 rm -f $seq.full
241 status=0