4 # Test I/O throttle block filter driver interface
6 # Copyright (C) 2017 Manos Pitsidianakis
8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 2 of the License, or
11 # (at your option) any later version.
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this program. If not, see <http://www.gnu.org/licenses/>.
23 owner
="Manos Pitsidianakis"
26 echo "QA output created by $seq"
28 status
=1 # failure is the default!
30 trap "exit \$status" 0 1 2 3 15
32 # get standard environment, filters and checks
37 _require_drivers throttle
41 echo Testing
: "$@" | _filter_imgfmt
42 $QEMU -nographic -qmp-pretty stdio
-serial none
"$@"
48 do_run_qemu
"$@" 2>&1 | _filter_testdir | _filter_qemu | _filter_qmp\
49 | _filter_qemu_io | _filter_generated_node_ids
52 test_throttle
=$
($QEMU_IMG --help|
grep throttle
)
53 [ "$test_throttle" = "" ] && _supported_fmt throttle
56 echo "== checking interface =="
59 { "execute": "qmp_capabilities" }
60 { "execute": "blockdev-add",
66 { "execute": "object-add",
68 "qom-type": "throttle-group",
77 { "execute": "blockdev-add",
80 "node-name": "throttle0",
81 "throttle-group": "group0",
85 { "execute": "query-named-block-nodes" }
86 { "execute": "query-block" }
91 echo "== property changes in ThrottleGroup =="
94 { "execute": "qmp_capabilities" }
95 { "execute": "object-add",
97 "qom-type": "throttle-group",
106 { "execute" : "qom-get",
109 "property" : "limits"
112 { "execute" : "qom-set",
115 "property" : "limits",
121 { "execute" : "qom-get",
124 "property" : "limits"
127 { "execute": "quit" }
131 echo "== object creation/set errors =="
134 { "execute": "qmp_capabilities" }
135 { "execute": "object-add",
137 "qom-type": "throttle-group",
146 { "execute" : "qom-set",
149 "property" : "x-iops-total",
153 { "execute" : "qom-set",
156 "property" : "limits",
163 { "execute": "quit" }
167 echo "== don't specify group =="
170 { "execute": "qmp_capabilities" }
171 { "execute": "blockdev-add",
177 { "execute": "blockdev-add",
179 "driver": "throttle",
180 "node-name": "throttle0",
184 { "execute": "quit" }