diff options
| author | Fam Zheng | 2015-01-30 03:49:45 +0100 |
|---|---|---|
| committer | Stefan Hajnoczi | 2015-02-16 16:07:18 +0100 |
| commit | df89d112279779609d50db93b024ed71f0402854 (patch) | |
| tree | aba55eb683aae32b999b48c742ab971120cd08a1 | |
| parent | qemu-iotests: Add VM method qtest() to iotests.py (diff) | |
| download | qemu-df89d112279779609d50db93b024ed71f0402854.tar.gz qemu-df89d112279779609d50db93b024ed71f0402854.tar.xz qemu-df89d112279779609d50db93b024ed71f0402854.zip | |
qemu-iotests: Allow caller to disable underscore convertion for qmp
QMP command "block_set_io_throttle" expects underscores in parameters
instead of dashes: {iops,bps}_{rd,wr,max}.
Add optional argument conv_keys (defaults to True, backward compatible),
it will be used in IO throttling test case.
Reviewed-by: Benoit Canet <benoit@irqsave.net>
Signed-off-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Message-id: 1422586186-9925-5-git-send-email-famz@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
| -rw-r--r-- | tests/qemu-iotests/iotests.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index 85cb9a583f..14028540b3 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -185,11 +185,14 @@ class VM(object): self._popen = None underscore_to_dash = string.maketrans('_', '-') - def qmp(self, cmd, **args): + def qmp(self, cmd, conv_keys=True, **args): '''Invoke a QMP command and return the result dict''' qmp_args = dict() for k in args.keys(): - qmp_args[k.translate(self.underscore_to_dash)] = args[k] + if conv_keys: + qmp_args[k.translate(self.underscore_to_dash)] = args[k] + else: + qmp_args[k] = args[k] return self._qmp.cmd(cmd, args=qmp_args) |
