From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58272) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bRpOq-0004HG-GG for qemu-devel@nongnu.org; Mon, 25 Jul 2016 19:35:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bRpOm-0006JL-8t for qemu-devel@nongnu.org; Mon, 25 Jul 2016 19:35:03 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59566) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bRpOm-0006JH-0O for qemu-devel@nongnu.org; Mon, 25 Jul 2016 19:35:00 -0400 References: <66613974468fb6e1609fb3eabf55981b1ee436cf.1469174334.git.amit.shah@redhat.com> From: Max Reitz Message-ID: Date: Tue, 26 Jul 2016 01:34:55 +0200 MIME-Version: 1.0 In-Reply-To: <66613974468fb6e1609fb3eabf55981b1ee436cf.1469174334.git.amit.shah@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="Nq8IspDhIpjIOTnAEXHxBH116AFo4m5E7" Subject: Re: [Qemu-devel] [PULL 4/7] scripts: refactor the VM class in iotests for reuse List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Amit Shah , qemu list Cc: Peter Maydell , "Dr. David Alan Gilbert" , Juan Quintela , "Daniel P. Berrange" This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --Nq8IspDhIpjIOTnAEXHxBH116AFo4m5E7 From: Max Reitz To: Amit Shah , qemu list Cc: Peter Maydell , "Dr. David Alan Gilbert" , Juan Quintela , "Daniel P. Berrange" Message-ID: Subject: Re: [Qemu-devel] [PULL 4/7] scripts: refactor the VM class in iotests for reuse References: <66613974468fb6e1609fb3eabf55981b1ee436cf.1469174334.git.amit.shah@redhat.com> In-Reply-To: <66613974468fb6e1609fb3eabf55981b1ee436cf.1469174334.git.amit.shah@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 22.07.2016 10:00, Amit Shah wrote: > From: "Daniel P. Berrange" >=20 > 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. >=20 > Signed-off-by: Daniel P. Berrange > Message-Id: <1469020993-29426-4-git-send-email-berrange@redhat.com> > Signed-off-by: Amit Shah > --- > 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= =2Epy > 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=3DNone): > =20 > return True > =20 > -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 import iotests File "./tests/qemu-iotests/iotests.py", line 148, in class VM(qtest.QEMUMachine): AttributeError: 'module' object has no attribute 'QEMUMachine Max > '''A QEMU VM''' > =20 > def __init__(self): > - self._monitor_path =3D os.path.join(test_dir, 'qemu-mon.%d' % = os.getpid()) > - self._qemu_log_path =3D os.path.join(test_dir, 'qemu-log.%d' %= os.getpid()) > - self._qtest_path =3D os.path.join(test_dir, 'qemu-qtest.%d' % = os.getpid()) > - self._args =3D qemu_args + ['-chardev', > - 'socket,id=3Dmon,path=3D' + self._monitor_path, > - '-mon', 'chardev=3Dmon,mode=3Dcontrol', > - '-qtest', 'unix:path=3D' + self._qtest_path, > - '-machine', 'accel=3Dqtest', > - '-display', 'none', '-vga', 'none'] > + super(self, VM).__init__(qemu_prog, qemu_opts, test_dir) > self._num_drives =3D 0 > - self._events =3D [] > - > - # This can be used to add an unused monitor instance. > - def add_monitor_telnet(self, ip, port): > - args =3D 'tcp:%s:%d,server,nowait,telnet' % (ip, port) > - self._args.append('-monitor') > - self._args.append(args) > =20 > def add_drive_raw(self, opts): > self._args.append('-drive') --Nq8IspDhIpjIOTnAEXHxBH116AFo4m5E7 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEvBAEBCAAZBQJXlqIgEhxtcmVpdHpAcmVkaGF0LmNvbQAKCRA7sUIC6Disrcuf B/9/1Aic9I6hXp4qhf+6l2vAnvHBmKhuYUPMGzxKdXkR1tnHfI7WuuJL6rrM7puo T8nvksYFsnk8KTDp/KJiKBDZv0ljZiBpaGJnpQvudsgWI5f0bqV25sDOWCWOKDXL 5bEJ8z5EMosHCa7UckJYEgorgax8EHMqWt5/cLeP9SQa4N6xnOkI+Lc4PEHnyPBU FdHLVFuC4uSRs5T1zPAcp0DpKf93+ZwT6eUOIoqTFYHhv5Imc/O4/u+l6g37X0Ty rPDIazSRdPMjzEQG0tLnlYifnc5g8GlHsJZQuovdLyQQmLDFH6NIpmSYYKykn1Mg 9Fhs1AUKoz9occR11PVl2Cd0 =8SZw -----END PGP SIGNATURE----- --Nq8IspDhIpjIOTnAEXHxBH116AFo4m5E7--