On 22.07.2016 10:00, Amit Shah wrote: > From: "Daniel P. Berrange" <berra...@redhat.com> > > The iotests module has a python class for controlling QEMU > processes. Pull the generic functionality out of this file > and create a scripts/qemu.py module containing a QEMUMachine > class. Put the QTest integration support into a subclass > QEMUQtestMachine. > > Signed-off-by: Daniel P. Berrange <berra...@redhat.com> > Message-Id: <1469020993-29426-4-git-send-email-berra...@redhat.com> > Signed-off-by: Amit Shah <amit.s...@redhat.com> > --- > scripts/qemu.py | 202 > ++++++++++++++++++++++++++++++++++++++++++ > scripts/qtest.py | 34 +++++++ > tests/qemu-iotests/iotests.py | 135 +--------------------------- > 3 files changed, 240 insertions(+), 131 deletions(-) > create mode 100644 scripts/qemu.py
[...] > diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py > index 1687c33..14427f4 100644 > --- a/tests/qemu-iotests/iotests.py > +++ b/tests/qemu-iotests/iotests.py [...] > @@ -148,27 +145,12 @@ def event_match(event, match=None): > > return True > > -class VM(object): > +class VM(qtest.QEMUMachine): Should this not be qtest.QEMUQtestMachine? With QEMUMachine, I get failures like this when attempting to run tests for the wrong format (e.g. ./check -raw 30): Traceback (most recent call last): File "030", line 23, in <module> import iotests File "./tests/qemu-iotests/iotests.py", line 148, in <module> class VM(qtest.QEMUMachine): AttributeError: 'module' object has no attribute 'QEMUMachine Max > '''A QEMU VM''' > > def __init__(self): > - self._monitor_path = os.path.join(test_dir, 'qemu-mon.%d' % > os.getpid()) > - self._qemu_log_path = os.path.join(test_dir, 'qemu-log.%d' % > os.getpid()) > - self._qtest_path = os.path.join(test_dir, 'qemu-qtest.%d' % > os.getpid()) > - self._args = qemu_args + ['-chardev', > - 'socket,id=mon,path=' + self._monitor_path, > - '-mon', 'chardev=mon,mode=control', > - '-qtest', 'unix:path=' + self._qtest_path, > - '-machine', 'accel=qtest', > - '-display', 'none', '-vga', 'none'] > + super(self, VM).__init__(qemu_prog, qemu_opts, test_dir) > self._num_drives = 0 > - self._events = [] > - > - # This can be used to add an unused monitor instance. > - def add_monitor_telnet(self, ip, port): > - args = 'tcp:%s:%d,server,nowait,telnet' % (ip, port) > - self._args.append('-monitor') > - self._args.append(args) > > def add_drive_raw(self, opts): > self._args.append('-drive')
signature.asc
Description: OpenPGP digital signature