diff options
Diffstat (limited to 'tests/qemu-iotests/iotests.py')
-rw-r--r-- | tests/qemu-iotests/iotests.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index 22439c43d3..7233983f3c 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -133,6 +133,14 @@ chown_re = re.compile(r"chown [0-9]+:[0-9]+") def filter_chown(msg): return chown_re.sub("chown UID:GID", msg) +def filter_qmp_event(event): + '''Filter a QMP event dict''' + event = dict(event) + if 'timestamp' in event: + event['timestamp']['seconds'] = 'SECS' + event['timestamp']['microseconds'] = 'USECS' + return event + def log(msg, filters=[]): for flt in filters: msg = flt(msg) @@ -200,6 +208,11 @@ class VM(qtest.QEMUQtestMachine): self._args.append(','.join(opts)) return self + def add_incoming(self, addr): + self._args.append('-incoming') + self._args.append(addr) + return self + def pause_drive(self, drive, event=None): '''Pause drive r/w operations''' if not event: |