3 # Test I/O throttle block filter driver interface
5 # Copyright (C) 2017 Manos Pitsidianakis
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
="Manos Pitsidianakis"
25 echo "QA output created by $seq"
27 status
=1 # failure is the default!
29 trap "exit \$status" 0 1 2 3 15
31 # get standard environment, filters and checks
36 _require_drivers throttle
40 echo Testing
: "$@" | _filter_imgfmt
41 $QEMU -nographic -qmp-pretty stdio
-serial none
"$@"
47 do_run_qemu
"$@" 2>&1 | _filter_testdir | _filter_qemu | _filter_qmp\
48 | _filter_qemu_io | _filter_generated_node_ids
51 test_throttle
=$
($QEMU_IMG --help|
grep throttle
)
52 [ "$test_throttle" = "" ] && _supported_fmt throttle
55 echo "== checking interface =="
58 { "execute": "qmp_capabilities" }
59 { "execute": "blockdev-add",
65 { "execute": "object-add",
67 "qom-type": "throttle-group",
76 { "execute": "blockdev-add",
79 "node-name": "throttle0",
80 "throttle-group": "group0",
84 { "execute": "query-named-block-nodes" }
85 { "execute": "query-block" }
90 echo "== property changes in ThrottleGroup =="
93 { "execute": "qmp_capabilities" }
94 { "execute": "object-add",
96 "qom-type": "throttle-group",
105 { "execute" : "qom-get",
108 "property" : "limits"
111 { "execute" : "qom-set",
114 "property" : "limits",
120 { "execute" : "qom-get",
123 "property" : "limits"
126 { "execute": "quit" }
130 echo "== object creation/set errors =="
133 { "execute": "qmp_capabilities" }
134 { "execute": "object-add",
136 "qom-type": "throttle-group",
145 { "execute" : "qom-set",
148 "property" : "x-iops-total",
152 { "execute" : "qom-set",
155 "property" : "limits",
162 { "execute": "quit" }
166 echo "== don't specify group =="
169 { "execute": "qmp_capabilities" }
170 { "execute": "blockdev-add",
176 { "execute": "blockdev-add",
178 "driver": "throttle",
179 "node-name": "throttle0",
183 { "execute": "quit" }