diff options
author | Max Reitz <mreitz@redhat.com> | 2017-04-03 19:51:50 +0200 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2017-04-07 14:44:06 +0200 |
commit | 5694923ad1c60a86383244793663c0715bd88e83 (patch) | |
tree | 18eebd64cbbc8c4b0cd41e8d0864c93e07ad4fcf /tests/qemu-iotests/iotests.py | |
parent | 7a25fcd056ddd34ee7abc906c957d252e2889461 (diff) | |
download | qemu-5694923ad1c60a86383244793663c0715bd88e83.zip |
iotests: Add mirror tests for orphaned source
Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'tests/qemu-iotests/iotests.py')
-rw-r--r-- | tests/qemu-iotests/iotests.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index bec8eb4b8d..abcf3c10e2 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -177,6 +177,14 @@ class VM(qtest.QEMUQtestMachine): self._num_drives += 1 return self + def add_blockdev(self, opts): + self._args.append('-blockdev') + if isinstance(opts, str): + self._args.append(opts) + else: + self._args.append(','.join(opts)) + return self + def pause_drive(self, drive, event=None): '''Pause drive r/w operations''' if not event: @@ -235,6 +243,13 @@ class QMPTestCase(unittest.TestCase): output[basestr[:-1]] = obj # Strip trailing '.' return output + def qmp_to_opts(self, obj): + obj = self.flatten_qmp_object(obj) + output_list = list() + for key in obj: + output_list += [key + '=' + obj[key]] + return ','.join(output_list) + def assert_qmp_absent(self, d, path): try: result = self.dictpath(d, path) |