hw/arm/sbsa-ref: Remove unnecessary check for secure_sysmem == NULL
[qemu/ar7.git] / tests / qemu-iotests / 186
blob7e7d45babc2d4ba8f8f02a447e84a880390f269a
1 #!/usr/bin/env bash
3 # Test 'info block' with all kinds of configurations
5 # Copyright (C) 2017 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 status=1 # failure is the default!
29 _cleanup()
31 _cleanup_test_img
33 trap "_cleanup; exit \$status" 0 1 2 3 15
35 # get standard environment, filters and checks
36 . ./common.rc
37 . ./common.filter
39 _supported_fmt qcow2
40 _supported_proto file
42 if [ "$QEMU_DEFAULT_MACHINE" != "pc" ]; then
43 _notrun "Requires a PC machine"
46 do_run_qemu()
48 echo Testing: "$@"
51 if ! test -t 0; then
52 while read cmd; do
53 echo $cmd
54 done
56 echo quit
57 ) | $QEMU -S -display none -device virtio-scsi-pci -monitor stdio "$@" 2>&1
58 echo
61 check_info_block()
63 echo "info block" |
64 do_run_qemu "$@" | _filter_win32 | _filter_hmp | _filter_qemu |
65 _filter_generated_node_ids | _filter_qom_path
69 size=64M
70 _make_test_img $size
72 removable="floppy ide-cd scsi-cd"
73 fixed="ide-hd scsi-hd virtio-blk-pci"
75 echo
76 echo "=== Empty drives ==="
77 echo
79 for dev in $removable; do
80 check_info_block -device $dev
81 check_info_block -device $dev,id=qdev_id
82 done
84 echo
85 echo "=== -blockdev/-device=<node-name> ==="
86 echo
88 for dev in $fixed $removable; do
89 check_info_block -blockdev driver=null-co,node-name=null -device $dev,drive=null
90 check_info_block -blockdev driver=null-co,node-name=null -device $dev,drive=null,id=qdev_id
91 done
93 echo
94 echo "=== -drive if=none/-device=<node-name> ==="
95 echo
97 # This creates two BlockBackends that will show up in 'info block'!
98 # A monitor-owned one from -drive, and anonymous one from -device
99 for dev in $fixed $removable; do
100 check_info_block -drive if=none,driver=null-co,node-name=null -device $dev,drive=null,id=qdev_id
101 done
103 echo
104 echo "=== -drive if=none/-device=<bb-name> (with medium) ==="
105 echo
107 for dev in $fixed $removable; do
108 check_info_block -drive if=none,driver=null-co,node-name=null -device $dev,drive=none0
109 check_info_block -drive if=none,driver=null-co,node-name=null -device $dev,drive=none0,id=qdev_id
110 done
112 echo
113 echo "=== -drive if=none/-device=<bb-name> (without medium) ==="
114 echo
116 check_info_block -drive if=none
118 for dev in $removable; do
119 check_info_block -drive if=none -device $dev,drive=none0
120 check_info_block -drive if=none -device $dev,drive=none0,id=qdev_id
121 done
123 echo
124 echo "=== -drive if=... ==="
125 echo
127 check_info_block -drive if=floppy
128 check_info_block -drive if=floppy,driver=null-co
130 check_info_block -drive if=ide,driver=null-co
131 check_info_block -drive if=ide,media=cdrom
132 check_info_block -drive if=ide,driver=null-co,media=cdrom
134 check_info_block -drive if=virtio,driver=null-co
136 check_info_block -drive if=pflash,driver=null-co,size=1M
138 # success, all done
139 echo "*** done"
140 rm -f $seq.full
141 status=0