From nobody Mon Apr 29 10:49:08 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1539976890318395.9671498335606; Fri, 19 Oct 2018 12:21:30 -0700 (PDT) Received: from localhost ([::1]:52324 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gDaKu-0008BL-O3 for importer@patchew.org; Fri, 19 Oct 2018 15:21:28 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59723) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gDaFb-0003uU-AR for qemu-devel@nongnu.org; Fri, 19 Oct 2018 15:16:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gDaFX-0005Hn-3P for qemu-devel@nongnu.org; Fri, 19 Oct 2018 15:15:59 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55078) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gDaFI-0004s2-No; Fri, 19 Oct 2018 15:15:43 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1E7F57854A; Fri, 19 Oct 2018 19:15:28 +0000 (UTC) Received: from localhost (unknown [10.40.205.230]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A2F2787C5; Fri, 19 Oct 2018 19:15:27 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Date: Fri, 19 Oct 2018 21:15:15 +0200 Message-Id: <20181019191523.12157-2-mreitz@redhat.com> In-Reply-To: <20181019191523.12157-1-mreitz@redhat.com> References: <20181019191523.12157-1-mreitz@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Fri, 19 Oct 2018 19:15:28 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v2 1/9] iotests: Make nbd-fault-injector flush X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Cleber Rosa , qemu-devel@nongnu.org, Eduardo Habkost , Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RDMRC_1 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" When closing a connection, make the nbd-fault-injector flush the socket. Without this, the output is a bit unreliable with Python 3. Signed-off-by: Max Reitz Reviewed-by: Eduardo Habkost Reviewed-by: Cleber Rosa Reviewed-by: Eric Blake Tested-by: Cleber Rosa --- tests/qemu-iotests/083.out | 9 +++++++++ tests/qemu-iotests/nbd-fault-injector.py | 1 + 2 files changed, 10 insertions(+) diff --git a/tests/qemu-iotests/083.out b/tests/qemu-iotests/083.out index be6079d27e..f9af8bb691 100644 --- a/tests/qemu-iotests/083.out +++ b/tests/qemu-iotests/083.out @@ -41,6 +41,7 @@ can't open device nbd+tcp://127.0.0.1:PORT/foo =20 =3D=3D=3D Check disconnect after neg2 =3D=3D=3D =20 +Unable to read from socket: Connection reset by peer Connection closed read failed: Input/output error =20 @@ -54,6 +55,7 @@ can't open device nbd+tcp://127.0.0.1:PORT/foo =20 =3D=3D=3D Check disconnect before request =3D=3D=3D =20 +Unable to read from socket: Connection reset by peer Connection closed read failed: Input/output error =20 @@ -116,6 +118,7 @@ can't open device nbd+tcp://127.0.0.1:PORT/ =20 =3D=3D=3D Check disconnect after neg-classic =3D=3D=3D =20 +Unable to read from socket: Connection reset by peer Connection closed read failed: Input/output error =20 @@ -161,6 +164,8 @@ can't open device nbd+unix:///foo?socket=3DTEST_DIR/nbd= .sock =20 =3D=3D=3D Check disconnect after neg2 =3D=3D=3D =20 +Unable to read from socket: Connection reset by peer +Connection closed read failed: Input/output error =20 =3D=3D=3D Check disconnect 8 neg2 =3D=3D=3D @@ -173,6 +178,8 @@ can't open device nbd+unix:///foo?socket=3DTEST_DIR/nbd= .sock =20 =3D=3D=3D Check disconnect before request =3D=3D=3D =20 +Unable to read from socket: Connection reset by peer +Connection closed read failed: Input/output error =20 =3D=3D=3D Check disconnect after request =3D=3D=3D @@ -234,6 +241,8 @@ can't open device nbd+unix:///?socket=3DTEST_DIR/nbd.so= ck =20 =3D=3D=3D Check disconnect after neg-classic =3D=3D=3D =20 +Unable to read from socket: Connection reset by peer +Connection closed read failed: Input/output error =20 *** done diff --git a/tests/qemu-iotests/nbd-fault-injector.py b/tests/qemu-iotests/= nbd-fault-injector.py index f9193c0fae..439a090eb6 100755 --- a/tests/qemu-iotests/nbd-fault-injector.py +++ b/tests/qemu-iotests/nbd-fault-injector.py @@ -112,6 +112,7 @@ class FaultInjectionSocket(object): if rule.match(event, io): if rule.when =3D=3D 0 or bufsize is None: print('Closing connection on rule match %s' % rule.nam= e) + self.sock.flush() sys.exit(0) if rule.when !=3D -1: return rule.when --=20 2.17.1 From nobody Mon Apr 29 10:49:08 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1539976764561661.8789461536802; Fri, 19 Oct 2018 12:19:24 -0700 (PDT) Received: from localhost ([::1]:52310 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gDaIt-0006d7-EW for importer@patchew.org; Fri, 19 Oct 2018 15:19:23 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59719) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gDaFb-0003uS-9p for qemu-devel@nongnu.org; Fri, 19 Oct 2018 15:16:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gDaFX-0005Hu-4K for qemu-devel@nongnu.org; Fri, 19 Oct 2018 15:15:59 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37634) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gDaFM-0004vQ-NY; Fri, 19 Oct 2018 15:15:45 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7AEF831649BF; Fri, 19 Oct 2018 19:15:30 +0000 (UTC) Received: from localhost (unknown [10.40.205.230]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 07C02194A8; Fri, 19 Oct 2018 19:15:29 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Date: Fri, 19 Oct 2018 21:15:16 +0200 Message-Id: <20181019191523.12157-3-mreitz@redhat.com> In-Reply-To: <20181019191523.12157-1-mreitz@redhat.com> References: <20181019191523.12157-1-mreitz@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Fri, 19 Oct 2018 19:15:30 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v2 2/9] iotests: Flush in iotests.py's QemuIoInteractive X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Cleber Rosa , qemu-devel@nongnu.org, Eduardo Habkost , Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RDMRC_1 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" After issuing a command, flush the pipe. This does not change anything in Python 2, but it makes a difference in Python 3. Signed-off-by: Max Reitz Reviewed-by: Eduardo Habkost Reviewed-by: Cleber Rosa Tested-by: Cleber Rosa --- tests/qemu-iotests/iotests.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index 4e67fbbe96..10f2d17419 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -178,6 +178,7 @@ class QemuIoInteractive: cmd =3D cmd.strip() assert cmd !=3D 'q' and cmd !=3D 'quit' self._p.stdin.write(cmd + '\n') + self._p.stdin.flush() return self._read_output() =20 =20 --=20 2.17.1 From nobody Mon Apr 29 10:49:08 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1539976707352112.4441410016218; Fri, 19 Oct 2018 12:18:27 -0700 (PDT) Received: from localhost ([::1]:52309 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gDaHw-0005Fl-2F for importer@patchew.org; Fri, 19 Oct 2018 15:18:24 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59714) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gDaFb-0003uN-8m for qemu-devel@nongnu.org; Fri, 19 Oct 2018 15:16:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gDaFX-0005ID-Bb for qemu-devel@nongnu.org; Fri, 19 Oct 2018 15:15:59 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37266) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gDaFP-0004ws-AF; Fri, 19 Oct 2018 15:15:48 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0D0B530F8C16; Fri, 19 Oct 2018 19:15:33 +0000 (UTC) Received: from localhost (unknown [10.40.205.230]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 607F06C202; Fri, 19 Oct 2018 19:15:32 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Date: Fri, 19 Oct 2018 21:15:17 +0200 Message-Id: <20181019191523.12157-4-mreitz@redhat.com> In-Reply-To: <20181019191523.12157-1-mreitz@redhat.com> References: <20181019191523.12157-1-mreitz@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Fri, 19 Oct 2018 19:15:33 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v2 3/9] iotests: Use Python byte strings where appropriate X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Cleber Rosa , qemu-devel@nongnu.org, Eduardo Habkost , Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RDMRC_1 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Since byte strings are no longer the default in Python 3, we have to explicitly use them where we need to, which is mostly when working with structures. It also means that we need to open a file in binary mode when we want to use structures. On the other hand, we have to accomodate for the fact that some functions (still) work with byte strings but we want to use unicode strings (in Python 3 at least, and it does not matter in Python 2). This includes base64 encoding, but it is most notable when working with the subprocess module: Either we set universal_newlines to True so that the default streams are opened in text mode (hence this parameter is aliased as "text" as of 3.7), or, if that is not possible, we have to decode the output to a normal string. Signed-off-by: Max Reitz Reviewed-by: Eduardo Habkost Tested-by: Cleber Rosa --- scripts/qtest.py | 2 +- tests/qemu-iotests/044 | 8 ++++---- tests/qemu-iotests/149 | 8 +++++--- tests/qemu-iotests/207 | 4 ++-- tests/qemu-iotests/iotests.py | 11 +++++++---- tests/qemu-iotests/nbd-fault-injector.py | 4 ++-- tests/qemu-iotests/qcow2.py | 10 +++++----- 7 files changed, 26 insertions(+), 21 deletions(-) diff --git a/scripts/qtest.py b/scripts/qtest.py index df0daf26ca..adf1fe3f26 100644 --- a/scripts/qtest.py +++ b/scripts/qtest.py @@ -64,7 +64,7 @@ class QEMUQtestProtocol(object): =20 @param qtest_cmd: qtest command text to be sent """ - self._sock.sendall(qtest_cmd + "\n") + self._sock.sendall((qtest_cmd + "\n").encode('utf-8')) =20 def close(self): self._sock.close() diff --git a/tests/qemu-iotests/044 b/tests/qemu-iotests/044 index 11ea0f4d35..69e736f687 100755 --- a/tests/qemu-iotests/044 +++ b/tests/qemu-iotests/044 @@ -53,21 +53,21 @@ class TestRefcountTableGrowth(iotests.QMPTestCase): fd.seek(off_reftable) =20 for i in xrange(0, h.refcount_table_clusters): - sector =3D ''.join(struct.pack('>Q', + sector =3D b''.join(struct.pack('>Q', off_refblock + i * 64 * 512 + j * 512) for j in xrange(0, 64)) fd.write(sector) =20 # Write the refcount blocks assert(fd.tell() =3D=3D off_refblock) - sector =3D ''.join(struct.pack('>H', 1) for j in xrange(0, 64 = * 256)) + sector =3D b''.join(struct.pack('>H', 1) for j in range(0, 64 = * 256)) for block in xrange(0, h.refcount_table_clusters): fd.write(sector) =20 # Write the L1 table assert(fd.tell() =3D=3D off_l1) assert(off_l2 + 512 * h.l1_size =3D=3D off_data) - table =3D ''.join(struct.pack('>Q', (1 << 63) | off_l2 + 512 *= j) + table =3D b''.join(struct.pack('>Q', (1 << 63) | off_l2 + 512 = * j) for j in xrange(0, h.l1_size)) fd.write(table) =20 @@ -85,7 +85,7 @@ class TestRefcountTableGrowth(iotests.QMPTestCase): remaining =3D remaining - 1024 * 512 off =3D off + 1024 * 512 =20 - table =3D ''.join(struct.pack('>Q', (1 << 63) | off + 512 * j) + table =3D b''.join(struct.pack('>Q', (1 << 63) | off + 512 * j) for j in xrange(0, remaining / 512)) fd.write(table) =20 diff --git a/tests/qemu-iotests/149 b/tests/qemu-iotests/149 index 9e0cad76f9..1225334cb8 100755 --- a/tests/qemu-iotests/149 +++ b/tests/qemu-iotests/149 @@ -79,7 +79,7 @@ class LUKSConfig(object): =20 def first_password_base64(self): (pw, slot) =3D self.first_password() - return base64.b64encode(pw) + return base64.b64encode(pw.encode('ascii')).decode('ascii') =20 def active_slots(self): slots =3D [] @@ -98,7 +98,8 @@ def verify_passwordless_sudo(): proc =3D subprocess.Popen(args, stdin=3Dsubprocess.PIPE, stdout=3Dsubprocess.PIPE, - stderr=3Dsubprocess.STDOUT) + stderr=3Dsubprocess.STDOUT, + universal_newlines=3DTrue) =20 msg =3D proc.communicate()[0] =20 @@ -116,7 +117,8 @@ def cryptsetup(args, password=3DNone): proc =3D subprocess.Popen(fullargs, stdin=3Dsubprocess.PIPE, stdout=3Dsubprocess.PIPE, - stderr=3Dsubprocess.STDOUT) + stderr=3Dsubprocess.STDOUT, + universal_newlines=3DTrue) =20 msg =3D proc.communicate(password)[0] =20 diff --git a/tests/qemu-iotests/207 b/tests/qemu-iotests/207 index 444ae233ae..2d86a3da37 100755 --- a/tests/qemu-iotests/207 +++ b/tests/qemu-iotests/207 @@ -109,7 +109,7 @@ with iotests.FilePath('t.img') as disk_path, \ md5_key =3D subprocess.check_output( 'ssh-keyscan -t rsa 127.0.0.1 2>/dev/null | grep -v "\\^#" | ' + 'cut -d" " -f3 | base64 -d | md5sum -b | cut -d" " -f1', - shell=3DTrue).rstrip() + shell=3DTrue).rstrip().decode('ascii') =20 vm.launch() blockdev_create(vm, { 'driver': 'ssh', @@ -147,7 +147,7 @@ with iotests.FilePath('t.img') as disk_path, \ sha1_key =3D subprocess.check_output( 'ssh-keyscan -t rsa 127.0.0.1 2>/dev/null | grep -v "\\^#" | ' + 'cut -d" " -f3 | base64 -d | sha1sum -b | cut -d" " -f1', - shell=3DTrue).rstrip() + shell=3DTrue).rstrip().decode('ascii') =20 vm.launch() blockdev_create(vm, { 'driver': 'ssh', diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index 10f2d17419..7290c0b159 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -104,7 +104,8 @@ def qemu_img_pipe(*args): '''Run qemu-img and return its output''' subp =3D subprocess.Popen(qemu_img_args + list(args), stdout=3Dsubprocess.PIPE, - stderr=3Dsubprocess.STDOUT) + stderr=3Dsubprocess.STDOUT, + universal_newlines=3DTrue) exitcode =3D subp.wait() if exitcode < 0: sys.stderr.write('qemu-img received signal %i: %s\n' % (-exitcode,= ' '.join(qemu_img_args + list(args)))) @@ -128,7 +129,8 @@ def qemu_io(*args): '''Run qemu-io and return the stdout data''' args =3D qemu_io_args + list(args) subp =3D subprocess.Popen(args, stdout=3Dsubprocess.PIPE, - stderr=3Dsubprocess.STDOUT) + stderr=3Dsubprocess.STDOUT, + universal_newlines=3DTrue) exitcode =3D subp.wait() if exitcode < 0: sys.stderr.write('qemu-io received signal %i: %s\n' % (-exitcode, = ' '.join(args))) @@ -149,7 +151,8 @@ class QemuIoInteractive: self.args =3D qemu_io_args + list(args) self._p =3D subprocess.Popen(self.args, stdin=3Dsubprocess.PIPE, stdout=3Dsubprocess.PIPE, - stderr=3Dsubprocess.STDOUT) + stderr=3Dsubprocess.STDOUT, + universal_newlines=3DTrue) assert self._p.stdout.read(9) =3D=3D 'qemu-io> ' =20 def close(self): @@ -193,7 +196,7 @@ def compare_images(img1, img2, fmt1=3Dimgfmt, fmt2=3Dim= gfmt): =20 def create_image(name, size): '''Create a fully-allocated raw image with sector markers''' - file =3D open(name, 'w') + file =3D open(name, 'wb') i =3D 0 while i < size: sector =3D struct.pack('>l504xl', i / 512, i / 512) diff --git a/tests/qemu-iotests/nbd-fault-injector.py b/tests/qemu-iotests/= nbd-fault-injector.py index 439a090eb6..d45e2e0a6a 100755 --- a/tests/qemu-iotests/nbd-fault-injector.py +++ b/tests/qemu-iotests/nbd-fault-injector.py @@ -86,7 +86,7 @@ def recvall(sock, bufsize): raise Exception('unexpected disconnect') chunks.append(chunk) received +=3D len(chunk) - return ''.join(chunks) + return b''.join(chunks) =20 class Rule(object): def __init__(self, name, event, io, when): @@ -177,7 +177,7 @@ def handle_connection(conn, use_export): req =3D read_request(conn) if req.type =3D=3D NBD_CMD_READ: write_reply(conn, 0, req.handle) - conn.send('\0' * req.len, event=3D'data') + conn.send(b'\0' * req.len, event=3D'data') elif req.type =3D=3D NBD_CMD_WRITE: _ =3D conn.recv(req.len, event=3D'data') write_reply(conn, 0, req.handle) diff --git a/tests/qemu-iotests/qcow2.py b/tests/qemu-iotests/qcow2.py index b95a837759..b392972d1b 100755 --- a/tests/qemu-iotests/qcow2.py +++ b/tests/qemu-iotests/qcow2.py @@ -10,7 +10,7 @@ class QcowHeaderExtension: def __init__(self, magic, length, data): if length % 8 !=3D 0: padding =3D 8 - (length % 8) - data +=3D "\0" * padding + data +=3D b"\0" * padding =20 self.magic =3D magic self.length =3D length @@ -103,7 +103,7 @@ class QcowHeader: =20 fd.seek(self.header_length) extensions =3D self.extensions - extensions.append(QcowHeaderExtension(0, 0, "")) + extensions.append(QcowHeaderExtension(0, 0, b"")) for ex in extensions: buf =3D struct.pack('>II', ex.magic, ex.length) fd.write(buf) @@ -137,8 +137,8 @@ class QcowHeader: for ex in self.extensions: =20 data =3D ex.data[:ex.length] - if all(c in string.printable for c in data): - data =3D "'%s'" % data + if all(c in string.printable.encode('ascii') for c in data): + data =3D "'%s'" % data.decode('ascii') else: data =3D "" =20 @@ -178,7 +178,7 @@ def cmd_add_header_ext(fd, magic, data): sys.exit(1) =20 h =3D QcowHeader(fd) - h.extensions.append(QcowHeaderExtension.create(magic, data)) + h.extensions.append(QcowHeaderExtension.create(magic, data.encode('asc= ii'))) h.update(fd) =20 def cmd_add_header_ext_stdio(fd, magic): --=20 2.17.1 From nobody Mon Apr 29 10:49:08 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1539977037503639.7037375321656; Fri, 19 Oct 2018 12:23:57 -0700 (PDT) Received: from localhost ([::1]:52340 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gDaNI-0002K1-4o for importer@patchew.org; Fri, 19 Oct 2018 15:23:56 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59716) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gDaFb-0003uQ-9N for qemu-devel@nongnu.org; Fri, 19 Oct 2018 15:16:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gDaFX-0005I7-9F for qemu-devel@nongnu.org; Fri, 19 Oct 2018 15:15:59 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37656) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gDaFP-000528-7Z; Fri, 19 Oct 2018 15:15:48 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 91EDE3168ABE; Fri, 19 Oct 2018 19:15:35 +0000 (UTC) Received: from localhost (unknown [10.40.205.230]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E9FC01057047; Fri, 19 Oct 2018 19:15:34 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Date: Fri, 19 Oct 2018 21:15:18 +0200 Message-Id: <20181019191523.12157-5-mreitz@redhat.com> In-Reply-To: <20181019191523.12157-1-mreitz@redhat.com> References: <20181019191523.12157-1-mreitz@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Fri, 19 Oct 2018 19:15:35 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v2 4/9] iotests: Use // for Python integer division X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Cleber Rosa , qemu-devel@nongnu.org, Eduardo Habkost , Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RDMRC_1 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" In Python 3, / is always a floating-point division. We usually do not want this, and as Python 2.7 understands // as well, change all integer divisions to use that. Signed-off-by: Max Reitz Reviewed-by: Cleber Rosa Reviewed-by: Eduardo Habkost Tested-by: Cleber Rosa --- tests/qemu-iotests/030 | 2 +- tests/qemu-iotests/040 | 4 ++-- tests/qemu-iotests/041 | 4 ++-- tests/qemu-iotests/044 | 2 +- tests/qemu-iotests/093 | 18 +++++++++--------- tests/qemu-iotests/136 | 2 +- tests/qemu-iotests/149 | 6 +++--- tests/qemu-iotests/151 | 12 ++++++------ tests/qemu-iotests/163 | 2 +- tests/qemu-iotests/iotests.py | 2 +- tests/qemu-iotests/qed.py | 6 +++--- 11 files changed, 30 insertions(+), 30 deletions(-) diff --git a/tests/qemu-iotests/030 b/tests/qemu-iotests/030 index 1dbc2ddc49..276e06b5ba 100755 --- a/tests/qemu-iotests/030 +++ b/tests/qemu-iotests/030 @@ -521,7 +521,7 @@ new_state =3D "2" state =3D "2" event =3D "%s" new_state =3D "1" -''' % (event, errno, self.STREAM_BUFFER_SIZE / 512, event, event)) +''' % (event, errno, self.STREAM_BUFFER_SIZE // 512, event, event)) file.close() =20 class TestEIO(TestErrors): diff --git a/tests/qemu-iotests/040 b/tests/qemu-iotests/040 index 1cb1ceeb33..b81133a474 100755 --- a/tests/qemu-iotests/040 +++ b/tests/qemu-iotests/040 @@ -195,7 +195,7 @@ class TestSingleDrive(ImageCommitTestCase): =20 self.assert_no_active_block_jobs() result =3D self.vm.qmp('block-commit', device=3D'drive0', top=3Dmi= d_img, - base=3Dbacking_img, speed=3D(self.image_len /= 4)) + base=3Dbacking_img, speed=3D(self.image_len /= / 4)) self.assert_qmp(result, 'return', {}) result =3D self.vm.qmp('device_del', id=3D'scsi0') self.assert_qmp(result, 'return', {}) @@ -225,7 +225,7 @@ class TestSingleDrive(ImageCommitTestCase): =20 self.assert_no_active_block_jobs() result =3D self.vm.qmp('block-commit', device=3D'drive0', top=3Dmi= d_img, - base=3Dbacking_img, speed=3D(self.image_len /= 4)) + base=3Dbacking_img, speed=3D(self.image_len /= / 4)) self.assert_qmp(result, 'return', {}) =20 result =3D self.vm.qmp('query-block') diff --git a/tests/qemu-iotests/041 b/tests/qemu-iotests/041 index 9336ab6ff5..3615011d98 100755 --- a/tests/qemu-iotests/041 +++ b/tests/qemu-iotests/041 @@ -404,7 +404,7 @@ new_state =3D "2" state =3D "2" event =3D "%s" new_state =3D "1" -''' % (event, errno, self.MIRROR_GRANULARITY / 512, event, event)) +''' % (event, errno, self.MIRROR_GRANULARITY // 512, event, event)) file.close() =20 def setUp(self): @@ -569,7 +569,7 @@ new_state =3D "2" state =3D "2" event =3D "%s" new_state =3D "1" -''' % (event, errno, self.MIRROR_GRANULARITY / 512, event, event)) +''' % (event, errno, self.MIRROR_GRANULARITY // 512, event, event)) file.close() =20 def setUp(self): diff --git a/tests/qemu-iotests/044 b/tests/qemu-iotests/044 index 69e736f687..7ef5e46fe9 100755 --- a/tests/qemu-iotests/044 +++ b/tests/qemu-iotests/044 @@ -86,7 +86,7 @@ class TestRefcountTableGrowth(iotests.QMPTestCase): off =3D off + 1024 * 512 =20 table =3D b''.join(struct.pack('>Q', (1 << 63) | off + 512 * j) - for j in xrange(0, remaining / 512)) + for j in xrange(0, remaining // 512)) fd.write(table) =20 =20 diff --git a/tests/qemu-iotests/093 b/tests/qemu-iotests/093 index 9d1971a56c..d88fbc182e 100755 --- a/tests/qemu-iotests/093 +++ b/tests/qemu-iotests/093 @@ -69,18 +69,18 @@ class ThrottleTestCase(iotests.QMPTestCase): # in. The throttled requests won't be executed until we # advance the virtual clock. rq_size =3D 512 - rd_nr =3D max(params['bps'] / rq_size / 2, - params['bps_rd'] / rq_size, - params['iops'] / 2, + rd_nr =3D max(params['bps'] // rq_size // 2, + params['bps_rd'] // rq_size, + params['iops'] // 2, params['iops_rd']) rd_nr *=3D seconds * 2 - rd_nr /=3D ndrives - wr_nr =3D max(params['bps'] / rq_size / 2, - params['bps_wr'] / rq_size, - params['iops'] / 2, + rd_nr //=3D ndrives + wr_nr =3D max(params['bps'] // rq_size // 2, + params['bps_wr'] // rq_size, + params['iops'] // 2, params['iops_wr']) wr_nr *=3D seconds * 2 - wr_nr /=3D ndrives + wr_nr //=3D ndrives =20 # Send I/O requests to all drives for i in range(rd_nr): @@ -196,7 +196,7 @@ class ThrottleTestCase(iotests.QMPTestCase): self.configure_throttle(ndrives, settings) =20 # Wait for the bucket to empty so we can do bursts - wait_ns =3D nsec_per_sec * burst_length * burst_rate / rate + wait_ns =3D nsec_per_sec * burst_length * burst_rate // rate self.vm.qtest("clock_step %d" % wait_ns) =20 # Test I/O at the max burst rate diff --git a/tests/qemu-iotests/136 b/tests/qemu-iotests/136 index a154d8ef9d..af7ffa4540 100755 --- a/tests/qemu-iotests/136 +++ b/tests/qemu-iotests/136 @@ -24,7 +24,7 @@ import os =20 interval_length =3D 10 nsec_per_sec =3D 1000000000 -op_latency =3D nsec_per_sec / 1000 # See qtest_latency_ns in accounting.c +op_latency =3D nsec_per_sec // 1000 # See qtest_latency_ns in accounting.c bad_sector =3D 8192 bad_offset =3D bad_sector * 512 blkdebug_file =3D os.path.join(iotests.test_dir, 'blkdebug.conf') diff --git a/tests/qemu-iotests/149 b/tests/qemu-iotests/149 index 1225334cb8..4f363f295f 100755 --- a/tests/qemu-iotests/149 +++ b/tests/qemu-iotests/149 @@ -314,13 +314,13 @@ def test_once(config, qemu_img=3DFalse): image_size =3D 4 * oneTB if qemu_img: iotests.log("# Create image") - qemu_img_create(config, image_size / oneMB) + qemu_img_create(config, image_size // oneMB) else: iotests.log("# Create image") - create_image(config, image_size / oneMB) + create_image(config, image_size // oneMB) =20 lowOffsetMB =3D 100 - highOffsetMB =3D 3 * oneTB / oneMB + highOffsetMB =3D 3 * oneTB // oneMB =20 try: if not qemu_img: diff --git a/tests/qemu-iotests/151 b/tests/qemu-iotests/151 index fe53b9f446..1bb74d67c4 100755 --- a/tests/qemu-iotests/151 +++ b/tests/qemu-iotests/151 @@ -67,9 +67,9 @@ class TestActiveMirror(iotests.QMPTestCase): 'write -P 1 0 %i' % self.image_len); =20 # Start some background requests - for offset in range(1 * self.image_len / 8, 3 * self.image_len / 8= , 1024 * 1024): + for offset in range(1 * self.image_len // 8, 3 * self.image_len //= 8, 1024 * 1024): self.vm.hmp_qemu_io('source', 'aio_write -P 2 %i 1M' % offset) - for offset in range(2 * self.image_len / 8, 3 * self.image_len / 8= , 1024 * 1024): + for offset in range(2 * self.image_len // 8, 3 * self.image_len //= 8, 1024 * 1024): self.vm.hmp_qemu_io('source', 'aio_write -z %i 1M' % offset) =20 # Start the block job @@ -83,9 +83,9 @@ class TestActiveMirror(iotests.QMPTestCase): self.assert_qmp(result, 'return', {}) =20 # Start some more requests - for offset in range(3 * self.image_len / 8, 5 * self.image_len / 8= , 1024 * 1024): + for offset in range(3 * self.image_len // 8, 5 * self.image_len //= 8, 1024 * 1024): self.vm.hmp_qemu_io('source', 'aio_write -P 3 %i 1M' % offset) - for offset in range(4 * self.image_len / 8, 5 * self.image_len / 8= , 1024 * 1024): + for offset in range(4 * self.image_len // 8, 5 * self.image_len //= 8, 1024 * 1024): self.vm.hmp_qemu_io('source', 'aio_write -z %i 1M' % offset) =20 # Wait for the READY event @@ -95,9 +95,9 @@ class TestActiveMirror(iotests.QMPTestCase): # the source) should be settled using the active mechanism. # The mirror code itself asserts that the source BDS's dirty # bitmap will stay clean between READY and COMPLETED. - for offset in range(5 * self.image_len / 8, 7 * self.image_len / 8= , 1024 * 1024): + for offset in range(5 * self.image_len // 8, 7 * self.image_len //= 8, 1024 * 1024): self.vm.hmp_qemu_io('source', 'aio_write -P 3 %i 1M' % offset) - for offset in range(6 * self.image_len / 8, 7 * self.image_len / 8= , 1024 * 1024): + for offset in range(6 * self.image_len // 8, 7 * self.image_len //= 8, 1024 * 1024): self.vm.hmp_qemu_io('source', 'aio_write -z %i 1M' % offset) =20 if sync_source_and_target: diff --git a/tests/qemu-iotests/163 b/tests/qemu-iotests/163 index 403842354e..5fd424761b 100755 --- a/tests/qemu-iotests/163 +++ b/tests/qemu-iotests/163 @@ -38,7 +38,7 @@ class ShrinkBaseClass(iotests.QMPTestCase): entry_bits =3D 3 entry_size =3D 1 << entry_bits l1_mask =3D 0x00fffffffffffe00 - div_roundup =3D lambda n, d: (n + d - 1) / d + div_roundup =3D lambda n, d: (n + d - 1) // d =20 def split_by_n(data, n): for x in xrange(0, len(data), n): diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index 7290c0b159..7ca94e9278 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -199,7 +199,7 @@ def create_image(name, size): file =3D open(name, 'wb') i =3D 0 while i < size: - sector =3D struct.pack('>l504xl', i / 512, i / 512) + sector =3D struct.pack('>l504xl', i // 512, i // 512) file.write(sector) i =3D i + 512 file.close() diff --git a/tests/qemu-iotests/qed.py b/tests/qemu-iotests/qed.py index ea469b9c48..8adaaf46c4 100755 --- a/tests/qemu-iotests/qed.py +++ b/tests/qemu-iotests/qed.py @@ -80,7 +80,7 @@ class QED(object): =20 def load_l1_table(self): self.l1_table =3D self.read_table(self.header['l1_table_offset']) - self.table_nelems =3D self.header['table_size'] * self.header['clu= ster_size'] / table_elem_size + self.table_nelems =3D self.header['table_size'] * self.header['clu= ster_size'] // table_elem_size =20 def write_table(self, offset, table): s =3D ''.join(pack_table_elem(x) for x in table) @@ -167,14 +167,14 @@ def cmd_zero_cluster(qed, pos, *args): n =3D int(args[0]) =20 for i in xrange(n): - l1_index =3D pos / qed.header['cluster_size'] / len(qed.l1_table) + l1_index =3D pos // qed.header['cluster_size'] // len(qed.l1_table) if qed.l1_table[l1_index] =3D=3D 0: err('no l2 table allocated') =20 l2_offset =3D qed.l1_table[l1_index] l2_table =3D qed.read_table(l2_offset) =20 - l2_index =3D (pos / qed.header['cluster_size']) % len(qed.l1_table) + l2_index =3D (pos // qed.header['cluster_size']) % len(qed.l1_tabl= e) l2_table[l2_index] =3D 1 # zero the data cluster qed.write_table(l2_offset, l2_table) pos +=3D qed.header['cluster_size'] --=20 2.17.1 From nobody Mon Apr 29 10:49:08 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1539977159123321.2424722012006; Fri, 19 Oct 2018 12:25:59 -0700 (PDT) Received: from localhost ([::1]:52356 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gDaP8-0003s4-N0 for importer@patchew.org; Fri, 19 Oct 2018 15:25:50 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59782) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gDaFd-0003w2-8p for qemu-devel@nongnu.org; Fri, 19 Oct 2018 15:16:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gDaFb-0005M7-CI for qemu-devel@nongnu.org; Fri, 19 Oct 2018 15:16:01 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46400) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gDaFV-00056j-2R; Fri, 19 Oct 2018 15:15:53 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 16E5AC057E03; Fri, 19 Oct 2018 19:15:38 +0000 (UTC) Received: from localhost (unknown [10.40.205.230]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7407E194A8; Fri, 19 Oct 2018 19:15:37 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Date: Fri, 19 Oct 2018 21:15:19 +0200 Message-Id: <20181019191523.12157-6-mreitz@redhat.com> In-Reply-To: <20181019191523.12157-1-mreitz@redhat.com> References: <20181019191523.12157-1-mreitz@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Fri, 19 Oct 2018 19:15:38 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v2 5/9] iotests: Different iterator behavior in Python 3 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Cleber Rosa , qemu-devel@nongnu.org, Eduardo Habkost , Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RDMRC_1 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" In Python 3, several functions now return iterators instead of lists. This includes range(), items(), map(), and filter(). This means that if we really want a list, we have to wrap those instances with list(). But then again, the two instances where this is the case for map() and filter(), there are shorter expressions which work without either function. On the other hand, sometimes we do just want an iterator, in which case we have sometimes used xrange() and iteritems() which no longer exist in Python 3. Just change these calls to be range() and items(), works in both Python 2 and 3, and is really what we want in 3 (which is what matters). But because it is so simple to do (and to find and remove once we completely switch to Python 3), make range() be an alias for xrange() in the two affected tests (044 and 163). In one instance, we only wanted the first instance of the result of a filter() call. Instead of using next(filter()) which would work only in Python 3, or list(filter())[0] which would work everywhere but is a bit weird, this instance is changed to use list comprehension with a next() wrapped around, which works both in 2.7 and 3. Signed-off-by: Max Reitz Reviewed-by: Cleber Rosa Reviewed-by: Eduardo Habkost Tested-by: Cleber Rosa --- tests/qemu-iotests/044 | 16 ++++++++++------ tests/qemu-iotests/056 | 2 +- tests/qemu-iotests/065 | 4 ++-- tests/qemu-iotests/124 | 4 ++-- tests/qemu-iotests/139 | 2 +- tests/qemu-iotests/163 | 11 +++++++---- 6 files changed, 23 insertions(+), 16 deletions(-) diff --git a/tests/qemu-iotests/044 b/tests/qemu-iotests/044 index 7ef5e46fe9..9ec3dba734 100755 --- a/tests/qemu-iotests/044 +++ b/tests/qemu-iotests/044 @@ -26,6 +26,10 @@ import iotests from iotests import qemu_img, qemu_img_verbose, qemu_io import struct import subprocess +import sys + +if sys.version_info.major =3D=3D 2: + range =3D xrange =20 test_img =3D os.path.join(iotests.test_dir, 'test.img') =20 @@ -52,23 +56,23 @@ class TestRefcountTableGrowth(iotests.QMPTestCase): # Write a refcount table fd.seek(off_reftable) =20 - for i in xrange(0, h.refcount_table_clusters): + for i in range(0, h.refcount_table_clusters): sector =3D b''.join(struct.pack('>Q', off_refblock + i * 64 * 512 + j * 512) - for j in xrange(0, 64)) + for j in range(0, 64)) fd.write(sector) =20 # Write the refcount blocks assert(fd.tell() =3D=3D off_refblock) sector =3D b''.join(struct.pack('>H', 1) for j in range(0, 64 = * 256)) - for block in xrange(0, h.refcount_table_clusters): + for block in range(0, h.refcount_table_clusters): fd.write(sector) =20 # Write the L1 table assert(fd.tell() =3D=3D off_l1) assert(off_l2 + 512 * h.l1_size =3D=3D off_data) table =3D b''.join(struct.pack('>Q', (1 << 63) | off_l2 + 512 = * j) - for j in xrange(0, h.l1_size)) + for j in range(0, h.l1_size)) fd.write(table) =20 # Write the L2 tables @@ -79,14 +83,14 @@ class TestRefcountTableGrowth(iotests.QMPTestCase): off =3D off_data while remaining > 1024 * 512: pytable =3D list((1 << 63) | off + 512 * j - for j in xrange(0, 1024)) + for j in range(0, 1024)) table =3D struct.pack('>1024Q', *pytable) fd.write(table) remaining =3D remaining - 1024 * 512 off =3D off + 1024 * 512 =20 table =3D b''.join(struct.pack('>Q', (1 << 63) | off + 512 * j) - for j in xrange(0, remaining // 512)) + for j in range(0, remaining // 512)) fd.write(table) =20 =20 diff --git a/tests/qemu-iotests/056 b/tests/qemu-iotests/056 index 223292175a..3df323984d 100755 --- a/tests/qemu-iotests/056 +++ b/tests/qemu-iotests/056 @@ -32,7 +32,7 @@ target_img =3D os.path.join(iotests.test_dir, 'target.img= ') def img_create(img, fmt=3Diotests.imgfmt, size=3D'64M', **kwargs): fullname =3D os.path.join(iotests.test_dir, '%s.%s' % (img, fmt)) optargs =3D [] - for k,v in kwargs.iteritems(): + for k,v in kwargs.items(): optargs =3D optargs + ['-o', '%s=3D%s' % (k,v)] args =3D ['create', '-f', fmt] + optargs + [fullname, size] iotests.qemu_img(*args) diff --git a/tests/qemu-iotests/065 b/tests/qemu-iotests/065 index 72aa9707c7..8bac383ea7 100755 --- a/tests/qemu-iotests/065 +++ b/tests/qemu-iotests/065 @@ -59,7 +59,7 @@ class TestQemuImgInfo(TestImageInfoSpecific): :data.index('')] for field in data: self.assertTrue(re.match('^ {4}[^ ]', field) is not None) - data =3D map(lambda line: line.strip(), data) + data =3D [line.strip() for line in data] self.assertEqual(data, self.human_compare) =20 class TestQMP(TestImageInfoSpecific): @@ -80,7 +80,7 @@ class TestQMP(TestImageInfoSpecific): =20 def test_qmp(self): result =3D self.vm.qmp('query-block')['return'] - drive =3D filter(lambda drive: drive['device'] =3D=3D 'drive0', re= sult)[0] + drive =3D next(drive for drive in result if drive['device'] =3D=3D= 'drive0') data =3D drive['inserted']['image']['format-specific'] self.assertEqual(data['type'], iotests.imgfmt) self.assertEqual(data['data'], self.compare) diff --git a/tests/qemu-iotests/124 b/tests/qemu-iotests/124 index 3ea4ac53f5..9f189e3b54 100755 --- a/tests/qemu-iotests/124 +++ b/tests/qemu-iotests/124 @@ -39,7 +39,7 @@ def try_remove(img): def transaction_action(action, **kwargs): return { 'type': action, - 'data': dict((k.replace('_', '-'), v) for k, v in kwargs.iteritems= ()) + 'data': dict((k.replace('_', '-'), v) for k, v in kwargs.items()) } =20 =20 @@ -134,7 +134,7 @@ class TestIncrementalBackupBase(iotests.QMPTestCase): def img_create(self, img, fmt=3Diotests.imgfmt, size=3D'64M', parent=3DNone, parentFormat=3DNone, **kwargs): optargs =3D [] - for k,v in kwargs.iteritems(): + for k,v in kwargs.items(): optargs =3D optargs + ['-o', '%s=3D%s' % (k,v)] args =3D ['create', '-f', fmt] + optargs + [img, size] if parent: diff --git a/tests/qemu-iotests/139 b/tests/qemu-iotests/139 index cc7fe337f3..62402c1c35 100755 --- a/tests/qemu-iotests/139 +++ b/tests/qemu-iotests/139 @@ -51,7 +51,7 @@ class TestBlockdevDel(iotests.QMPTestCase): # Check whether a BlockDriverState exists def checkBlockDriverState(self, node, must_exist =3D True): result =3D self.vm.qmp('query-named-block-nodes') - nodes =3D filter(lambda x: x['node-name'] =3D=3D node, result['ret= urn']) + nodes =3D [x for x in result['return'] if x['node-name'] =3D=3D no= de] self.assertLessEqual(len(nodes), 1) self.assertEqual(must_exist, len(nodes) =3D=3D 1) =20 diff --git a/tests/qemu-iotests/163 b/tests/qemu-iotests/163 index 5fd424761b..158ba5d092 100755 --- a/tests/qemu-iotests/163 +++ b/tests/qemu-iotests/163 @@ -18,9 +18,12 @@ # along with this program. If not, see . # =20 -import os, random, iotests, struct, qcow2 +import os, random, iotests, struct, qcow2, sys from iotests import qemu_img, qemu_io, image_size =20 +if sys.version_info.major =3D=3D 2: + range =3D xrange + test_img =3D os.path.join(iotests.test_dir, 'test.img') check_img =3D os.path.join(iotests.test_dir, 'check.img') =20 @@ -41,7 +44,7 @@ class ShrinkBaseClass(iotests.QMPTestCase): div_roundup =3D lambda n, d: (n + d - 1) // d =20 def split_by_n(data, n): - for x in xrange(0, len(data), n): + for x in range(0, len(data), n): yield struct.unpack('>Q', data[x:x + n])[0] & l1_mask =20 def check_l1_table(h, l1_data): @@ -135,8 +138,8 @@ class ShrinkBaseClass(iotests.QMPTestCase): self.image_verify() =20 def test_random_write(self): - offs_list =3D range(0, size_to_int(self.image_len), - size_to_int(self.chunk_size)) + offs_list =3D list(range(0, size_to_int(self.image_len), + size_to_int(self.chunk_size))) random.shuffle(offs_list) for offs in offs_list: qemu_io('-c', 'write -P 0xff %d %s' % (offs, self.chunk_size), --=20 2.17.1 From nobody Mon Apr 29 10:49:08 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1539976898144397.83907848120907; Fri, 19 Oct 2018 12:21:38 -0700 (PDT) Received: from localhost ([::1]:52325 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gDaL2-0008G5-Rr for importer@patchew.org; Fri, 19 Oct 2018 15:21:36 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59760) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gDaFc-0003vz-OO for qemu-devel@nongnu.org; Fri, 19 Oct 2018 15:16:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gDaFb-0005Li-B8 for qemu-devel@nongnu.org; Fri, 19 Oct 2018 15:16:00 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56144) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gDaFU-00058P-NY; Fri, 19 Oct 2018 15:15:53 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7D9C630014CA; Fri, 19 Oct 2018 19:15:40 +0000 (UTC) Received: from localhost (unknown [10.40.205.230]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 032686A500; Fri, 19 Oct 2018 19:15:39 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Date: Fri, 19 Oct 2018 21:15:20 +0200 Message-Id: <20181019191523.12157-7-mreitz@redhat.com> In-Reply-To: <20181019191523.12157-1-mreitz@redhat.com> References: <20181019191523.12157-1-mreitz@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Fri, 19 Oct 2018 19:15:40 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v2 6/9] iotests: Explicitly inherit FDs in Python X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Cleber Rosa , qemu-devel@nongnu.org, Eduardo Habkost , Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RDMRC_1 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Python 3.4 introduced the inheritable attribute for FDs. At the same time, it changed the default so that all FDs are not inheritable by default, that only inheritable FDs are inherited to subprocesses, and only if close_fds is explicitly set to False. Adhere to this by setting close_fds to False when working with subprocesses that may want to inherit FDs, and by trying to set_inheritable() on FDs that we do want to bequeath to them. Signed-off-by: Max Reitz Reviewed-by: Cleber Rosa Reviewed-by: Eduardo Habkost Tested-by: Cleber Rosa --- scripts/qemu.py | 34 +++++++++++++++++++++++++++++----- tests/qemu-iotests/045 | 2 +- tests/qemu-iotests/147 | 2 +- 3 files changed, 31 insertions(+), 7 deletions(-) diff --git a/scripts/qemu.py b/scripts/qemu.py index f099ce7278..fb29b73c30 100644 --- a/scripts/qemu.py +++ b/scripts/qemu.py @@ -142,11 +142,19 @@ class QEMUMachine(object): if opts: options.append(opts) =20 + # This did not exist before 3.4, but since then it is + # mandatory for our purpose + if hasattr(os, 'set_inheritable'): + os.set_inheritable(fd, True) + self._args.append('-add-fd') self._args.append(','.join(options)) return self =20 - def send_fd_scm(self, fd_file_path): + # Exactly one of fd and file_path must be given. + # (If it is file_path, the helper will open that file and pass its + # own fd) + def send_fd_scm(self, fd=3DNone, file_path=3DNone): # In iotest.py, the qmp should always use unix socket. assert self._qmp.is_scm_available() if self._socket_scm_helper is None: @@ -154,12 +162,27 @@ class QEMUMachine(object): if not os.path.exists(self._socket_scm_helper): raise QEMUMachineError("%s does not exist" % self._socket_scm_helper) + + # This did not exist before 3.4, but since then it is + # mandatory for our purpose + if hasattr(os, 'set_inheritable'): + os.set_inheritable(self._qmp.get_sock_fd(), True) + if fd is not None: + os.set_inheritable(fd, True) + fd_param =3D ["%s" % self._socket_scm_helper, - "%d" % self._qmp.get_sock_fd(), - "%s" % fd_file_path] + "%d" % self._qmp.get_sock_fd()] + + if file_path is not None: + assert fd is None + fd_param.append(file_path) + else: + assert fd is not None + fd_param.append(str(fd)) + devnull =3D open(os.path.devnull, 'rb') proc =3D subprocess.Popen(fd_param, stdin=3Ddevnull, stdout=3Dsubp= rocess.PIPE, - stderr=3Dsubprocess.STDOUT) + stderr=3Dsubprocess.STDOUT, close_fds=3DFa= lse) output =3D proc.communicate()[0] if output: LOG.debug(output) @@ -280,7 +303,8 @@ class QEMUMachine(object): stdin=3Ddevnull, stdout=3Dself._qemu_log_file, stderr=3Dsubprocess.STDOUT, - shell=3DFalse) + shell=3DFalse, + close_fds=3DFalse) self._post_launch() =20 def wait(self): diff --git a/tests/qemu-iotests/045 b/tests/qemu-iotests/045 index 6be8fc4912..55a5d31ca8 100755 --- a/tests/qemu-iotests/045 +++ b/tests/qemu-iotests/045 @@ -140,7 +140,7 @@ class TestSCMFd(iotests.QMPTestCase): os.remove(image0) =20 def _send_fd_by_SCM(self): - ret =3D self.vm.send_fd_scm(image0) + ret =3D self.vm.send_fd_scm(file_path=3Dimage0) self.assertEqual(ret, 0, 'Failed to send fd with UNIX SCM') =20 def test_add_fd(self): diff --git a/tests/qemu-iotests/147 b/tests/qemu-iotests/147 index d2081df84b..05b374b7d3 100755 --- a/tests/qemu-iotests/147 +++ b/tests/qemu-iotests/147 @@ -229,7 +229,7 @@ class BuiltinNBD(NBDBlockdevAddBase): sockfd =3D socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) sockfd.connect(unix_socket) =20 - result =3D self.vm.send_fd_scm(str(sockfd.fileno())) + result =3D self.vm.send_fd_scm(fd=3Dsockfd.fileno()) self.assertEqual(result, 0, 'Failed to send socket FD') =20 result =3D self.vm.qmp('getfd', fdname=3D'nbd-fifo') --=20 2.17.1 From nobody Mon Apr 29 10:49:08 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 153997670163581.4166084876938; Fri, 19 Oct 2018 12:18:21 -0700 (PDT) Received: from localhost ([::1]:52308 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gDaHo-0005AM-A1 for importer@patchew.org; Fri, 19 Oct 2018 15:18:16 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59715) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gDaFb-0003uP-9K for qemu-devel@nongnu.org; Fri, 19 Oct 2018 15:16:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gDaFX-0005Hz-5e for qemu-devel@nongnu.org; Fri, 19 Oct 2018 15:15:59 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36093) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gDaFU-000597-BK; Fri, 19 Oct 2018 15:15:52 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D03522D1ED7; Fri, 19 Oct 2018 19:15:42 +0000 (UTC) Received: from localhost (unknown [10.40.205.230]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 611081057063; Fri, 19 Oct 2018 19:15:42 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Date: Fri, 19 Oct 2018 21:15:21 +0200 Message-Id: <20181019191523.12157-8-mreitz@redhat.com> In-Reply-To: <20181019191523.12157-1-mreitz@redhat.com> References: <20181019191523.12157-1-mreitz@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Fri, 19 Oct 2018 19:15:42 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v2 7/9] iotests: 'new' module replacement in 169 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Cleber Rosa , qemu-devel@nongnu.org, Eduardo Habkost , Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RDMRC_1 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" iotest 169 uses the 'new' module to add methods to a class. This module no longer exists in Python 3. Instead, we can use a lambda. Best of all, this works in 2.7 just as well. Signed-off-by: Max Reitz Reviewed-by: Eduardo Habkost Reviewed-by: Cleber Rosa Tested-by: Cleber Rosa --- tests/qemu-iotests/169 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/qemu-iotests/169 b/tests/qemu-iotests/169 index f243db9955..e5614b159d 100755 --- a/tests/qemu-iotests/169 +++ b/tests/qemu-iotests/169 @@ -23,7 +23,6 @@ import iotests import time import itertools import operator -import new from iotests import qemu_img =20 =20 @@ -144,7 +143,7 @@ class TestDirtyBitmapMigration(iotests.QMPTestCase): =20 def inject_test_case(klass, name, method, *args, **kwargs): mc =3D operator.methodcaller(method, *args, **kwargs) - setattr(klass, 'test_' + name, new.instancemethod(mc, None, klass)) + setattr(klass, 'test_' + name, lambda self: mc(self)) =20 for cmb in list(itertools.product((True, False), repeat=3D4)): name =3D ('_' if cmb[0] else '_not_') + 'persistent_' --=20 2.17.1 From nobody Mon Apr 29 10:49:08 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 153997703538981.04960116454129; Fri, 19 Oct 2018 12:23:55 -0700 (PDT) Received: from localhost ([::1]:52339 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gDaNC-0002Gv-AV for importer@patchew.org; Fri, 19 Oct 2018 15:23:50 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59762) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gDaFc-0003w0-PD for qemu-devel@nongnu.org; Fri, 19 Oct 2018 15:16:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gDaFb-0005Lr-Bg for qemu-devel@nongnu.org; Fri, 19 Oct 2018 15:16:00 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36462) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gDaFU-0005B0-Eq; Fri, 19 Oct 2018 15:15:52 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 38F9743A21; Fri, 19 Oct 2018 19:15:45 +0000 (UTC) Received: from localhost (unknown [10.40.205.230]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B59175D77E; Fri, 19 Oct 2018 19:15:44 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Date: Fri, 19 Oct 2018 21:15:22 +0200 Message-Id: <20181019191523.12157-9-mreitz@redhat.com> In-Reply-To: <20181019191523.12157-1-mreitz@redhat.com> References: <20181019191523.12157-1-mreitz@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Fri, 19 Oct 2018 19:15:45 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v2 8/9] iotests: Modify imports for Python 3 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Cleber Rosa , qemu-devel@nongnu.org, Eduardo Habkost , Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RDMRC_1 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" There are two imports that need to be modified when running the iotests under Python 3: One is StringIO, which no longer exists; instead, the StringIO class comes from the io module, so import it from there (and use the BytesIO class for Python 2). The other is the ConfigParser, which has just been renamed to configparser. Signed-off-by: Max Reitz Reviewed-by: Cleber Rosa Reviewed-by: Eduardo Habkost Tested-by: Cleber Rosa --- tests/qemu-iotests/iotests.py | 13 +++++++++---- tests/qemu-iotests/nbd-fault-injector.py | 7 +++++-- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index 7ca94e9278..ed91095505 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -29,6 +29,7 @@ import json import signal import logging import atexit +import io =20 sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..', 'scrip= ts')) import qtest @@ -681,15 +682,19 @@ def main(supported_fmts=3D[], supported_oses=3D['linu= x'], supported_cache_modes=3D[], verify_platform(supported_oses) verify_cache_mode(supported_cache_modes) =20 - # We need to filter out the time taken from the output so that qemu-io= test - # can reliably diff the results against master output. - import StringIO if debug: output =3D sys.stdout verbosity =3D 2 sys.argv.remove('-d') else: - output =3D StringIO.StringIO() + # We need to filter out the time taken from the output so that + # qemu-iotest can reliably diff the results against master output. + if sys.version_info.major >=3D 3: + output =3D io.StringIO() + else: + # StringIO() is for unicode strings, which is not what + # 2.x's test runner emits. + output =3D io.BytesIO() =20 logging.basicConfig(level=3D(logging.DEBUG if debug else logging.WARN)) =20 diff --git a/tests/qemu-iotests/nbd-fault-injector.py b/tests/qemu-iotests/= nbd-fault-injector.py index d45e2e0a6a..6b2d659dee 100755 --- a/tests/qemu-iotests/nbd-fault-injector.py +++ b/tests/qemu-iotests/nbd-fault-injector.py @@ -48,7 +48,10 @@ import sys import socket import struct import collections -import ConfigParser +if sys.version_info.major >=3D 3: + import configparser +else: + import ConfigParser as configparser =20 FAKE_DISK_SIZE =3D 8 * 1024 * 1024 * 1024 # 8 GB =20 @@ -225,7 +228,7 @@ def parse_config(config): return rules =20 def load_rules(filename): - config =3D ConfigParser.RawConfigParser() + config =3D configparser.RawConfigParser() with open(filename, 'rt') as f: config.readfp(f, filename) return parse_config(config) --=20 2.17.1 From nobody Mon Apr 29 10:49:08 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1539976817924493.5811906947803; Fri, 19 Oct 2018 12:20:17 -0700 (PDT) Received: from localhost ([::1]:52316 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gDaJk-00076n-8C for importer@patchew.org; Fri, 19 Oct 2018 15:20:16 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59910) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gDaG7-0004L9-Sr for qemu-devel@nongnu.org; Fri, 19 Oct 2018 15:16:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gDaFr-0005Z4-Kl for qemu-devel@nongnu.org; Fri, 19 Oct 2018 15:16:28 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39950) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gDaFU-0005CV-Ld; Fri, 19 Oct 2018 15:15:53 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 62590308212A; Fri, 19 Oct 2018 19:15:48 +0000 (UTC) Received: from localhost (unknown [10.40.205.230]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 214D6610C9; Fri, 19 Oct 2018 19:15:46 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Date: Fri, 19 Oct 2018 21:15:23 +0200 Message-Id: <20181019191523.12157-10-mreitz@redhat.com> In-Reply-To: <20181019191523.12157-1-mreitz@redhat.com> References: <20181019191523.12157-1-mreitz@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Fri, 19 Oct 2018 19:15:48 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v2 9/9] iotests: Unify log outputs between Python 2 and 3 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Cleber Rosa , qemu-devel@nongnu.org, Eduardo Habkost , Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RDMRC_1 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" When dumping an object into the log, there are differences between Python 2 and 3. First, unicode strings are prefixed by 'u' in Python 2 (they are no longer in 3, because unicode strings are the default there). Second, the order of keys in dicts may differ. Third, especially long numbers are longs in Python 2 and thus get an 'L' suffix, which does not happen in Python 3. We can get around all of these differences by dumping objects (lists and dicts) in a language-independent format, namely JSON. The JSON generator even allows emitting dicts with their keys sorted alphabetically. This changes the output of all tests that use these logging functions (dict keys are ordered now, strings in dicts are now enclosed in double quotes instead of single quotes, the 'L' suffix of large integers is dropped, and "true" and "false" are now in lower case). The quote change necessitates a small change to a filter used in test 207. Suggested-by: Eduardo Habkost Signed-off-by: Max Reitz Reviewed-by: Cleber Rosa Tested-by: Cleber Rosa --- tests/qemu-iotests/194.out | 22 +- tests/qemu-iotests/202.out | 12 +- tests/qemu-iotests/203.out | 14 +- tests/qemu-iotests/206.out | 218 +++++++------- tests/qemu-iotests/207 | 2 +- tests/qemu-iotests/207.out | 72 ++--- tests/qemu-iotests/208.out | 8 +- tests/qemu-iotests/210.out | 94 +++--- tests/qemu-iotests/211.out | 102 +++---- tests/qemu-iotests/212.out | 174 +++++------ tests/qemu-iotests/213.out | 182 ++++++------ tests/qemu-iotests/216.out | 4 +- tests/qemu-iotests/218.out | 20 +- tests/qemu-iotests/219.out | 526 +++++++++++++++++----------------- tests/qemu-iotests/222.out | 24 +- tests/qemu-iotests/iotests.py | 10 +- 16 files changed, 744 insertions(+), 740 deletions(-) diff --git a/tests/qemu-iotests/194.out b/tests/qemu-iotests/194.out index 50ac50da5e..71857853fb 100644 --- a/tests/qemu-iotests/194.out +++ b/tests/qemu-iotests/194.out @@ -1,18 +1,18 @@ Launching VMs... Launching NBD server on destination... -{u'return': {}} -{u'return': {}} +{"return": {}} +{"return": {}} Starting `drive-mirror` on source... -{u'return': {}} +{"return": {}} Waiting for `drive-mirror` to complete... -{u'timestamp': {u'seconds': 'SECS', u'microseconds': 'USECS'}, u'data': {u= 'device': u'mirror-job0', u'type': u'mirror', u'speed': 0, u'len': 10737418= 24, u'offset': 1073741824}, u'event': u'BLOCK_JOB_READY'} +{"data": {"device": "mirror-job0", "len": 1073741824, "offset": 1073741824= , "speed": 0, "type": "mirror"}, "event": "BLOCK_JOB_READY", "timestamp": {= "microseconds": "USECS", "seconds": "SECS"}} Starting migration... -{u'return': {}} -{u'timestamp': {u'seconds': 'SECS', u'microseconds': 'USECS'}, u'data': {u= 'status': u'setup'}, u'event': u'MIGRATION'} -{u'timestamp': {u'seconds': 'SECS', u'microseconds': 'USECS'}, u'data': {u= 'status': u'active'}, u'event': u'MIGRATION'} -{u'timestamp': {u'seconds': 'SECS', u'microseconds': 'USECS'}, u'data': {u= 'status': u'completed'}, u'event': u'MIGRATION'} +{"return": {}} +{"data": {"status": "setup"}, "event": "MIGRATION", "timestamp": {"microse= conds": "USECS", "seconds": "SECS"}} +{"data": {"status": "active"}, "event": "MIGRATION", "timestamp": {"micros= econds": "USECS", "seconds": "SECS"}} +{"data": {"status": "completed"}, "event": "MIGRATION", "timestamp": {"mic= roseconds": "USECS", "seconds": "SECS"}} Gracefully ending the `drive-mirror` job on source... -{u'return': {}} -{u'timestamp': {u'seconds': 'SECS', u'microseconds': 'USECS'}, u'data': {u= 'device': u'mirror-job0', u'type': u'mirror', u'speed': 0, u'len': 10737418= 24, u'offset': 1073741824}, u'event': u'BLOCK_JOB_COMPLETED'} +{"return": {}} +{"data": {"device": "mirror-job0", "len": 1073741824, "offset": 1073741824= , "speed": 0, "type": "mirror"}, "event": "BLOCK_JOB_COMPLETED", "timestamp= ": {"microseconds": "USECS", "seconds": "SECS"}} Stopping the NBD server on destination... -{u'return': {}} +{"return": {}} diff --git a/tests/qemu-iotests/202.out b/tests/qemu-iotests/202.out index d5ea374e17..9a8619e796 100644 --- a/tests/qemu-iotests/202.out +++ b/tests/qemu-iotests/202.out @@ -1,11 +1,11 @@ Launching VM... Adding IOThread... -{u'return': {}} +{"return": {}} Adding blockdevs... -{u'return': {}} -{u'return': {}} +{"return": {}} +{"return": {}} Setting iothread... -{u'return': {}} -{u'return': {}} +{"return": {}} +{"return": {}} Creating external snapshots... -{u'return': {}} +{"return": {}} diff --git a/tests/qemu-iotests/203.out b/tests/qemu-iotests/203.out index 1a11f0975c..9d4abba8c5 100644 --- a/tests/qemu-iotests/203.out +++ b/tests/qemu-iotests/203.out @@ -1,11 +1,11 @@ Launching VM... Setting IOThreads... -{u'return': {}} -{u'return': {}} +{"return": {}} +{"return": {}} Enabling migration QMP events... -{u'return': {}} +{"return": {}} Starting migration... -{u'return': {}} -{u'timestamp': {u'seconds': 'SECS', u'microseconds': 'USECS'}, u'data': {u= 'status': u'setup'}, u'event': u'MIGRATION'} -{u'timestamp': {u'seconds': 'SECS', u'microseconds': 'USECS'}, u'data': {u= 'status': u'active'}, u'event': u'MIGRATION'} -{u'timestamp': {u'seconds': 'SECS', u'microseconds': 'USECS'}, u'data': {u= 'status': u'completed'}, u'event': u'MIGRATION'} +{"return": {}} +{"data": {"status": "setup"}, "event": "MIGRATION", "timestamp": {"microse= conds": "USECS", "seconds": "SECS"}} +{"data": {"status": "active"}, "event": "MIGRATION", "timestamp": {"micros= econds": "USECS", "seconds": "SECS"}} +{"data": {"status": "completed"}, "event": "MIGRATION", "timestamp": {"mic= roseconds": "USECS", "seconds": "SECS"}} diff --git a/tests/qemu-iotests/206.out b/tests/qemu-iotests/206.out index 789eebe57b..91f4db55d3 100644 --- a/tests/qemu-iotests/206.out +++ b/tests/qemu-iotests/206.out @@ -1,16 +1,16 @@ =3D=3D=3D Successful image creation (defaults) =3D=3D=3D =20 -{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': = {'size': 0, 'driver': 'file', 'filename': 'TEST_DIR/PID-t.qcow2'}}} -{u'return': {}} -{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}} -{u'return': {}} - -{'execute': 'blockdev-add', 'arguments': {'node_name': 'imgfile', 'driver'= : 'file', 'filename': 'TEST_DIR/PID-t.qcow2'}} -{u'return': {}} -{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': = {'driver': 'qcow2', 'file': 'imgfile', 'size': 134217728}}} -{u'return': {}} -{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}} -{u'return': {}} +{"execute": "blockdev-create", "arguments": {"job_id": "job0", "options": = {"driver": "file", "filename": "TEST_DIR/PID-t.qcow2", "size": 0}}} +{"return": {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} + +{"execute": "blockdev-add", "arguments": {"driver": "file", "filename": "T= EST_DIR/PID-t.qcow2", "node_name": "imgfile"}} +{"return": {}} +{"execute": "blockdev-create", "arguments": {"job_id": "job0", "options": = {"driver": "qcow2", "file": "imgfile", "size": 134217728}}} +{"return": {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} =20 image: TEST_IMG file format: IMGFMT @@ -24,15 +24,15 @@ Format specific information: =20 =3D=3D=3D Successful image creation (inline blockdev-add, explicit default= s) =3D=3D=3D =20 -{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': = {'nocow': False, 'preallocation': 'off', 'size': 0, 'driver': 'file', 'file= name': 'TEST_DIR/PID-t.qcow2'}}} -{u'return': {}} -{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}} -{u'return': {}} +{"execute": "blockdev-create", "arguments": {"job_id": "job0", "options": = {"driver": "file", "filename": "TEST_DIR/PID-t.qcow2", "nocow": false, "pre= allocation": "off", "size": 0}}} +{"return": {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} =20 -{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': = {'cluster-size': 65536, 'refcount-bits': 16, 'version': 'v3', 'preallocatio= n': 'off', 'file': {'driver': 'file', 'filename': 'TEST_DIR/PID-t.qcow2'}, = 'lazy-refcounts': False, 'driver': 'qcow2', 'size': 67108864}}} -{u'return': {}} -{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}} -{u'return': {}} +{"execute": "blockdev-create", "arguments": {"job_id": "job0", "options": = {"cluster-size": 65536, "driver": "qcow2", "file": {"driver": "file", "file= name": "TEST_DIR/PID-t.qcow2"}, "lazy-refcounts": false, "preallocation": "= off", "refcount-bits": 16, "size": 67108864, "version": "v3"}}} +{"return": {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} =20 image: TEST_IMG file format: IMGFMT @@ -46,15 +46,15 @@ Format specific information: =20 =3D=3D=3D Successful image creation (v3 non-default options) =3D=3D=3D =20 -{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': = {'nocow': True, 'preallocation': 'falloc', 'size': 0, 'driver': 'file', 'fi= lename': 'TEST_DIR/PID-t.qcow2'}}} -{u'return': {}} -{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}} -{u'return': {}} +{"execute": "blockdev-create", "arguments": {"job_id": "job0", "options": = {"driver": "file", "filename": "TEST_DIR/PID-t.qcow2", "nocow": true, "prea= llocation": "falloc", "size": 0}}} +{"return": {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} =20 -{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': = {'cluster-size': 2097152, 'refcount-bits': 1, 'version': 'v3', 'preallocati= on': 'metadata', 'file': {'driver': 'file', 'filename': 'TEST_DIR/PID-t.qco= w2'}, 'lazy-refcounts': True, 'driver': 'qcow2', 'size': 33554432}}} -{u'return': {}} -{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}} -{u'return': {}} +{"execute": "blockdev-create", "arguments": {"job_id": "job0", "options": = {"cluster-size": 2097152, "driver": "qcow2", "file": {"driver": "file", "fi= lename": "TEST_DIR/PID-t.qcow2"}, "lazy-refcounts": true, "preallocation": = "metadata", "refcount-bits": 1, "size": 33554432, "version": "v3"}}} +{"return": {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} =20 image: TEST_IMG file format: IMGFMT @@ -68,15 +68,15 @@ Format specific information: =20 =3D=3D=3D Successful image creation (v2 non-default options) =3D=3D=3D =20 -{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': = {'size': 0, 'driver': 'file', 'filename': 'TEST_DIR/PID-t.qcow2'}}} -{u'return': {}} -{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}} -{u'return': {}} +{"execute": "blockdev-create", "arguments": {"job_id": "job0", "options": = {"driver": "file", "filename": "TEST_DIR/PID-t.qcow2", "size": 0}}} +{"return": {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} =20 -{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': = {'cluster-size': 512, 'backing-fmt': 'qcow2', 'driver': 'qcow2', 'version':= 'v2', 'file': {'driver': 'file', 'filename': 'TEST_DIR/PID-t.qcow2'}, 'bac= king-file': 'TEST_DIR/PID-t.qcow2.base', 'size': 33554432}}} -{u'return': {}} -{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}} -{u'return': {}} +{"execute": "blockdev-create", "arguments": {"job_id": "job0", "options": = {"backing-file": "TEST_DIR/PID-t.qcow2.base", "backing-fmt": "qcow2", "clus= ter-size": 512, "driver": "qcow2", "file": {"driver": "file", "filename": "= TEST_DIR/PID-t.qcow2"}, "size": 33554432, "version": "v2"}}} +{"return": {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} =20 image: TEST_IMG file format: IMGFMT @@ -90,10 +90,10 @@ Format specific information: =20 =3D=3D=3D Successful image creation (encrypted) =3D=3D=3D =20 -{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': = {'encrypt': {'key-secret': 'keysec0', 'iter-time': 10, 'cipher-mode': 'ctr'= , 'ivgen-hash-alg': 'md5', 'cipher-alg': 'twofish-128', 'format': 'luks', '= ivgen-alg': 'plain64', 'hash-alg': 'sha1'}, 'driver': 'qcow2', 'file': {'dr= iver': 'file', 'filename': 'TEST_DIR/PID-t.qcow2'}, 'size': 33554432}}} -{u'return': {}} -{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}} -{u'return': {}} +{"execute": "blockdev-create", "arguments": {"job_id": "job0", "options": = {"driver": "qcow2", "encrypt": {"cipher-alg": "twofish-128", "cipher-mode":= "ctr", "format": "luks", "hash-alg": "sha1", "iter-time": 10, "ivgen-alg":= "plain64", "ivgen-hash-alg": "md5", "key-secret": "keysec0"}, "file": {"dr= iver": "file", "filename": "TEST_DIR/PID-t.qcow2"}, "size": 33554432}}} +{"return": {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} =20 image: TEST_IMG file format: IMGFMT @@ -144,113 +144,113 @@ Format specific information: =20 =3D=3D=3D Invalid BlockdevRef =3D=3D=3D =20 -{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': = {'driver': 'qcow2', 'file': "this doesn't exist", 'size': 33554432}}} -{u'return': {}} +{"execute": "blockdev-create", "arguments": {"job_id": "job0", "options": = {"driver": "qcow2", "file": "this doesn't exist", "size": 33554432}}} +{"return": {}} Job failed: Cannot find device=3Dthis doesn't exist nor node_name=3Dthis d= oesn't exist -{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}} -{u'return': {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} =20 =3D=3D=3D Invalid sizes =3D=3D=3D -{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': = {'driver': 'qcow2', 'file': 'node0', 'size': 1234}}} -{u'return': {}} +{"execute": "blockdev-create", "arguments": {"job_id": "job0", "options": = {"driver": "qcow2", "file": "node0", "size": 1234}}} +{"return": {}} Job failed: Image size must be a multiple of 512 bytes -{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}} -{u'return': {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} =20 -{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': = {'driver': 'qcow2', 'file': 'node0', 'size': 18446744073709551104L}}} -{u'return': {}} +{"execute": "blockdev-create", "arguments": {"job_id": "job0", "options": = {"driver": "qcow2", "file": "node0", "size": 18446744073709551104}}} +{"return": {}} Job failed: Could not resize image: Image size cannot be negative -{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}} -{u'return': {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} =20 -{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': = {'driver': 'qcow2', 'file': 'node0', 'size': 9223372036854775808L}}} -{u'return': {}} +{"execute": "blockdev-create", "arguments": {"job_id": "job0", "options": = {"driver": "qcow2", "file": "node0", "size": 9223372036854775808}}} +{"return": {}} Job failed: Could not resize image: Image size cannot be negative -{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}} -{u'return': {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} =20 -{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': = {'driver': 'qcow2', 'file': 'node0', 'size': 9223372036854775296}}} -{u'return': {}} +{"execute": "blockdev-create", "arguments": {"job_id": "job0", "options": = {"driver": "qcow2", "file": "node0", "size": 9223372036854775296}}} +{"return": {}} Job failed: Could not resize image: Failed to grow the L1 table: File too = large -{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}} -{u'return': {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} =20 =3D=3D=3D Invalid version =3D=3D=3D -{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': = {'version': 'v1', 'driver': 'qcow2', 'file': 'node0', 'size': 67108864}}} -{u'error': {u'class': u'GenericError', u'desc': u"Invalid parameter 'v1'"}} +{"execute": "blockdev-create", "arguments": {"job_id": "job0", "options": = {"driver": "qcow2", "file": "node0", "size": 67108864, "version": "v1"}}} +{"error": {"class": "GenericError", "desc": "Invalid parameter 'v1'"}} =20 -{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': = {'lazy-refcounts': True, 'version': 'v2', 'driver': 'qcow2', 'file': 'node0= ', 'size': 67108864}}} -{u'return': {}} +{"execute": "blockdev-create", "arguments": {"job_id": "job0", "options": = {"driver": "qcow2", "file": "node0", "lazy-refcounts": true, "size": 671088= 64, "version": "v2"}}} +{"return": {}} Job failed: Lazy refcounts only supported with compatibility level 1.1 and= above (use version=3Dv3 or greater) -{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}} -{u'return': {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} =20 -{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': = {'refcount-bits': 8, 'version': 'v2', 'driver': 'qcow2', 'file': 'node0', '= size': 67108864}}} -{u'return': {}} +{"execute": "blockdev-create", "arguments": {"job_id": "job0", "options": = {"driver": "qcow2", "file": "node0", "refcount-bits": 8, "size": 67108864, = "version": "v2"}}} +{"return": {}} Job failed: Different refcount widths than 16 bits require compatibility l= evel 1.1 or above (use version=3Dv3 or greater) -{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}} -{u'return': {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} =20 =3D=3D=3D Invalid backing file options =3D=3D=3D -{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': = {'preallocation': 'full', 'driver': 'qcow2', 'backing-file': '/dev/null', '= file': 'node0', 'size': 67108864}}} -{u'return': {}} +{"execute": "blockdev-create", "arguments": {"job_id": "job0", "options": = {"backing-file": "/dev/null", "driver": "qcow2", "file": "node0", "prealloc= ation": "full", "size": 67108864}}} +{"return": {}} Job failed: Backing file and preallocation cannot be used at the same time -{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}} -{u'return': {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} =20 -{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': = {'backing-fmt': 'qcow2', 'driver': 'qcow2', 'file': 'node0', 'size': 671088= 64}}} -{u'return': {}} +{"execute": "blockdev-create", "arguments": {"job_id": "job0", "options": = {"backing-fmt": "qcow2", "driver": "qcow2", "file": "node0", "size": 671088= 64}}} +{"return": {}} Job failed: Backing format cannot be used without backing file -{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}} -{u'return': {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} =20 =3D=3D=3D Invalid cluster size =3D=3D=3D -{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': = {'cluster-size': 1234, 'driver': 'qcow2', 'file': 'node0', 'size': 67108864= }}} -{u'return': {}} +{"execute": "blockdev-create", "arguments": {"job_id": "job0", "options": = {"cluster-size": 1234, "driver": "qcow2", "file": "node0", "size": 67108864= }}} +{"return": {}} Job failed: Cluster size must be a power of two between 512 and 2048k -{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}} -{u'return': {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} =20 -{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': = {'cluster-size': 128, 'driver': 'qcow2', 'file': 'node0', 'size': 67108864}= }} -{u'return': {}} +{"execute": "blockdev-create", "arguments": {"job_id": "job0", "options": = {"cluster-size": 128, "driver": "qcow2", "file": "node0", "size": 67108864}= }} +{"return": {}} Job failed: Cluster size must be a power of two between 512 and 2048k -{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}} -{u'return': {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} =20 -{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': = {'cluster-size': 4194304, 'driver': 'qcow2', 'file': 'node0', 'size': 67108= 864}}} -{u'return': {}} +{"execute": "blockdev-create", "arguments": {"job_id": "job0", "options": = {"cluster-size": 4194304, "driver": "qcow2", "file": "node0", "size": 67108= 864}}} +{"return": {}} Job failed: Cluster size must be a power of two between 512 and 2048k -{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}} -{u'return': {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} =20 -{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': = {'cluster-size': 0, 'driver': 'qcow2', 'file': 'node0', 'size': 67108864}}} -{u'return': {}} +{"execute": "blockdev-create", "arguments": {"job_id": "job0", "options": = {"cluster-size": 0, "driver": "qcow2", "file": "node0", "size": 67108864}}} +{"return": {}} Job failed: Cluster size must be a power of two between 512 and 2048k -{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}} -{u'return': {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} =20 -{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': = {'cluster-size': 512, 'driver': 'qcow2', 'file': 'node0', 'size': 281474976= 710656}}} -{u'return': {}} +{"execute": "blockdev-create", "arguments": {"job_id": "job0", "options": = {"cluster-size": 512, "driver": "qcow2", "file": "node0", "size": 281474976= 710656}}} +{"return": {}} Job failed: Could not resize image: Failed to grow the L1 table: File too = large -{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}} -{u'return': {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} =20 =3D=3D=3D Invalid refcount width =3D=3D=3D -{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': = {'refcount-bits': 128, 'driver': 'qcow2', 'file': 'node0', 'size': 67108864= }}} -{u'return': {}} +{"execute": "blockdev-create", "arguments": {"job_id": "job0", "options": = {"driver": "qcow2", "file": "node0", "refcount-bits": 128, "size": 67108864= }}} +{"return": {}} Job failed: Refcount width must be a power of two and may not exceed 64 bi= ts -{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}} -{u'return': {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} =20 -{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': = {'refcount-bits': 0, 'driver': 'qcow2', 'file': 'node0', 'size': 67108864}}} -{u'return': {}} +{"execute": "blockdev-create", "arguments": {"job_id": "job0", "options": = {"driver": "qcow2", "file": "node0", "refcount-bits": 0, "size": 67108864}}} +{"return": {}} Job failed: Refcount width must be a power of two and may not exceed 64 bi= ts -{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}} -{u'return': {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} =20 -{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': = {'refcount-bits': 7, 'driver': 'qcow2', 'file': 'node0', 'size': 67108864}}} -{u'return': {}} +{"execute": "blockdev-create", "arguments": {"job_id": "job0", "options": = {"driver": "qcow2", "file": "node0", "refcount-bits": 7, "size": 67108864}}} +{"return": {}} Job failed: Refcount width must be a power of two and may not exceed 64 bi= ts -{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}} -{u'return': {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} =20 diff --git a/tests/qemu-iotests/207 b/tests/qemu-iotests/207 index 2d86a3da37..c617ee7453 100755 --- a/tests/qemu-iotests/207 +++ b/tests/qemu-iotests/207 @@ -28,7 +28,7 @@ iotests.verify_image_format(supported_fmts=3D['raw']) iotests.verify_protocol(supported=3D['ssh']) =20 def filter_hash(msg): - return re.sub("'hash': '[0-9a-f]+'", "'hash': HASH", msg) + return re.sub('"hash": "[0-9a-f]+"', '"hash": HASH', msg) =20 def blockdev_create(vm, options): result =3D vm.qmp_log('blockdev-create', job_id=3D'job0', options=3Dop= tions, diff --git a/tests/qemu-iotests/207.out b/tests/qemu-iotests/207.out index 078b7e63cb..45ac7c2a8f 100644 --- a/tests/qemu-iotests/207.out +++ b/tests/qemu-iotests/207.out @@ -1,9 +1,9 @@ =3D=3D=3D Successful image creation (defaults) =3D=3D=3D =20 -{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': = {'driver': 'ssh', 'location': {'path': 'TEST_DIR/PID-t.img', 'server': {'ho= st': '127.0.0.1', 'port': '22'}}, 'size': 4194304}}} -{u'return': {}} -{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}} -{u'return': {}} +{"execute": "blockdev-create", "arguments": {"job_id": "job0", "options": = {"driver": "ssh", "location": {"path": "TEST_DIR/PID-t.img", "server": {"ho= st": "127.0.0.1", "port": "22"}}, "size": 4194304}}} +{"return": {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} =20 image: json:{"driver": "IMGFMT", "file": {"server.host": "127.0.0.1", "ser= ver.port": "22", "driver": "ssh", "path": "TEST_IMG"}} file format: IMGFMT @@ -16,49 +16,49 @@ virtual size: 4.0M (4194304 bytes) =20 =3D=3D=3D Test host-key-check options =3D=3D=3D =20 -{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': = {'driver': 'ssh', 'location': {'path': 'TEST_DIR/PID-t.img', 'host-key-chec= k': {'mode': 'none'}, 'server': {'host': '127.0.0.1', 'port': '22'}}, 'size= ': 8388608}}} -{u'return': {}} -{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}} -{u'return': {}} +{"execute": "blockdev-create", "arguments": {"job_id": "job0", "options": = {"driver": "ssh", "location": {"host-key-check": {"mode": "none"}, "path": = "TEST_DIR/PID-t.img", "server": {"host": "127.0.0.1", "port": "22"}}, "size= ": 8388608}}} +{"return": {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} =20 image: json:{"driver": "IMGFMT", "file": {"server.host": "127.0.0.1", "ser= ver.port": "22", "driver": "ssh", "path": "TEST_IMG"}} file format: IMGFMT virtual size: 8.0M (8388608 bytes) =20 -{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': = {'driver': 'ssh', 'location': {'path': 'TEST_DIR/PID-t.img', 'host-key-chec= k': {'mode': 'known_hosts'}, 'server': {'host': '127.0.0.1', 'port': '22'}}= , 'size': 4194304}}} -{u'return': {}} -{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}} -{u'return': {}} +{"execute": "blockdev-create", "arguments": {"job_id": "job0", "options": = {"driver": "ssh", "location": {"host-key-check": {"mode": "known_hosts"}, "= path": "TEST_DIR/PID-t.img", "server": {"host": "127.0.0.1", "port": "22"}}= , "size": 4194304}}} +{"return": {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} =20 image: json:{"driver": "IMGFMT", "file": {"server.host": "127.0.0.1", "ser= ver.port": "22", "driver": "ssh", "path": "TEST_IMG"}} file format: IMGFMT virtual size: 4.0M (4194304 bytes) =20 -{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': = {'driver': 'ssh', 'location': {'path': 'TEST_DIR/PID-t.img', 'host-key-chec= k': {'hash': 'wrong', 'type': 'md5', 'mode': 'hash'}, 'server': {'host': '1= 27.0.0.1', 'port': '22'}}, 'size': 2097152}}} -{u'return': {}} +{"execute": "blockdev-create", "arguments": {"job_id": "job0", "options": = {"driver": "ssh", "location": {"host-key-check": {"hash": "wrong", "mode": = "hash", "type": "md5"}, "path": "TEST_DIR/PID-t.img", "server": {"host": "1= 27.0.0.1", "port": "22"}}, "size": 2097152}}} +{"return": {}} Job failed: remote host key does not match host_key_check 'wrong' -{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}} -{u'return': {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} =20 -{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': = {'driver': 'ssh', 'location': {'path': 'TEST_DIR/PID-t.img', 'host-key-chec= k': {'hash': HASH, 'type': 'md5', 'mode': 'hash'}, 'server': {'host': '127.= 0.0.1', 'port': '22'}}, 'size': 8388608}}} -{u'return': {}} -{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}} -{u'return': {}} +{"execute": "blockdev-create", "arguments": {"job_id": "job0", "options": = {"driver": "ssh", "location": {"host-key-check": {"hash": HASH, "mode": "ha= sh", "type": "md5"}, "path": "TEST_DIR/PID-t.img", "server": {"host": "127.= 0.0.1", "port": "22"}}, "size": 8388608}}} +{"return": {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} =20 image: json:{"driver": "IMGFMT", "file": {"server.host": "127.0.0.1", "ser= ver.port": "22", "driver": "ssh", "path": "TEST_IMG"}} file format: IMGFMT virtual size: 8.0M (8388608 bytes) =20 -{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': = {'driver': 'ssh', 'location': {'path': 'TEST_DIR/PID-t.img', 'host-key-chec= k': {'hash': 'wrong', 'type': 'sha1', 'mode': 'hash'}, 'server': {'host': '= 127.0.0.1', 'port': '22'}}, 'size': 2097152}}} -{u'return': {}} +{"execute": "blockdev-create", "arguments": {"job_id": "job0", "options": = {"driver": "ssh", "location": {"host-key-check": {"hash": "wrong", "mode": = "hash", "type": "sha1"}, "path": "TEST_DIR/PID-t.img", "server": {"host": "= 127.0.0.1", "port": "22"}}, "size": 2097152}}} +{"return": {}} Job failed: remote host key does not match host_key_check 'wrong' -{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}} -{u'return': {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} =20 -{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': = {'driver': 'ssh', 'location': {'path': 'TEST_DIR/PID-t.img', 'host-key-chec= k': {'hash': HASH, 'type': 'sha1', 'mode': 'hash'}, 'server': {'host': '127= .0.0.1', 'port': '22'}}, 'size': 4194304}}} -{u'return': {}} -{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}} -{u'return': {}} +{"execute": "blockdev-create", "arguments": {"job_id": "job0", "options": = {"driver": "ssh", "location": {"host-key-check": {"hash": HASH, "mode": "ha= sh", "type": "sha1"}, "path": "TEST_DIR/PID-t.img", "server": {"host": "127= .0.0.1", "port": "22"}}, "size": 4194304}}} +{"return": {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} =20 image: json:{"driver": "IMGFMT", "file": {"server.host": "127.0.0.1", "ser= ver.port": "22", "driver": "ssh", "path": "TEST_IMG"}} file format: IMGFMT @@ -66,15 +66,15 @@ virtual size: 4.0M (4194304 bytes) =20 =3D=3D=3D Invalid path and user =3D=3D=3D =20 -{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': = {'driver': 'ssh', 'location': {'path': '/this/is/not/an/existing/path', 'ho= st-key-check': {'mode': 'none'}, 'server': {'host': '127.0.0.1', 'port': '2= 2'}}, 'size': 4194304}}} -{u'return': {}} +{"execute": "blockdev-create", "arguments": {"job_id": "job0", "options": = {"driver": "ssh", "location": {"host-key-check": {"mode": "none"}, "path": = "/this/is/not/an/existing/path", "server": {"host": "127.0.0.1", "port": "2= 2"}}, "size": 4194304}}} +{"return": {}} Job failed: failed to open remote file '/this/is/not/an/existing/path': Fa= iled opening remote file (libssh2 error code: -31) -{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}} -{u'return': {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} =20 -{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': = {'driver': 'ssh', 'location': {'path': 'TEST_DIR/PID-t.img', 'host-key-chec= k': {'mode': 'none'}, 'user': 'invalid user', 'server': {'host': '127.0.0.1= ', 'port': '22'}}, 'size': 4194304}}} -{u'return': {}} +{"execute": "blockdev-create", "arguments": {"job_id": "job0", "options": = {"driver": "ssh", "location": {"host-key-check": {"mode": "none"}, "path": = "TEST_DIR/PID-t.img", "server": {"host": "127.0.0.1", "port": "22"}, "user"= : "invalid user"}, "size": 4194304}}} +{"return": {}} Job failed: failed to authenticate using publickey authentication and the = identities held by your ssh-agent -{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}} -{u'return': {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} =20 diff --git a/tests/qemu-iotests/208.out b/tests/qemu-iotests/208.out index 3687e9d0dd..9ff2582a42 100644 --- a/tests/qemu-iotests/208.out +++ b/tests/qemu-iotests/208.out @@ -1,9 +1,9 @@ Launching VM... Starting NBD server... -{u'return': {}} +{"return": {}} Adding NBD export... -{u'return': {}} +{"return": {}} Creating external snapshot... -{u'return': {}} +{"return": {}} Stopping NBD server... -{u'return': {}} +{"return": {}} diff --git a/tests/qemu-iotests/210.out b/tests/qemu-iotests/210.out index 078ba544a1..923cb05117 100644 --- a/tests/qemu-iotests/210.out +++ b/tests/qemu-iotests/210.out @@ -1,16 +1,16 @@ =3D=3D=3D Successful image creation (defaults) =3D=3D=3D =20 -{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': = {'size': 0, 'driver': 'file', 'filename': 'TEST_DIR/PID-t.luks'}}} -{u'return': {}} -{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}} -{u'return': {}} - -{'execute': 'blockdev-add', 'arguments': {'node_name': 'imgfile', 'driver'= : 'file', 'filename': 'TEST_DIR/PID-t.luks'}} -{u'return': {}} -{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': = {'key-secret': 'keysec0', 'iter-time': 10, 'driver': 'luks', 'file': 'imgfi= le', 'size': 134217728}}} -{u'return': {}} -{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}} -{u'return': {}} +{"execute": "blockdev-create", "arguments": {"job_id": "job0", "options": = {"driver": "file", "filename": "TEST_DIR/PID-t.luks", "size": 0}}} +{"return": {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} + +{"execute": "blockdev-add", "arguments": {"driver": "file", "filename": "T= EST_DIR/PID-t.luks", "node_name": "imgfile"}} +{"return": {}} +{"execute": "blockdev-create", "arguments": {"job_id": "job0", "options": = {"driver": "luks", "file": "imgfile", "iter-time": 10, "key-secret": "keyse= c0", "size": 134217728}}} +{"return": {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} =20 image: json:{"driver": "IMGFMT", "file": {"driver": "file", "filename": "T= EST_IMG"}, "key-secret": "keysec0"} file format: IMGFMT @@ -54,15 +54,15 @@ Format specific information: =20 =3D=3D=3D Successful image creation (with non-default options) =3D=3D=3D =20 -{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': = {'size': 0, 'driver': 'file', 'filename': 'TEST_DIR/PID-t.luks'}}} -{u'return': {}} -{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}} -{u'return': {}} +{"execute": "blockdev-create", "arguments": {"job_id": "job0", "options": = {"driver": "file", "filename": "TEST_DIR/PID-t.luks", "size": 0}}} +{"return": {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} =20 -{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': = {'key-secret': 'keysec0', 'hash-alg': 'sha1', 'cipher-mode': 'ctr', 'cipher= -alg': 'twofish-128', 'file': {'driver': 'file', 'filename': 'TEST_DIR/PID-= t.luks'}, 'iter-time': 10, 'ivgen-alg': 'plain64', 'ivgen-hash-alg': 'md5',= 'driver': 'luks', 'size': 67108864}}} -{u'return': {}} -{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}} -{u'return': {}} +{"execute": "blockdev-create", "arguments": {"job_id": "job0", "options": = {"cipher-alg": "twofish-128", "cipher-mode": "ctr", "driver": "luks", "file= ": {"driver": "file", "filename": "TEST_DIR/PID-t.luks"}, "hash-alg": "sha1= ", "iter-time": 10, "ivgen-alg": "plain64", "ivgen-hash-alg": "md5", "key-s= ecret": "keysec0", "size": 67108864}}} +{"return": {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} =20 image: json:{"driver": "IMGFMT", "file": {"driver": "file", "filename": "T= EST_IMG"}, "key-secret": "keysec0"} file format: IMGFMT @@ -106,18 +106,18 @@ Format specific information: =20 =3D=3D=3D Invalid BlockdevRef =3D=3D=3D =20 -{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': = {'driver': 'luks', 'file': "this doesn't exist", 'size': 67108864}}} -{u'return': {}} +{"execute": "blockdev-create", "arguments": {"job_id": "job0", "options": = {"driver": "luks", "file": "this doesn't exist", "size": 67108864}}} +{"return": {}} Job failed: Cannot find device=3Dthis doesn't exist nor node_name=3Dthis d= oesn't exist -{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}} -{u'return': {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} =20 =3D=3D=3D Zero size =3D=3D=3D =20 -{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': = {'key-secret': 'keysec0', 'iter-time': 10, 'driver': 'luks', 'file': 'node0= ', 'size': 0}}} -{u'return': {}} -{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}} -{u'return': {}} +{"execute": "blockdev-create", "arguments": {"job_id": "job0", "options": = {"driver": "luks", "file": "node0", "iter-time": 10, "key-secret": "keysec0= ", "size": 0}}} +{"return": {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} =20 image: json:{"driver": "IMGFMT", "file": {"driver": "file", "filename": "T= EST_IMG"}, "key-secret": "keysec0"} file format: IMGFMT @@ -161,34 +161,34 @@ Format specific information: =20 =3D=3D=3D Invalid sizes =3D=3D=3D =20 -{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': = {'key-secret': 'keysec0', 'driver': 'luks', 'file': 'node0', 'size': 184467= 44073709551104L}}} -{u'return': {}} +{"execute": "blockdev-create", "arguments": {"job_id": "job0", "options": = {"driver": "luks", "file": "node0", "key-secret": "keysec0", "size": 184467= 44073709551104}}} +{"return": {}} Job failed: The requested file size is too large -{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}} -{u'return': {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} =20 -{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': = {'key-secret': 'keysec0', 'driver': 'luks', 'file': 'node0', 'size': 922337= 2036854775808L}}} -{u'return': {}} +{"execute": "blockdev-create", "arguments": {"job_id": "job0", "options": = {"driver": "luks", "file": "node0", "key-secret": "keysec0", "size": 922337= 2036854775808}}} +{"return": {}} Job failed: The requested file size is too large -{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}} -{u'return': {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} =20 -{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': = {'key-secret': 'keysec0', 'driver': 'luks', 'file': 'node0', 'size': 922337= 2036854775296}}} -{u'return': {}} +{"execute": "blockdev-create", "arguments": {"job_id": "job0", "options": = {"driver": "luks", "file": "node0", "key-secret": "keysec0", "size": 922337= 2036854775296}}} +{"return": {}} Job failed: The requested file size is too large -{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}} -{u'return': {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} =20 =3D=3D=3D Resize image with invalid sizes =3D=3D=3D =20 -{'execute': 'block_resize', 'arguments': {'size': 9223372036854775296, 'no= de_name': 'node1'}} -{u'error': {u'class': u'GenericError', u'desc': u'The requested file size = is too large'}} -{'execute': 'block_resize', 'arguments': {'size': 9223372036854775808L, 'n= ode_name': 'node1'}} -{u'error': {u'class': u'GenericError', u'desc': u"Invalid parameter type f= or 'size', expected: integer"}} -{'execute': 'block_resize', 'arguments': {'size': 18446744073709551104L, '= node_name': 'node1'}} -{u'error': {u'class': u'GenericError', u'desc': u"Invalid parameter type f= or 'size', expected: integer"}} -{'execute': 'block_resize', 'arguments': {'size': -9223372036854775808, 'n= ode_name': 'node1'}} -{u'error': {u'class': u'GenericError', u'desc': u"Parameter 'size' expects= a >0 size"}} +{"execute": "block_resize", "arguments": {"node_name": "node1", "size": 92= 23372036854775296}} +{"error": {"class": "GenericError", "desc": "The requested file size is to= o large"}} +{"execute": "block_resize", "arguments": {"node_name": "node1", "size": 92= 23372036854775808}} +{"error": {"class": "GenericError", "desc": "Invalid parameter type for 's= ize', expected: integer"}} +{"execute": "block_resize", "arguments": {"node_name": "node1", "size": 18= 446744073709551104}} +{"error": {"class": "GenericError", "desc": "Invalid parameter type for 's= ize', expected: integer"}} +{"execute": "block_resize", "arguments": {"node_name": "node1", "size": -9= 223372036854775808}} +{"error": {"class": "GenericError", "desc": "Parameter 'size' expects a >0= size"}} image: json:{"driver": "IMGFMT", "file": {"driver": "file", "filename": "T= EST_IMG"}, "key-secret": "keysec0"} file format: IMGFMT virtual size: 0 (0 bytes) diff --git a/tests/qemu-iotests/211.out b/tests/qemu-iotests/211.out index 6feaea3978..eebb0ea086 100644 --- a/tests/qemu-iotests/211.out +++ b/tests/qemu-iotests/211.out @@ -1,16 +1,16 @@ =3D=3D=3D Successful image creation (defaults) =3D=3D=3D =20 -{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': = {'size': 0, 'driver': 'file', 'filename': 'TEST_DIR/PID-t.vdi'}}} -{u'return': {}} -{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}} -{u'return': {}} - -{'execute': 'blockdev-add', 'arguments': {'node_name': 'imgfile', 'driver'= : 'file', 'filename': 'TEST_DIR/PID-t.vdi'}} -{u'return': {}} -{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': = {'driver': 'vdi', 'file': 'imgfile', 'size': 134217728}}} -{u'return': {}} -{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}} -{u'return': {}} +{"execute": "blockdev-create", "arguments": {"job_id": "job0", "options": = {"driver": "file", "filename": "TEST_DIR/PID-t.vdi", "size": 0}}} +{"return": {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} + +{"execute": "blockdev-add", "arguments": {"driver": "file", "filename": "T= EST_DIR/PID-t.vdi", "node_name": "imgfile"}} +{"return": {}} +{"execute": "blockdev-create", "arguments": {"job_id": "job0", "options": = {"driver": "vdi", "file": "imgfile", "size": 134217728}}} +{"return": {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} =20 image: TEST_IMG file format: IMGFMT @@ -21,15 +21,15 @@ cluster_size: 1048576 =20 =3D=3D=3D Successful image creation (explicit defaults) =3D=3D=3D =20 -{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': = {'size': 0, 'driver': 'file', 'filename': 'TEST_DIR/PID-t.vdi'}}} -{u'return': {}} -{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}} -{u'return': {}} +{"execute": "blockdev-create", "arguments": {"job_id": "job0", "options": = {"driver": "file", "filename": "TEST_DIR/PID-t.vdi", "size": 0}}} +{"return": {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} =20 -{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': = {'preallocation': 'off', 'driver': 'vdi', 'file': {'driver': 'file', 'filen= ame': 'TEST_DIR/PID-t.vdi'}, 'size': 67108864}}} -{u'return': {}} -{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}} -{u'return': {}} +{"execute": "blockdev-create", "arguments": {"job_id": "job0", "options": = {"driver": "vdi", "file": {"driver": "file", "filename": "TEST_DIR/PID-t.vd= i"}, "preallocation": "off", "size": 67108864}}} +{"return": {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} =20 image: TEST_IMG file format: IMGFMT @@ -40,15 +40,15 @@ cluster_size: 1048576 =20 =3D=3D=3D Successful image creation (with non-default options) =3D=3D=3D =20 -{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': = {'size': 0, 'driver': 'file', 'filename': 'TEST_DIR/PID-t.vdi'}}} -{u'return': {}} -{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}} -{u'return': {}} +{"execute": "blockdev-create", "arguments": {"job_id": "job0", "options": = {"driver": "file", "filename": "TEST_DIR/PID-t.vdi", "size": 0}}} +{"return": {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} =20 -{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': = {'preallocation': 'metadata', 'driver': 'vdi', 'file': {'driver': 'file', '= filename': 'TEST_DIR/PID-t.vdi'}, 'size': 33554432}}} -{u'return': {}} -{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}} -{u'return': {}} +{"execute": "blockdev-create", "arguments": {"job_id": "job0", "options": = {"driver": "vdi", "file": {"driver": "file", "filename": "TEST_DIR/PID-t.vd= i"}, "preallocation": "metadata", "size": 33554432}}} +{"return": {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} =20 image: TEST_IMG file format: IMGFMT @@ -60,18 +60,18 @@ cluster_size: 1048576 =20 =3D=3D=3D Invalid BlockdevRef =3D=3D=3D =20 -{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': = {'driver': 'vdi', 'file': "this doesn't exist", 'size': 33554432}}} -{u'return': {}} +{"execute": "blockdev-create", "arguments": {"job_id": "job0", "options": = {"driver": "vdi", "file": "this doesn't exist", "size": 33554432}}} +{"return": {}} Job failed: Cannot find device=3Dthis doesn't exist nor node_name=3Dthis d= oesn't exist -{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}} -{u'return': {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} =20 =3D=3D=3D Zero size =3D=3D=3D =20 -{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': = {'driver': 'vdi', 'file': 'node0', 'size': 0}}} -{u'return': {}} -{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}} -{u'return': {}} +{"execute": "blockdev-create", "arguments": {"job_id": "job0", "options": = {"driver": "vdi", "file": "node0", "size": 0}}} +{"return": {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} =20 image: TEST_IMG file format: IMGFMT @@ -80,10 +80,10 @@ cluster_size: 1048576 =20 =3D=3D=3D Maximum size =3D=3D=3D =20 -{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': = {'driver': 'vdi', 'file': 'node0', 'size': 562949819203584}}} -{u'return': {}} -{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}} -{u'return': {}} +{"execute": "blockdev-create", "arguments": {"job_id": "job0", "options": = {"driver": "vdi", "file": "node0", "size": 562949819203584}}} +{"return": {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} =20 image: TEST_IMG file format: IMGFMT @@ -92,21 +92,21 @@ cluster_size: 1048576 =20 =3D=3D=3D Invalid sizes =3D=3D=3D =20 -{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': = {'driver': 'vdi', 'file': 'node0', 'size': 18446744073709551104L}}} -{u'return': {}} +{"execute": "blockdev-create", "arguments": {"job_id": "job0", "options": = {"driver": "vdi", "file": "node0", "size": 18446744073709551104}}} +{"return": {}} Job failed: Unsupported VDI image size (size is 0xfffffffffffffe00, max su= pported is 0x1fffff8000000) -{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}} -{u'return': {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} =20 -{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': = {'driver': 'vdi', 'file': 'node0', 'size': 9223372036854775808L}}} -{u'return': {}} +{"execute": "blockdev-create", "arguments": {"job_id": "job0", "options": = {"driver": "vdi", "file": "node0", "size": 9223372036854775808}}} +{"return": {}} Job failed: Unsupported VDI image size (size is 0x8000000000000000, max su= pported is 0x1fffff8000000) -{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}} -{u'return': {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} =20 -{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': = {'driver': 'vdi', 'file': 'node0', 'size': 562949819203585}}} -{u'return': {}} +{"execute": "blockdev-create", "arguments": {"job_id": "job0", "options": = {"driver": "vdi", "file": "node0", "size": 562949819203585}}} +{"return": {}} Job failed: Unsupported VDI image size (size is 0x1fffff8000001, max suppo= rted is 0x1fffff8000000) -{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}} -{u'return': {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} =20 diff --git a/tests/qemu-iotests/212.out b/tests/qemu-iotests/212.out index 9150da7a2c..01da467282 100644 --- a/tests/qemu-iotests/212.out +++ b/tests/qemu-iotests/212.out @@ -1,16 +1,16 @@ =3D=3D=3D Successful image creation (defaults) =3D=3D=3D =20 -{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': = {'size': 0, 'driver': 'file', 'filename': 'TEST_DIR/PID-t.parallels'}}} -{u'return': {}} -{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}} -{u'return': {}} - -{'execute': 'blockdev-add', 'arguments': {'node_name': 'imgfile', 'driver'= : 'file', 'filename': 'TEST_DIR/PID-t.parallels'}} -{u'return': {}} -{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': = {'driver': 'parallels', 'file': 'imgfile', 'size': 134217728}}} -{u'return': {}} -{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}} -{u'return': {}} +{"execute": "blockdev-create", "arguments": {"job_id": "job0", "options": = {"driver": "file", "filename": "TEST_DIR/PID-t.parallels", "size": 0}}} +{"return": {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} + +{"execute": "blockdev-add", "arguments": {"driver": "file", "filename": "T= EST_DIR/PID-t.parallels", "node_name": "imgfile"}} +{"return": {}} +{"execute": "blockdev-create", "arguments": {"job_id": "job0", "options": = {"driver": "parallels", "file": "imgfile", "size": 134217728}}} +{"return": {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} =20 image: TEST_IMG file format: IMGFMT @@ -18,15 +18,15 @@ virtual size: 128M (134217728 bytes) =20 =3D=3D=3D Successful image creation (explicit defaults) =3D=3D=3D =20 -{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': = {'size': 0, 'driver': 'file', 'filename': 'TEST_DIR/PID-t.parallels'}}} -{u'return': {}} -{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}} -{u'return': {}} +{"execute": "blockdev-create", "arguments": {"job_id": "job0", "options": = {"driver": "file", "filename": "TEST_DIR/PID-t.parallels", "size": 0}}} +{"return": {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} =20 -{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': = {'cluster-size': 1048576, 'driver': 'parallels', 'file': {'driver': 'file',= 'filename': 'TEST_DIR/PID-t.parallels'}, 'size': 67108864}}} -{u'return': {}} -{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}} -{u'return': {}} +{"execute": "blockdev-create", "arguments": {"job_id": "job0", "options": = {"cluster-size": 1048576, "driver": "parallels", "file": {"driver": "file",= "filename": "TEST_DIR/PID-t.parallels"}, "size": 67108864}}} +{"return": {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} =20 image: TEST_IMG file format: IMGFMT @@ -34,15 +34,15 @@ virtual size: 64M (67108864 bytes) =20 =3D=3D=3D Successful image creation (with non-default options) =3D=3D=3D =20 -{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': = {'size': 0, 'driver': 'file', 'filename': 'TEST_DIR/PID-t.parallels'}}} -{u'return': {}} -{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}} -{u'return': {}} +{"execute": "blockdev-create", "arguments": {"job_id": "job0", "options": = {"driver": "file", "filename": "TEST_DIR/PID-t.parallels", "size": 0}}} +{"return": {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} =20 -{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': = {'cluster-size': 65536, 'driver': 'parallels', 'file': {'driver': 'file', '= filename': 'TEST_DIR/PID-t.parallels'}, 'size': 33554432}}} -{u'return': {}} -{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}} -{u'return': {}} +{"execute": "blockdev-create", "arguments": {"job_id": "job0", "options": = {"cluster-size": 65536, "driver": "parallels", "file": {"driver": "file", "= filename": "TEST_DIR/PID-t.parallels"}, "size": 33554432}}} +{"return": {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} =20 image: TEST_IMG file format: IMGFMT @@ -50,18 +50,18 @@ virtual size: 32M (33554432 bytes) =20 =3D=3D=3D Invalid BlockdevRef =3D=3D=3D =20 -{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': = {'driver': 'parallels', 'file': "this doesn't exist", 'size': 33554432}}} -{u'return': {}} +{"execute": "blockdev-create", "arguments": {"job_id": "job0", "options": = {"driver": "parallels", "file": "this doesn't exist", "size": 33554432}}} +{"return": {}} Job failed: Cannot find device=3Dthis doesn't exist nor node_name=3Dthis d= oesn't exist -{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}} -{u'return': {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} =20 =3D=3D=3D Zero size =3D=3D=3D =20 -{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': = {'driver': 'parallels', 'file': 'node0', 'size': 0}}} -{u'return': {}} -{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}} -{u'return': {}} +{"execute": "blockdev-create", "arguments": {"job_id": "job0", "options": = {"driver": "parallels", "file": "node0", "size": 0}}} +{"return": {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} =20 image: TEST_IMG file format: IMGFMT @@ -69,10 +69,10 @@ virtual size: 0 (0 bytes) =20 =3D=3D=3D Maximum size =3D=3D=3D =20 -{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': = {'driver': 'parallels', 'file': 'node0', 'size': 4503599627369984}}} -{u'return': {}} -{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}} -{u'return': {}} +{"execute": "blockdev-create", "arguments": {"job_id": "job0", "options": = {"driver": "parallels", "file": "node0", "size": 4503599627369984}}} +{"return": {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} =20 image: TEST_IMG file format: IMGFMT @@ -80,77 +80,77 @@ virtual size: 4096T (4503599627369984 bytes) =20 =3D=3D=3D Invalid sizes =3D=3D=3D =20 -{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': = {'driver': 'parallels', 'file': 'node0', 'size': 1234}}} -{u'return': {}} +{"execute": "blockdev-create", "arguments": {"job_id": "job0", "options": = {"driver": "parallels", "file": "node0", "size": 1234}}} +{"return": {}} Job failed: Image size must be a multiple of 512 bytes -{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}} -{u'return': {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} =20 -{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': = {'driver': 'parallels', 'file': 'node0', 'size': 18446744073709551104L}}} -{u'return': {}} +{"execute": "blockdev-create", "arguments": {"job_id": "job0", "options": = {"driver": "parallels", "file": "node0", "size": 18446744073709551104}}} +{"return": {}} Job failed: Image size is too large for this cluster size -{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}} -{u'return': {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} =20 -{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': = {'driver': 'parallels', 'file': 'node0', 'size': 9223372036854775808L}}} -{u'return': {}} +{"execute": "blockdev-create", "arguments": {"job_id": "job0", "options": = {"driver": "parallels", "file": "node0", "size": 9223372036854775808}}} +{"return": {}} Job failed: Image size is too large for this cluster size -{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}} -{u'return': {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} =20 -{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': = {'driver': 'parallels', 'file': 'node0', 'size': 9223372036854775296}}} -{u'return': {}} +{"execute": "blockdev-create", "arguments": {"job_id": "job0", "options": = {"driver": "parallels", "file": "node0", "size": 9223372036854775296}}} +{"return": {}} Job failed: Image size is too large for this cluster size -{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}} -{u'return': {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} =20 -{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': = {'driver': 'parallels', 'file': 'node0', 'size': 4503599627370497}}} -{u'return': {}} +{"execute": "blockdev-create", "arguments": {"job_id": "job0", "options": = {"driver": "parallels", "file": "node0", "size": 4503599627370497}}} +{"return": {}} Job failed: Image size is too large for this cluster size -{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}} -{u'return': {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} =20 =3D=3D=3D Invalid cluster size =3D=3D=3D =20 -{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': = {'cluster-size': 1234, 'driver': 'parallels', 'file': 'node0', 'size': 6710= 8864}}} -{u'return': {}} +{"execute": "blockdev-create", "arguments": {"job_id": "job0", "options": = {"cluster-size": 1234, "driver": "parallels", "file": "node0", "size": 6710= 8864}}} +{"return": {}} Job failed: Cluster size must be a multiple of 512 bytes -{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}} -{u'return': {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} =20 -{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': = {'cluster-size': 128, 'driver': 'parallels', 'file': 'node0', 'size': 67108= 864}}} -{u'return': {}} +{"execute": "blockdev-create", "arguments": {"job_id": "job0", "options": = {"cluster-size": 128, "driver": "parallels", "file": "node0", "size": 67108= 864}}} +{"return": {}} Job failed: Cluster size must be a multiple of 512 bytes -{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}} -{u'return': {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} =20 -{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': = {'cluster-size': 4294967296, 'driver': 'parallels', 'file': 'node0', 'size'= : 67108864}}} -{u'return': {}} +{"execute": "blockdev-create", "arguments": {"job_id": "job0", "options": = {"cluster-size": 4294967296, "driver": "parallels", "file": "node0", "size"= : 67108864}}} +{"return": {}} Job failed: Cluster size is too large -{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}} -{u'return': {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} =20 -{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': = {'cluster-size': 9223372036854775808L, 'driver': 'parallels', 'file': 'node= 0', 'size': 67108864}}} -{u'return': {}} +{"execute": "blockdev-create", "arguments": {"job_id": "job0", "options": = {"cluster-size": 9223372036854775808, "driver": "parallels", "file": "node0= ", "size": 67108864}}} +{"return": {}} Job failed: Cluster size is too large -{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}} -{u'return': {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} =20 -{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': = {'cluster-size': 18446744073709551104L, 'driver': 'parallels', 'file': 'nod= e0', 'size': 67108864}}} -{u'return': {}} +{"execute": "blockdev-create", "arguments": {"job_id": "job0", "options": = {"cluster-size": 18446744073709551104, "driver": "parallels", "file": "node= 0", "size": 67108864}}} +{"return": {}} Job failed: Cluster size is too large -{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}} -{u'return': {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} =20 -{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': = {'cluster-size': 0, 'driver': 'parallels', 'file': 'node0', 'size': 6710886= 4}}} -{u'return': {}} +{"execute": "blockdev-create", "arguments": {"job_id": "job0", "options": = {"cluster-size": 0, "driver": "parallels", "file": "node0", "size": 6710886= 4}}} +{"return": {}} Job failed: Image size is too large for this cluster size -{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}} -{u'return': {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} =20 -{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': = {'cluster-size': 512, 'driver': 'parallels', 'file': 'node0', 'size': 28147= 4976710656}}} -{u'return': {}} +{"execute": "blockdev-create", "arguments": {"job_id": "job0", "options": = {"cluster-size": 512, "driver": "parallels", "file": "node0", "size": 28147= 4976710656}}} +{"return": {}} Job failed: Image size is too large for this cluster size -{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}} -{u'return': {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} =20 diff --git a/tests/qemu-iotests/213.out b/tests/qemu-iotests/213.out index e1dcd47201..0c9d65b2fe 100644 --- a/tests/qemu-iotests/213.out +++ b/tests/qemu-iotests/213.out @@ -1,16 +1,16 @@ =3D=3D=3D Successful image creation (defaults) =3D=3D=3D =20 -{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': = {'size': 0, 'driver': 'file', 'filename': 'TEST_DIR/PID-t.vhdx'}}} -{u'return': {}} -{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}} -{u'return': {}} - -{'execute': 'blockdev-add', 'arguments': {'node_name': 'imgfile', 'driver'= : 'file', 'filename': 'TEST_DIR/PID-t.vhdx'}} -{u'return': {}} -{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': = {'driver': 'vhdx', 'file': 'imgfile', 'size': 134217728}}} -{u'return': {}} -{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}} -{u'return': {}} +{"execute": "blockdev-create", "arguments": {"job_id": "job0", "options": = {"driver": "file", "filename": "TEST_DIR/PID-t.vhdx", "size": 0}}} +{"return": {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} + +{"execute": "blockdev-add", "arguments": {"driver": "file", "filename": "T= EST_DIR/PID-t.vhdx", "node_name": "imgfile"}} +{"return": {}} +{"execute": "blockdev-create", "arguments": {"job_id": "job0", "options": = {"driver": "vhdx", "file": "imgfile", "size": 134217728}}} +{"return": {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} =20 image: TEST_IMG file format: IMGFMT @@ -19,15 +19,15 @@ cluster_size: 8388608 =20 =3D=3D=3D Successful image creation (explicit defaults) =3D=3D=3D =20 -{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': = {'size': 0, 'driver': 'file', 'filename': 'TEST_DIR/PID-t.vhdx'}}} -{u'return': {}} -{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}} -{u'return': {}} +{"execute": "blockdev-create", "arguments": {"job_id": "job0", "options": = {"driver": "file", "filename": "TEST_DIR/PID-t.vhdx", "size": 0}}} +{"return": {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} =20 -{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': = {'block-size': 8388608, 'driver': 'vhdx', 'subformat': 'dynamic', 'log-size= ': 1048576, 'file': {'driver': 'file', 'filename': 'TEST_DIR/PID-t.vhdx'}, = 'block-state-zero': True, 'size': 67108864}}} -{u'return': {}} -{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}} -{u'return': {}} +{"execute": "blockdev-create", "arguments": {"job_id": "job0", "options": = {"block-size": 8388608, "block-state-zero": true, "driver": "vhdx", "file":= {"driver": "file", "filename": "TEST_DIR/PID-t.vhdx"}, "log-size": 1048576= , "size": 67108864, "subformat": "dynamic"}}} +{"return": {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} =20 image: TEST_IMG file format: IMGFMT @@ -36,15 +36,15 @@ cluster_size: 8388608 =20 =3D=3D=3D Successful image creation (with non-default options) =3D=3D=3D =20 -{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': = {'size': 0, 'driver': 'file', 'filename': 'TEST_DIR/PID-t.vhdx'}}} -{u'return': {}} -{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}} -{u'return': {}} +{"execute": "blockdev-create", "arguments": {"job_id": "job0", "options": = {"driver": "file", "filename": "TEST_DIR/PID-t.vhdx", "size": 0}}} +{"return": {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} =20 -{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': = {'block-size': 268435456, 'driver': 'vhdx', 'subformat': 'fixed', 'log-size= ': 8388608, 'file': {'driver': 'file', 'filename': 'TEST_DIR/PID-t.vhdx'}, = 'block-state-zero': False, 'size': 33554432}}} -{u'return': {}} -{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}} -{u'return': {}} +{"execute": "blockdev-create", "arguments": {"job_id": "job0", "options": = {"block-size": 268435456, "block-state-zero": false, "driver": "vhdx", "fil= e": {"driver": "file", "filename": "TEST_DIR/PID-t.vhdx"}, "log-size": 8388= 608, "size": 33554432, "subformat": "fixed"}}} +{"return": {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} =20 image: TEST_IMG file format: IMGFMT @@ -53,18 +53,18 @@ cluster_size: 268435456 =20 =3D=3D=3D Invalid BlockdevRef =3D=3D=3D =20 -{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': = {'driver': 'vhdx', 'file': "this doesn't exist", 'size': 33554432}}} -{u'return': {}} +{"execute": "blockdev-create", "arguments": {"job_id": "job0", "options": = {"driver": "vhdx", "file": "this doesn't exist", "size": 33554432}}} +{"return": {}} Job failed: Cannot find device=3Dthis doesn't exist nor node_name=3Dthis d= oesn't exist -{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}} -{u'return': {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} =20 =3D=3D=3D Zero size =3D=3D=3D =20 -{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': = {'driver': 'vhdx', 'file': 'node0', 'size': 0}}} -{u'return': {}} -{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}} -{u'return': {}} +{"execute": "blockdev-create", "arguments": {"job_id": "job0", "options": = {"driver": "vhdx", "file": "node0", "size": 0}}} +{"return": {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} =20 image: TEST_IMG file format: IMGFMT @@ -73,10 +73,10 @@ cluster_size: 8388608 =20 =3D=3D=3D Maximum size =3D=3D=3D =20 -{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': = {'driver': 'vhdx', 'file': 'node0', 'size': 70368744177664}}} -{u'return': {}} -{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}} -{u'return': {}} +{"execute": "blockdev-create", "arguments": {"job_id": "job0", "options": = {"driver": "vhdx", "file": "node0", "size": 70368744177664}}} +{"return": {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} =20 image: TEST_IMG file format: IMGFMT @@ -85,85 +85,85 @@ cluster_size: 67108864 =20 =3D=3D=3D Invalid sizes =3D=3D=3D =20 -{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': = {'driver': 'vhdx', 'file': 'node0', 'size': 18446744073709551104L}}} -{u'return': {}} +{"execute": "blockdev-create", "arguments": {"job_id": "job0", "options": = {"driver": "vhdx", "file": "node0", "size": 18446744073709551104}}} +{"return": {}} Job failed: Image size too large; max of 64TB -{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}} -{u'return': {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} =20 -{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': = {'driver': 'vhdx', 'file': 'node0', 'size': 9223372036854775808L}}} -{u'return': {}} +{"execute": "blockdev-create", "arguments": {"job_id": "job0", "options": = {"driver": "vhdx", "file": "node0", "size": 9223372036854775808}}} +{"return": {}} Job failed: Image size too large; max of 64TB -{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}} -{u'return': {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} =20 -{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': = {'driver': 'vhdx', 'file': 'node0', 'size': 9223372036854775296}}} -{u'return': {}} +{"execute": "blockdev-create", "arguments": {"job_id": "job0", "options": = {"driver": "vhdx", "file": "node0", "size": 9223372036854775296}}} +{"return": {}} Job failed: Image size too large; max of 64TB -{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}} -{u'return': {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} =20 -{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': = {'driver': 'vhdx', 'file': 'node0', 'size': 70368744177665}}} -{u'return': {}} +{"execute": "blockdev-create", "arguments": {"job_id": "job0", "options": = {"driver": "vhdx", "file": "node0", "size": 70368744177665}}} +{"return": {}} Job failed: Image size too large; max of 64TB -{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}} -{u'return': {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} =20 =3D=3D=3D Invalid block size =3D=3D=3D =20 -{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': = {'driver': 'vhdx', 'block-size': 1234567, 'file': 'node0', 'size': 67108864= }}} -{u'return': {}} +{"execute": "blockdev-create", "arguments": {"job_id": "job0", "options": = {"block-size": 1234567, "driver": "vhdx", "file": "node0", "size": 67108864= }}} +{"return": {}} Job failed: Block size must be a multiple of 1 MB -{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}} -{u'return': {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} =20 -{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': = {'driver': 'vhdx', 'block-size': 128, 'file': 'node0', 'size': 67108864}}} -{u'return': {}} +{"execute": "blockdev-create", "arguments": {"job_id": "job0", "options": = {"block-size": 128, "driver": "vhdx", "file": "node0", "size": 67108864}}} +{"return": {}} Job failed: Block size must be a multiple of 1 MB -{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}} -{u'return': {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} =20 -{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': = {'driver': 'vhdx', 'block-size': 3145728, 'file': 'node0', 'size': 67108864= }}} -{u'return': {}} +{"execute": "blockdev-create", "arguments": {"job_id": "job0", "options": = {"block-size": 3145728, "driver": "vhdx", "file": "node0", "size": 67108864= }}} +{"return": {}} Job failed: Block size must be a power of two -{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}} -{u'return': {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} =20 -{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': = {'driver': 'vhdx', 'block-size': 536870912, 'file': 'node0', 'size': 671088= 64}}} -{u'return': {}} +{"execute": "blockdev-create", "arguments": {"job_id": "job0", "options": = {"block-size": 536870912, "driver": "vhdx", "file": "node0", "size": 671088= 64}}} +{"return": {}} Job failed: Block size must not exceed 268435456 -{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}} -{u'return': {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} =20 -{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': = {'driver': 'vhdx', 'block-size': 0, 'file': 'node0', 'size': 67108864}}} -{u'return': {}} +{"execute": "blockdev-create", "arguments": {"job_id": "job0", "options": = {"block-size": 0, "driver": "vhdx", "file": "node0", "size": 67108864}}} +{"return": {}} Job failed: Block size must be a multiple of 1 MB -{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}} -{u'return': {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} =20 =3D=3D=3D Invalid log size =3D=3D=3D =20 -{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': = {'log-size': 1234567, 'driver': 'vhdx', 'file': 'node0', 'size': 67108864}}} -{u'return': {}} +{"execute": "blockdev-create", "arguments": {"job_id": "job0", "options": = {"driver": "vhdx", "file": "node0", "log-size": 1234567, "size": 67108864}}} +{"return": {}} Job failed: Log size must be a multiple of 1 MB -{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}} -{u'return': {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} =20 -{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': = {'log-size': 128, 'driver': 'vhdx', 'file': 'node0', 'size': 67108864}}} -{u'return': {}} +{"execute": "blockdev-create", "arguments": {"job_id": "job0", "options": = {"driver": "vhdx", "file": "node0", "log-size": 128, "size": 67108864}}} +{"return": {}} Job failed: Log size must be a multiple of 1 MB -{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}} -{u'return': {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} =20 -{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': = {'log-size': 4294967296, 'driver': 'vhdx', 'file': 'node0', 'size': 6710886= 4}}} -{u'return': {}} +{"execute": "blockdev-create", "arguments": {"job_id": "job0", "options": = {"driver": "vhdx", "file": "node0", "log-size": 4294967296, "size": 6710886= 4}}} +{"return": {}} Job failed: Log size must be smaller than 4 GB -{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}} -{u'return': {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} =20 -{'execute': 'blockdev-create', 'arguments': {'job_id': 'job0', 'options': = {'log-size': 0, 'driver': 'vhdx', 'file': 'node0', 'size': 67108864}}} -{u'return': {}} +{"execute": "blockdev-create", "arguments": {"job_id": "job0", "options": = {"driver": "vhdx", "file": "node0", "log-size": 0, "size": 67108864}}} +{"return": {}} Job failed: Log size must be a multiple of 1 MB -{'execute': 'job-dismiss', 'arguments': {'id': 'job0'}} -{u'return': {}} +{"execute": "job-dismiss", "arguments": {"id": "job0"}} +{"return": {}} =20 diff --git a/tests/qemu-iotests/216.out b/tests/qemu-iotests/216.out index 45ea857ee1..a70aa5cdae 100644 --- a/tests/qemu-iotests/216.out +++ b/tests/qemu-iotests/216.out @@ -7,8 +7,8 @@ Done =20 --- Doing COR --- =20 -{u'return': {}} -{u'return': u''} +{"return": {}} +{"return": ""} =20 --- Checking COR result --- =20 diff --git a/tests/qemu-iotests/218.out b/tests/qemu-iotests/218.out index 7dbf78e682..825a657081 100644 --- a/tests/qemu-iotests/218.out +++ b/tests/qemu-iotests/218.out @@ -4,27 +4,27 @@ --- force=3Dfalse --- =20 Cancelling job -{u'return': {}} -{u'timestamp': {u'seconds': 'SECS', u'microseconds': 'USECS'}, u'data': {u= 'device': u'mirror', u'type': u'mirror', u'speed': 65536, u'len': 1048576, = u'offset': 65536}, u'event': u'BLOCK_JOB_CANCELLED'} +{"return": {}} +{"data": {"device": "mirror", "len": 1048576, "offset": 65536, "speed": 65= 536, "type": "mirror"}, "event": "BLOCK_JOB_CANCELLED", "timestamp": {"micr= oseconds": "USECS", "seconds": "SECS"}} =20 --- force=3Dtrue --- =20 Cancelling job -{u'return': {}} -{u'timestamp': {u'seconds': 'SECS', u'microseconds': 'USECS'}, u'data': {u= 'device': u'mirror', u'type': u'mirror', u'speed': 65536, u'len': 1048576, = u'offset': 65536}, u'event': u'BLOCK_JOB_CANCELLED'} +{"return": {}} +{"data": {"device": "mirror", "len": 1048576, "offset": 65536, "speed": 65= 536, "type": "mirror"}, "event": "BLOCK_JOB_CANCELLED", "timestamp": {"micr= oseconds": "USECS", "seconds": "SECS"}} =20 =3D=3D=3D Cancel mirror job after convergence =3D=3D=3D =20 --- force=3Dfalse --- =20 -{u'timestamp': {u'seconds': 'SECS', u'microseconds': 'USECS'}, u'data': {u= 'device': u'mirror', u'type': u'mirror', u'speed': 0, u'len': 1048576, u'of= fset': 1048576}, u'event': u'BLOCK_JOB_READY'} +{"data": {"device": "mirror", "len": 1048576, "offset": 1048576, "speed": = 0, "type": "mirror"}, "event": "BLOCK_JOB_READY", "timestamp": {"microsecon= ds": "USECS", "seconds": "SECS"}} Cancelling job -{u'return': {}} -{u'timestamp': {u'seconds': 'SECS', u'microseconds': 'USECS'}, u'data': {u= 'device': u'mirror', u'type': u'mirror', u'speed': 0, u'len': 1048576, u'of= fset': 1048576}, u'event': u'BLOCK_JOB_COMPLETED'} +{"return": {}} +{"data": {"device": "mirror", "len": 1048576, "offset": 1048576, "speed": = 0, "type": "mirror"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"micros= econds": "USECS", "seconds": "SECS"}} =20 --- force=3Dtrue --- =20 -{u'timestamp': {u'seconds': 'SECS', u'microseconds': 'USECS'}, u'data': {u= 'device': u'mirror', u'type': u'mirror', u'speed': 0, u'len': 1048576, u'of= fset': 1048576}, u'event': u'BLOCK_JOB_READY'} +{"data": {"device": "mirror", "len": 1048576, "offset": 1048576, "speed": = 0, "type": "mirror"}, "event": "BLOCK_JOB_READY", "timestamp": {"microsecon= ds": "USECS", "seconds": "SECS"}} Cancelling job -{u'return': {}} -{u'timestamp': {u'seconds': 'SECS', u'microseconds': 'USECS'}, u'data': {u= 'device': u'mirror', u'type': u'mirror', u'speed': 0, u'len': 1048576, u'of= fset': 1048576}, u'event': u'BLOCK_JOB_CANCELLED'} +{"return": {}} +{"data": {"device": "mirror", "len": 1048576, "offset": 1048576, "speed": = 0, "type": "mirror"}, "event": "BLOCK_JOB_CANCELLED", "timestamp": {"micros= econds": "USECS", "seconds": "SECS"}} diff --git a/tests/qemu-iotests/219.out b/tests/qemu-iotests/219.out index 6dc07bc41e..8ebd3fee60 100644 --- a/tests/qemu-iotests/219.out +++ b/tests/qemu-iotests/219.out @@ -2,326 +2,326 @@ Launching VM... =20 =20 Starting block job: drive-mirror (auto-finalize: True; auto-dismiss: True) -{u'return': {}} -{u'return': [{u'status': u'running', u'current-progress': 'FILTERED', u'to= tal-progress': 'FILTERED', u'id': u'job0', u'type': u'mirror'}]} -{u'timestamp': {u'seconds': 'SECS', u'microseconds': 'USECS'}, u'data': {u= 'status': u'created', u'id': u'job0'}, u'event': u'JOB_STATUS_CHANGE'} -{u'timestamp': {u'seconds': 'SECS', u'microseconds': 'USECS'}, u'data': {u= 'status': u'running', u'id': u'job0'}, u'event': u'JOB_STATUS_CHANGE'} +{"return": {}} +{"return": [{"current-progress": "FILTERED", "id": "job0", "status": "runn= ing", "total-progress": "FILTERED", "type": "mirror"}]} +{"data": {"id": "job0", "status": "created"}, "event": "JOB_STATUS_CHANGE"= , "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"id": "job0", "status": "running"}, "event": "JOB_STATUS_CHANGE"= , "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} =20 Pause/resume in RUNNING =3D=3D=3D Testing block-job-pause/block-job-resume =3D=3D=3D -{u'return': {}} -{u'timestamp': {u'seconds': 'SECS', u'microseconds': 'USECS'}, u'data': {u= 'status': u'paused', u'id': u'job0'}, u'event': u'JOB_STATUS_CHANGE'} -{u'return': [{u'status': u'paused', u'current-progress': 65536, u'total-pr= ogress': 4194304, u'id': u'job0', u'type': u'mirror'}]} -{u'return': {}} -{u'timestamp': {u'seconds': 'SECS', u'microseconds': 'USECS'}, u'data': {u= 'status': u'running', u'id': u'job0'}, u'event': u'JOB_STATUS_CHANGE'} -{u'return': [{u'status': u'running', u'current-progress': 131072, u'total-= progress': 4194304, u'id': u'job0', u'type': u'mirror'}]} +{"return": {}} +{"data": {"id": "job0", "status": "paused"}, "event": "JOB_STATUS_CHANGE",= "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"return": [{"current-progress": 65536, "id": "job0", "status": "paused", = "total-progress": 4194304, "type": "mirror"}]} +{"return": {}} +{"data": {"id": "job0", "status": "running"}, "event": "JOB_STATUS_CHANGE"= , "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"return": [{"current-progress": 131072, "id": "job0", "status": "running"= , "total-progress": 4194304, "type": "mirror"}]} =3D=3D=3D Testing block-job-pause/job-resume =3D=3D=3D -{u'return': {}} -{u'timestamp': {u'seconds': 'SECS', u'microseconds': 'USECS'}, u'data': {u= 'status': u'paused', u'id': u'job0'}, u'event': u'JOB_STATUS_CHANGE'} -{u'return': [{u'status': u'paused', u'current-progress': 131072, u'total-p= rogress': 4194304, u'id': u'job0', u'type': u'mirror'}]} -{u'return': {}} -{u'timestamp': {u'seconds': 'SECS', u'microseconds': 'USECS'}, u'data': {u= 'status': u'running', u'id': u'job0'}, u'event': u'JOB_STATUS_CHANGE'} -{u'return': [{u'status': u'running', u'current-progress': 196608, u'total-= progress': 4194304, u'id': u'job0', u'type': u'mirror'}]} +{"return": {}} +{"data": {"id": "job0", "status": "paused"}, "event": "JOB_STATUS_CHANGE",= "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"return": [{"current-progress": 131072, "id": "job0", "status": "paused",= "total-progress": 4194304, "type": "mirror"}]} +{"return": {}} +{"data": {"id": "job0", "status": "running"}, "event": "JOB_STATUS_CHANGE"= , "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"return": [{"current-progress": 196608, "id": "job0", "status": "running"= , "total-progress": 4194304, "type": "mirror"}]} =3D=3D=3D Testing job-pause/block-job-resume =3D=3D=3D -{u'return': {}} -{u'timestamp': {u'seconds': 'SECS', u'microseconds': 'USECS'}, u'data': {u= 'status': u'paused', u'id': u'job0'}, u'event': u'JOB_STATUS_CHANGE'} -{u'return': [{u'status': u'paused', u'current-progress': 196608, u'total-p= rogress': 4194304, u'id': u'job0', u'type': u'mirror'}]} -{u'return': {}} -{u'timestamp': {u'seconds': 'SECS', u'microseconds': 'USECS'}, u'data': {u= 'status': u'running', u'id': u'job0'}, u'event': u'JOB_STATUS_CHANGE'} -{u'return': [{u'status': u'running', u'current-progress': 262144, u'total-= progress': 4194304, u'id': u'job0', u'type': u'mirror'}]} +{"return": {}} +{"data": {"id": "job0", "status": "paused"}, "event": "JOB_STATUS_CHANGE",= "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"return": [{"current-progress": 196608, "id": "job0", "status": "paused",= "total-progress": 4194304, "type": "mirror"}]} +{"return": {}} +{"data": {"id": "job0", "status": "running"}, "event": "JOB_STATUS_CHANGE"= , "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"return": [{"current-progress": 262144, "id": "job0", "status": "running"= , "total-progress": 4194304, "type": "mirror"}]} =3D=3D=3D Testing job-pause/job-resume =3D=3D=3D -{u'return': {}} -{u'timestamp': {u'seconds': 'SECS', u'microseconds': 'USECS'}, u'data': {u= 'status': u'paused', u'id': u'job0'}, u'event': u'JOB_STATUS_CHANGE'} -{u'return': [{u'status': u'paused', u'current-progress': 262144, u'total-p= rogress': 4194304, u'id': u'job0', u'type': u'mirror'}]} -{u'return': {}} -{u'timestamp': {u'seconds': 'SECS', u'microseconds': 'USECS'}, u'data': {u= 'status': u'running', u'id': u'job0'}, u'event': u'JOB_STATUS_CHANGE'} -{u'return': [{u'status': u'running', u'current-progress': 327680, u'total-= progress': 4194304, u'id': u'job0', u'type': u'mirror'}]} -{u'error': {u'class': u'GenericError', u'desc': u"Job 'job0' in state 'run= ning' cannot accept command verb 'complete'"}} -{u'error': {u'class': u'GenericError', u'desc': u"Job 'job0' in state 'run= ning' cannot accept command verb 'finalize'"}} -{u'error': {u'class': u'GenericError', u'desc': u"Job 'job0' in state 'run= ning' cannot accept command verb 'dismiss'"}} -{u'error': {u'class': u'GenericError', u'desc': u"Job 'job0' in state 'run= ning' cannot accept command verb 'complete'"}} -{u'error': {u'class': u'GenericError', u'desc': u"Job 'job0' in state 'run= ning' cannot accept command verb 'finalize'"}} -{u'error': {u'class': u'GenericError', u'desc': u"Job 'job0' in state 'run= ning' cannot accept command verb 'dismiss'"}} -{u'return': {}} +{"return": {}} +{"data": {"id": "job0", "status": "paused"}, "event": "JOB_STATUS_CHANGE",= "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"return": [{"current-progress": 262144, "id": "job0", "status": "paused",= "total-progress": 4194304, "type": "mirror"}]} +{"return": {}} +{"data": {"id": "job0", "status": "running"}, "event": "JOB_STATUS_CHANGE"= , "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"return": [{"current-progress": 327680, "id": "job0", "status": "running"= , "total-progress": 4194304, "type": "mirror"}]} +{"error": {"class": "GenericError", "desc": "Job 'job0' in state 'running'= cannot accept command verb 'complete'"}} +{"error": {"class": "GenericError", "desc": "Job 'job0' in state 'running'= cannot accept command verb 'finalize'"}} +{"error": {"class": "GenericError", "desc": "Job 'job0' in state 'running'= cannot accept command verb 'dismiss'"}} +{"error": {"class": "GenericError", "desc": "Job 'job0' in state 'running'= cannot accept command verb 'complete'"}} +{"error": {"class": "GenericError", "desc": "Job 'job0' in state 'running'= cannot accept command verb 'finalize'"}} +{"error": {"class": "GenericError", "desc": "Job 'job0' in state 'running'= cannot accept command verb 'dismiss'"}} +{"return": {}} =20 Waiting for READY state... -{u'timestamp': {u'seconds': 'SECS', u'microseconds': 'USECS'}, u'data': {u= 'status': u'ready', u'id': u'job0'}, u'event': u'JOB_STATUS_CHANGE'} -{u'return': [{u'status': u'ready', u'current-progress': 4194304, u'total-p= rogress': 4194304, u'id': u'job0', u'type': u'mirror'}]} +{"data": {"id": "job0", "status": "ready"}, "event": "JOB_STATUS_CHANGE", = "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"return": [{"current-progress": 4194304, "id": "job0", "status": "ready",= "total-progress": 4194304, "type": "mirror"}]} =20 Pause/resume in READY =3D=3D=3D Testing block-job-pause/block-job-resume =3D=3D=3D -{u'return': {}} -{u'timestamp': {u'seconds': 'SECS', u'microseconds': 'USECS'}, u'data': {u= 'status': u'standby', u'id': u'job0'}, u'event': u'JOB_STATUS_CHANGE'} -{u'return': [{u'status': u'standby', u'current-progress': 4194304, u'total= -progress': 4194304, u'id': u'job0', u'type': u'mirror'}]} -{u'return': {}} -{u'timestamp': {u'seconds': 'SECS', u'microseconds': 'USECS'}, u'data': {u= 'status': u'ready', u'id': u'job0'}, u'event': u'JOB_STATUS_CHANGE'} -{u'return': [{u'status': u'ready', u'current-progress': 4194304, u'total-p= rogress': 4194304, u'id': u'job0', u'type': u'mirror'}]} +{"return": {}} +{"data": {"id": "job0", "status": "standby"}, "event": "JOB_STATUS_CHANGE"= , "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"return": [{"current-progress": 4194304, "id": "job0", "status": "standby= ", "total-progress": 4194304, "type": "mirror"}]} +{"return": {}} +{"data": {"id": "job0", "status": "ready"}, "event": "JOB_STATUS_CHANGE", = "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"return": [{"current-progress": 4194304, "id": "job0", "status": "ready",= "total-progress": 4194304, "type": "mirror"}]} =3D=3D=3D Testing block-job-pause/job-resume =3D=3D=3D -{u'return': {}} -{u'timestamp': {u'seconds': 'SECS', u'microseconds': 'USECS'}, u'data': {u= 'status': u'standby', u'id': u'job0'}, u'event': u'JOB_STATUS_CHANGE'} -{u'return': [{u'status': u'standby', u'current-progress': 4194304, u'total= -progress': 4194304, u'id': u'job0', u'type': u'mirror'}]} -{u'return': {}} -{u'timestamp': {u'seconds': 'SECS', u'microseconds': 'USECS'}, u'data': {u= 'status': u'ready', u'id': u'job0'}, u'event': u'JOB_STATUS_CHANGE'} -{u'return': [{u'status': u'ready', u'current-progress': 4194304, u'total-p= rogress': 4194304, u'id': u'job0', u'type': u'mirror'}]} +{"return": {}} +{"data": {"id": "job0", "status": "standby"}, "event": "JOB_STATUS_CHANGE"= , "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"return": [{"current-progress": 4194304, "id": "job0", "status": "standby= ", "total-progress": 4194304, "type": "mirror"}]} +{"return": {}} +{"data": {"id": "job0", "status": "ready"}, "event": "JOB_STATUS_CHANGE", = "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"return": [{"current-progress": 4194304, "id": "job0", "status": "ready",= "total-progress": 4194304, "type": "mirror"}]} =3D=3D=3D Testing job-pause/block-job-resume =3D=3D=3D -{u'return': {}} -{u'timestamp': {u'seconds': 'SECS', u'microseconds': 'USECS'}, u'data': {u= 'status': u'standby', u'id': u'job0'}, u'event': u'JOB_STATUS_CHANGE'} -{u'return': [{u'status': u'standby', u'current-progress': 4194304, u'total= -progress': 4194304, u'id': u'job0', u'type': u'mirror'}]} -{u'return': {}} -{u'timestamp': {u'seconds': 'SECS', u'microseconds': 'USECS'}, u'data': {u= 'status': u'ready', u'id': u'job0'}, u'event': u'JOB_STATUS_CHANGE'} -{u'return': [{u'status': u'ready', u'current-progress': 4194304, u'total-p= rogress': 4194304, u'id': u'job0', u'type': u'mirror'}]} +{"return": {}} +{"data": {"id": "job0", "status": "standby"}, "event": "JOB_STATUS_CHANGE"= , "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"return": [{"current-progress": 4194304, "id": "job0", "status": "standby= ", "total-progress": 4194304, "type": "mirror"}]} +{"return": {}} +{"data": {"id": "job0", "status": "ready"}, "event": "JOB_STATUS_CHANGE", = "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"return": [{"current-progress": 4194304, "id": "job0", "status": "ready",= "total-progress": 4194304, "type": "mirror"}]} =3D=3D=3D Testing job-pause/job-resume =3D=3D=3D -{u'return': {}} -{u'timestamp': {u'seconds': 'SECS', u'microseconds': 'USECS'}, u'data': {u= 'status': u'standby', u'id': u'job0'}, u'event': u'JOB_STATUS_CHANGE'} -{u'return': [{u'status': u'standby', u'current-progress': 4194304, u'total= -progress': 4194304, u'id': u'job0', u'type': u'mirror'}]} -{u'return': {}} -{u'timestamp': {u'seconds': 'SECS', u'microseconds': 'USECS'}, u'data': {u= 'status': u'ready', u'id': u'job0'}, u'event': u'JOB_STATUS_CHANGE'} -{u'return': [{u'status': u'ready', u'current-progress': 4194304, u'total-p= rogress': 4194304, u'id': u'job0', u'type': u'mirror'}]} -{u'error': {u'class': u'GenericError', u'desc': u"Job 'job0' in state 'rea= dy' cannot accept command verb 'finalize'"}} -{u'error': {u'class': u'GenericError', u'desc': u"Job 'job0' in state 'rea= dy' cannot accept command verb 'dismiss'"}} -{u'error': {u'class': u'GenericError', u'desc': u"Job 'job0' in state 'rea= dy' cannot accept command verb 'finalize'"}} -{u'error': {u'class': u'GenericError', u'desc': u"Job 'job0' in state 'rea= dy' cannot accept command verb 'dismiss'"}} -{u'return': {}} +{"return": {}} +{"data": {"id": "job0", "status": "standby"}, "event": "JOB_STATUS_CHANGE"= , "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"return": [{"current-progress": 4194304, "id": "job0", "status": "standby= ", "total-progress": 4194304, "type": "mirror"}]} +{"return": {}} +{"data": {"id": "job0", "status": "ready"}, "event": "JOB_STATUS_CHANGE", = "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"return": [{"current-progress": 4194304, "id": "job0", "status": "ready",= "total-progress": 4194304, "type": "mirror"}]} +{"error": {"class": "GenericError", "desc": "Job 'job0' in state 'ready' c= annot accept command verb 'finalize'"}} +{"error": {"class": "GenericError", "desc": "Job 'job0' in state 'ready' c= annot accept command verb 'dismiss'"}} +{"error": {"class": "GenericError", "desc": "Job 'job0' in state 'ready' c= annot accept command verb 'finalize'"}} +{"error": {"class": "GenericError", "desc": "Job 'job0' in state 'ready' c= annot accept command verb 'dismiss'"}} +{"return": {}} =20 Waiting for PENDING state... -{u'timestamp': {u'seconds': 'SECS', u'microseconds': 'USECS'}, u'data': {u= 'status': u'waiting', u'id': u'job0'}, u'event': u'JOB_STATUS_CHANGE'} -{u'timestamp': {u'seconds': 'SECS', u'microseconds': 'USECS'}, u'data': {u= 'status': u'pending', u'id': u'job0'}, u'event': u'JOB_STATUS_CHANGE'} -{u'timestamp': {u'seconds': 'SECS', u'microseconds': 'USECS'}, u'data': {u= 'status': u'concluded', u'id': u'job0'}, u'event': u'JOB_STATUS_CHANGE'} -{u'timestamp': {u'seconds': 'SECS', u'microseconds': 'USECS'}, u'data': {u= 'status': u'null', u'id': u'job0'}, u'event': u'JOB_STATUS_CHANGE'} -{u'return': []} +{"data": {"id": "job0", "status": "waiting"}, "event": "JOB_STATUS_CHANGE"= , "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"id": "job0", "status": "pending"}, "event": "JOB_STATUS_CHANGE"= , "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"id": "job0", "status": "concluded"}, "event": "JOB_STATUS_CHANG= E", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"id": "job0", "status": "null"}, "event": "JOB_STATUS_CHANGE", "= timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"return": []} =20 =20 Starting block job: drive-backup (auto-finalize: True; auto-dismiss: True) -{u'return': {}} -{u'return': [{u'status': u'running', u'current-progress': 'FILTERED', u'to= tal-progress': 'FILTERED', u'id': u'job0', u'type': u'backup'}]} -{u'timestamp': {u'seconds': 'SECS', u'microseconds': 'USECS'}, u'data': {u= 'status': u'created', u'id': u'job0'}, u'event': u'JOB_STATUS_CHANGE'} -{u'timestamp': {u'seconds': 'SECS', u'microseconds': 'USECS'}, u'data': {u= 'status': u'running', u'id': u'job0'}, u'event': u'JOB_STATUS_CHANGE'} +{"return": {}} +{"return": [{"current-progress": "FILTERED", "id": "job0", "status": "runn= ing", "total-progress": "FILTERED", "type": "backup"}]} +{"data": {"id": "job0", "status": "created"}, "event": "JOB_STATUS_CHANGE"= , "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"id": "job0", "status": "running"}, "event": "JOB_STATUS_CHANGE"= , "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} =20 Pause/resume in RUNNING =3D=3D=3D Testing block-job-pause/block-job-resume =3D=3D=3D -{u'return': {}} -{u'timestamp': {u'seconds': 'SECS', u'microseconds': 'USECS'}, u'data': {u= 'status': u'paused', u'id': u'job0'}, u'event': u'JOB_STATUS_CHANGE'} -{u'return': [{u'status': u'paused', u'current-progress': 65536, u'total-pr= ogress': 4194304, u'id': u'job0', u'type': u'backup'}]} -{u'return': {}} -{u'timestamp': {u'seconds': 'SECS', u'microseconds': 'USECS'}, u'data': {u= 'status': u'running', u'id': u'job0'}, u'event': u'JOB_STATUS_CHANGE'} -{u'return': [{u'status': u'running', u'current-progress': 131072, u'total-= progress': 4194304, u'id': u'job0', u'type': u'backup'}]} +{"return": {}} +{"data": {"id": "job0", "status": "paused"}, "event": "JOB_STATUS_CHANGE",= "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"return": [{"current-progress": 65536, "id": "job0", "status": "paused", = "total-progress": 4194304, "type": "backup"}]} +{"return": {}} +{"data": {"id": "job0", "status": "running"}, "event": "JOB_STATUS_CHANGE"= , "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"return": [{"current-progress": 131072, "id": "job0", "status": "running"= , "total-progress": 4194304, "type": "backup"}]} =3D=3D=3D Testing block-job-pause/job-resume =3D=3D=3D -{u'return': {}} -{u'timestamp': {u'seconds': 'SECS', u'microseconds': 'USECS'}, u'data': {u= 'status': u'paused', u'id': u'job0'}, u'event': u'JOB_STATUS_CHANGE'} -{u'return': [{u'status': u'paused', u'current-progress': 131072, u'total-p= rogress': 4194304, u'id': u'job0', u'type': u'backup'}]} -{u'return': {}} -{u'timestamp': {u'seconds': 'SECS', u'microseconds': 'USECS'}, u'data': {u= 'status': u'running', u'id': u'job0'}, u'event': u'JOB_STATUS_CHANGE'} -{u'return': [{u'status': u'running', u'current-progress': 196608, u'total-= progress': 4194304, u'id': u'job0', u'type': u'backup'}]} +{"return": {}} +{"data": {"id": "job0", "status": "paused"}, "event": "JOB_STATUS_CHANGE",= "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"return": [{"current-progress": 131072, "id": "job0", "status": "paused",= "total-progress": 4194304, "type": "backup"}]} +{"return": {}} +{"data": {"id": "job0", "status": "running"}, "event": "JOB_STATUS_CHANGE"= , "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"return": [{"current-progress": 196608, "id": "job0", "status": "running"= , "total-progress": 4194304, "type": "backup"}]} =3D=3D=3D Testing job-pause/block-job-resume =3D=3D=3D -{u'return': {}} -{u'timestamp': {u'seconds': 'SECS', u'microseconds': 'USECS'}, u'data': {u= 'status': u'paused', u'id': u'job0'}, u'event': u'JOB_STATUS_CHANGE'} -{u'return': [{u'status': u'paused', u'current-progress': 196608, u'total-p= rogress': 4194304, u'id': u'job0', u'type': u'backup'}]} -{u'return': {}} -{u'timestamp': {u'seconds': 'SECS', u'microseconds': 'USECS'}, u'data': {u= 'status': u'running', u'id': u'job0'}, u'event': u'JOB_STATUS_CHANGE'} -{u'return': [{u'status': u'running', u'current-progress': 262144, u'total-= progress': 4194304, u'id': u'job0', u'type': u'backup'}]} +{"return": {}} +{"data": {"id": "job0", "status": "paused"}, "event": "JOB_STATUS_CHANGE",= "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"return": [{"current-progress": 196608, "id": "job0", "status": "paused",= "total-progress": 4194304, "type": "backup"}]} +{"return": {}} +{"data": {"id": "job0", "status": "running"}, "event": "JOB_STATUS_CHANGE"= , "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"return": [{"current-progress": 262144, "id": "job0", "status": "running"= , "total-progress": 4194304, "type": "backup"}]} =3D=3D=3D Testing job-pause/job-resume =3D=3D=3D -{u'return': {}} -{u'timestamp': {u'seconds': 'SECS', u'microseconds': 'USECS'}, u'data': {u= 'status': u'paused', u'id': u'job0'}, u'event': u'JOB_STATUS_CHANGE'} -{u'return': [{u'status': u'paused', u'current-progress': 262144, u'total-p= rogress': 4194304, u'id': u'job0', u'type': u'backup'}]} -{u'return': {}} -{u'timestamp': {u'seconds': 'SECS', u'microseconds': 'USECS'}, u'data': {u= 'status': u'running', u'id': u'job0'}, u'event': u'JOB_STATUS_CHANGE'} -{u'return': [{u'status': u'running', u'current-progress': 327680, u'total-= progress': 4194304, u'id': u'job0', u'type': u'backup'}]} -{u'error': {u'class': u'GenericError', u'desc': u"Job 'job0' in state 'run= ning' cannot accept command verb 'complete'"}} -{u'error': {u'class': u'GenericError', u'desc': u"Job 'job0' in state 'run= ning' cannot accept command verb 'finalize'"}} -{u'error': {u'class': u'GenericError', u'desc': u"Job 'job0' in state 'run= ning' cannot accept command verb 'dismiss'"}} -{u'error': {u'class': u'GenericError', u'desc': u"Job 'job0' in state 'run= ning' cannot accept command verb 'complete'"}} -{u'error': {u'class': u'GenericError', u'desc': u"Job 'job0' in state 'run= ning' cannot accept command verb 'finalize'"}} -{u'error': {u'class': u'GenericError', u'desc': u"Job 'job0' in state 'run= ning' cannot accept command verb 'dismiss'"}} -{u'return': {}} +{"return": {}} +{"data": {"id": "job0", "status": "paused"}, "event": "JOB_STATUS_CHANGE",= "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"return": [{"current-progress": 262144, "id": "job0", "status": "paused",= "total-progress": 4194304, "type": "backup"}]} +{"return": {}} +{"data": {"id": "job0", "status": "running"}, "event": "JOB_STATUS_CHANGE"= , "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"return": [{"current-progress": 327680, "id": "job0", "status": "running"= , "total-progress": 4194304, "type": "backup"}]} +{"error": {"class": "GenericError", "desc": "Job 'job0' in state 'running'= cannot accept command verb 'complete'"}} +{"error": {"class": "GenericError", "desc": "Job 'job0' in state 'running'= cannot accept command verb 'finalize'"}} +{"error": {"class": "GenericError", "desc": "Job 'job0' in state 'running'= cannot accept command verb 'dismiss'"}} +{"error": {"class": "GenericError", "desc": "Job 'job0' in state 'running'= cannot accept command verb 'complete'"}} +{"error": {"class": "GenericError", "desc": "Job 'job0' in state 'running'= cannot accept command verb 'finalize'"}} +{"error": {"class": "GenericError", "desc": "Job 'job0' in state 'running'= cannot accept command verb 'dismiss'"}} +{"return": {}} =20 Waiting for PENDING state... -{u'timestamp': {u'seconds': 'SECS', u'microseconds': 'USECS'}, u'data': {u= 'status': u'waiting', u'id': u'job0'}, u'event': u'JOB_STATUS_CHANGE'} -{u'timestamp': {u'seconds': 'SECS', u'microseconds': 'USECS'}, u'data': {u= 'status': u'pending', u'id': u'job0'}, u'event': u'JOB_STATUS_CHANGE'} -{u'timestamp': {u'seconds': 'SECS', u'microseconds': 'USECS'}, u'data': {u= 'status': u'concluded', u'id': u'job0'}, u'event': u'JOB_STATUS_CHANGE'} -{u'timestamp': {u'seconds': 'SECS', u'microseconds': 'USECS'}, u'data': {u= 'status': u'null', u'id': u'job0'}, u'event': u'JOB_STATUS_CHANGE'} -{u'return': []} +{"data": {"id": "job0", "status": "waiting"}, "event": "JOB_STATUS_CHANGE"= , "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"id": "job0", "status": "pending"}, "event": "JOB_STATUS_CHANGE"= , "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"id": "job0", "status": "concluded"}, "event": "JOB_STATUS_CHANG= E", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"id": "job0", "status": "null"}, "event": "JOB_STATUS_CHANGE", "= timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"return": []} =20 =20 Starting block job: drive-backup (auto-finalize: True; auto-dismiss: False) -{u'return': {}} -{u'return': [{u'status': u'running', u'current-progress': 'FILTERED', u'to= tal-progress': 'FILTERED', u'id': u'job0', u'type': u'backup'}]} -{u'timestamp': {u'seconds': 'SECS', u'microseconds': 'USECS'}, u'data': {u= 'status': u'created', u'id': u'job0'}, u'event': u'JOB_STATUS_CHANGE'} -{u'timestamp': {u'seconds': 'SECS', u'microseconds': 'USECS'}, u'data': {u= 'status': u'running', u'id': u'job0'}, u'event': u'JOB_STATUS_CHANGE'} +{"return": {}} +{"return": [{"current-progress": "FILTERED", "id": "job0", "status": "runn= ing", "total-progress": "FILTERED", "type": "backup"}]} +{"data": {"id": "job0", "status": "created"}, "event": "JOB_STATUS_CHANGE"= , "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"id": "job0", "status": "running"}, "event": "JOB_STATUS_CHANGE"= , "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} =20 Pause/resume in RUNNING =3D=3D=3D Testing block-job-pause/block-job-resume =3D=3D=3D -{u'return': {}} -{u'timestamp': {u'seconds': 'SECS', u'microseconds': 'USECS'}, u'data': {u= 'status': u'paused', u'id': u'job0'}, u'event': u'JOB_STATUS_CHANGE'} -{u'return': [{u'status': u'paused', u'current-progress': 65536, u'total-pr= ogress': 4194304, u'id': u'job0', u'type': u'backup'}]} -{u'return': {}} -{u'timestamp': {u'seconds': 'SECS', u'microseconds': 'USECS'}, u'data': {u= 'status': u'running', u'id': u'job0'}, u'event': u'JOB_STATUS_CHANGE'} -{u'return': [{u'status': u'running', u'current-progress': 131072, u'total-= progress': 4194304, u'id': u'job0', u'type': u'backup'}]} +{"return": {}} +{"data": {"id": "job0", "status": "paused"}, "event": "JOB_STATUS_CHANGE",= "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"return": [{"current-progress": 65536, "id": "job0", "status": "paused", = "total-progress": 4194304, "type": "backup"}]} +{"return": {}} +{"data": {"id": "job0", "status": "running"}, "event": "JOB_STATUS_CHANGE"= , "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"return": [{"current-progress": 131072, "id": "job0", "status": "running"= , "total-progress": 4194304, "type": "backup"}]} =3D=3D=3D Testing block-job-pause/job-resume =3D=3D=3D -{u'return': {}} -{u'timestamp': {u'seconds': 'SECS', u'microseconds': 'USECS'}, u'data': {u= 'status': u'paused', u'id': u'job0'}, u'event': u'JOB_STATUS_CHANGE'} -{u'return': [{u'status': u'paused', u'current-progress': 131072, u'total-p= rogress': 4194304, u'id': u'job0', u'type': u'backup'}]} -{u'return': {}} -{u'timestamp': {u'seconds': 'SECS', u'microseconds': 'USECS'}, u'data': {u= 'status': u'running', u'id': u'job0'}, u'event': u'JOB_STATUS_CHANGE'} -{u'return': [{u'status': u'running', u'current-progress': 196608, u'total-= progress': 4194304, u'id': u'job0', u'type': u'backup'}]} +{"return": {}} +{"data": {"id": "job0", "status": "paused"}, "event": "JOB_STATUS_CHANGE",= "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"return": [{"current-progress": 131072, "id": "job0", "status": "paused",= "total-progress": 4194304, "type": "backup"}]} +{"return": {}} +{"data": {"id": "job0", "status": "running"}, "event": "JOB_STATUS_CHANGE"= , "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"return": [{"current-progress": 196608, "id": "job0", "status": "running"= , "total-progress": 4194304, "type": "backup"}]} =3D=3D=3D Testing job-pause/block-job-resume =3D=3D=3D -{u'return': {}} -{u'timestamp': {u'seconds': 'SECS', u'microseconds': 'USECS'}, u'data': {u= 'status': u'paused', u'id': u'job0'}, u'event': u'JOB_STATUS_CHANGE'} -{u'return': [{u'status': u'paused', u'current-progress': 196608, u'total-p= rogress': 4194304, u'id': u'job0', u'type': u'backup'}]} -{u'return': {}} -{u'timestamp': {u'seconds': 'SECS', u'microseconds': 'USECS'}, u'data': {u= 'status': u'running', u'id': u'job0'}, u'event': u'JOB_STATUS_CHANGE'} -{u'return': [{u'status': u'running', u'current-progress': 262144, u'total-= progress': 4194304, u'id': u'job0', u'type': u'backup'}]} +{"return": {}} +{"data": {"id": "job0", "status": "paused"}, "event": "JOB_STATUS_CHANGE",= "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"return": [{"current-progress": 196608, "id": "job0", "status": "paused",= "total-progress": 4194304, "type": "backup"}]} +{"return": {}} +{"data": {"id": "job0", "status": "running"}, "event": "JOB_STATUS_CHANGE"= , "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"return": [{"current-progress": 262144, "id": "job0", "status": "running"= , "total-progress": 4194304, "type": "backup"}]} =3D=3D=3D Testing job-pause/job-resume =3D=3D=3D -{u'return': {}} -{u'timestamp': {u'seconds': 'SECS', u'microseconds': 'USECS'}, u'data': {u= 'status': u'paused', u'id': u'job0'}, u'event': u'JOB_STATUS_CHANGE'} -{u'return': [{u'status': u'paused', u'current-progress': 262144, u'total-p= rogress': 4194304, u'id': u'job0', u'type': u'backup'}]} -{u'return': {}} -{u'timestamp': {u'seconds': 'SECS', u'microseconds': 'USECS'}, u'data': {u= 'status': u'running', u'id': u'job0'}, u'event': u'JOB_STATUS_CHANGE'} -{u'return': [{u'status': u'running', u'current-progress': 327680, u'total-= progress': 4194304, u'id': u'job0', u'type': u'backup'}]} -{u'error': {u'class': u'GenericError', u'desc': u"Job 'job0' in state 'run= ning' cannot accept command verb 'complete'"}} -{u'error': {u'class': u'GenericError', u'desc': u"Job 'job0' in state 'run= ning' cannot accept command verb 'finalize'"}} -{u'error': {u'class': u'GenericError', u'desc': u"Job 'job0' in state 'run= ning' cannot accept command verb 'dismiss'"}} -{u'error': {u'class': u'GenericError', u'desc': u"Job 'job0' in state 'run= ning' cannot accept command verb 'complete'"}} -{u'error': {u'class': u'GenericError', u'desc': u"Job 'job0' in state 'run= ning' cannot accept command verb 'finalize'"}} -{u'error': {u'class': u'GenericError', u'desc': u"Job 'job0' in state 'run= ning' cannot accept command verb 'dismiss'"}} -{u'return': {}} +{"return": {}} +{"data": {"id": "job0", "status": "paused"}, "event": "JOB_STATUS_CHANGE",= "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"return": [{"current-progress": 262144, "id": "job0", "status": "paused",= "total-progress": 4194304, "type": "backup"}]} +{"return": {}} +{"data": {"id": "job0", "status": "running"}, "event": "JOB_STATUS_CHANGE"= , "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"return": [{"current-progress": 327680, "id": "job0", "status": "running"= , "total-progress": 4194304, "type": "backup"}]} +{"error": {"class": "GenericError", "desc": "Job 'job0' in state 'running'= cannot accept command verb 'complete'"}} +{"error": {"class": "GenericError", "desc": "Job 'job0' in state 'running'= cannot accept command verb 'finalize'"}} +{"error": {"class": "GenericError", "desc": "Job 'job0' in state 'running'= cannot accept command verb 'dismiss'"}} +{"error": {"class": "GenericError", "desc": "Job 'job0' in state 'running'= cannot accept command verb 'complete'"}} +{"error": {"class": "GenericError", "desc": "Job 'job0' in state 'running'= cannot accept command verb 'finalize'"}} +{"error": {"class": "GenericError", "desc": "Job 'job0' in state 'running'= cannot accept command verb 'dismiss'"}} +{"return": {}} =20 Waiting for PENDING state... -{u'timestamp': {u'seconds': 'SECS', u'microseconds': 'USECS'}, u'data': {u= 'status': u'waiting', u'id': u'job0'}, u'event': u'JOB_STATUS_CHANGE'} -{u'timestamp': {u'seconds': 'SECS', u'microseconds': 'USECS'}, u'data': {u= 'status': u'pending', u'id': u'job0'}, u'event': u'JOB_STATUS_CHANGE'} -{u'timestamp': {u'seconds': 'SECS', u'microseconds': 'USECS'}, u'data': {u= 'status': u'concluded', u'id': u'job0'}, u'event': u'JOB_STATUS_CHANGE'} -{u'return': [{u'status': u'concluded', u'current-progress': 4194304, u'tot= al-progress': 4194304, u'id': u'job0', u'type': u'backup'}]} -{u'error': {u'class': u'GenericError', u'desc': u"Job 'job0' in state 'con= cluded' cannot accept command verb 'pause'"}} -{u'error': {u'class': u'GenericError', u'desc': u"Job 'job0' in state 'con= cluded' cannot accept command verb 'complete'"}} -{u'error': {u'class': u'GenericError', u'desc': u"Job 'job0' in state 'con= cluded' cannot accept command verb 'finalize'"}} -{u'error': {u'class': u'GenericError', u'desc': u"Job 'job0' in state 'con= cluded' cannot accept command verb 'pause'"}} -{u'error': {u'class': u'GenericError', u'desc': u"Job 'job0' in state 'con= cluded' cannot accept command verb 'complete'"}} -{u'error': {u'class': u'GenericError', u'desc': u"Job 'job0' in state 'con= cluded' cannot accept command verb 'finalize'"}} -{u'return': {}} -{u'timestamp': {u'seconds': 'SECS', u'microseconds': 'USECS'}, u'data': {u= 'status': u'null', u'id': u'job0'}, u'event': u'JOB_STATUS_CHANGE'} -{u'return': []} +{"data": {"id": "job0", "status": "waiting"}, "event": "JOB_STATUS_CHANGE"= , "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"id": "job0", "status": "pending"}, "event": "JOB_STATUS_CHANGE"= , "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"id": "job0", "status": "concluded"}, "event": "JOB_STATUS_CHANG= E", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"return": [{"current-progress": 4194304, "id": "job0", "status": "conclud= ed", "total-progress": 4194304, "type": "backup"}]} +{"error": {"class": "GenericError", "desc": "Job 'job0' in state 'conclude= d' cannot accept command verb 'pause'"}} +{"error": {"class": "GenericError", "desc": "Job 'job0' in state 'conclude= d' cannot accept command verb 'complete'"}} +{"error": {"class": "GenericError", "desc": "Job 'job0' in state 'conclude= d' cannot accept command verb 'finalize'"}} +{"error": {"class": "GenericError", "desc": "Job 'job0' in state 'conclude= d' cannot accept command verb 'pause'"}} +{"error": {"class": "GenericError", "desc": "Job 'job0' in state 'conclude= d' cannot accept command verb 'complete'"}} +{"error": {"class": "GenericError", "desc": "Job 'job0' in state 'conclude= d' cannot accept command verb 'finalize'"}} +{"return": {}} +{"data": {"id": "job0", "status": "null"}, "event": "JOB_STATUS_CHANGE", "= timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"return": []} =20 =20 Starting block job: drive-backup (auto-finalize: False; auto-dismiss: True) -{u'return': {}} -{u'return': [{u'status': u'running', u'current-progress': 'FILTERED', u'to= tal-progress': 'FILTERED', u'id': u'job0', u'type': u'backup'}]} -{u'timestamp': {u'seconds': 'SECS', u'microseconds': 'USECS'}, u'data': {u= 'status': u'created', u'id': u'job0'}, u'event': u'JOB_STATUS_CHANGE'} -{u'timestamp': {u'seconds': 'SECS', u'microseconds': 'USECS'}, u'data': {u= 'status': u'running', u'id': u'job0'}, u'event': u'JOB_STATUS_CHANGE'} +{"return": {}} +{"return": [{"current-progress": "FILTERED", "id": "job0", "status": "runn= ing", "total-progress": "FILTERED", "type": "backup"}]} +{"data": {"id": "job0", "status": "created"}, "event": "JOB_STATUS_CHANGE"= , "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"id": "job0", "status": "running"}, "event": "JOB_STATUS_CHANGE"= , "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} =20 Pause/resume in RUNNING =3D=3D=3D Testing block-job-pause/block-job-resume =3D=3D=3D -{u'return': {}} -{u'timestamp': {u'seconds': 'SECS', u'microseconds': 'USECS'}, u'data': {u= 'status': u'paused', u'id': u'job0'}, u'event': u'JOB_STATUS_CHANGE'} -{u'return': [{u'status': u'paused', u'current-progress': 65536, u'total-pr= ogress': 4194304, u'id': u'job0', u'type': u'backup'}]} -{u'return': {}} -{u'timestamp': {u'seconds': 'SECS', u'microseconds': 'USECS'}, u'data': {u= 'status': u'running', u'id': u'job0'}, u'event': u'JOB_STATUS_CHANGE'} -{u'return': [{u'status': u'running', u'current-progress': 131072, u'total-= progress': 4194304, u'id': u'job0', u'type': u'backup'}]} +{"return": {}} +{"data": {"id": "job0", "status": "paused"}, "event": "JOB_STATUS_CHANGE",= "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"return": [{"current-progress": 65536, "id": "job0", "status": "paused", = "total-progress": 4194304, "type": "backup"}]} +{"return": {}} +{"data": {"id": "job0", "status": "running"}, "event": "JOB_STATUS_CHANGE"= , "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"return": [{"current-progress": 131072, "id": "job0", "status": "running"= , "total-progress": 4194304, "type": "backup"}]} =3D=3D=3D Testing block-job-pause/job-resume =3D=3D=3D -{u'return': {}} -{u'timestamp': {u'seconds': 'SECS', u'microseconds': 'USECS'}, u'data': {u= 'status': u'paused', u'id': u'job0'}, u'event': u'JOB_STATUS_CHANGE'} -{u'return': [{u'status': u'paused', u'current-progress': 131072, u'total-p= rogress': 4194304, u'id': u'job0', u'type': u'backup'}]} -{u'return': {}} -{u'timestamp': {u'seconds': 'SECS', u'microseconds': 'USECS'}, u'data': {u= 'status': u'running', u'id': u'job0'}, u'event': u'JOB_STATUS_CHANGE'} -{u'return': [{u'status': u'running', u'current-progress': 196608, u'total-= progress': 4194304, u'id': u'job0', u'type': u'backup'}]} +{"return": {}} +{"data": {"id": "job0", "status": "paused"}, "event": "JOB_STATUS_CHANGE",= "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"return": [{"current-progress": 131072, "id": "job0", "status": "paused",= "total-progress": 4194304, "type": "backup"}]} +{"return": {}} +{"data": {"id": "job0", "status": "running"}, "event": "JOB_STATUS_CHANGE"= , "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"return": [{"current-progress": 196608, "id": "job0", "status": "running"= , "total-progress": 4194304, "type": "backup"}]} =3D=3D=3D Testing job-pause/block-job-resume =3D=3D=3D -{u'return': {}} -{u'timestamp': {u'seconds': 'SECS', u'microseconds': 'USECS'}, u'data': {u= 'status': u'paused', u'id': u'job0'}, u'event': u'JOB_STATUS_CHANGE'} -{u'return': [{u'status': u'paused', u'current-progress': 196608, u'total-p= rogress': 4194304, u'id': u'job0', u'type': u'backup'}]} -{u'return': {}} -{u'timestamp': {u'seconds': 'SECS', u'microseconds': 'USECS'}, u'data': {u= 'status': u'running', u'id': u'job0'}, u'event': u'JOB_STATUS_CHANGE'} -{u'return': [{u'status': u'running', u'current-progress': 262144, u'total-= progress': 4194304, u'id': u'job0', u'type': u'backup'}]} +{"return": {}} +{"data": {"id": "job0", "status": "paused"}, "event": "JOB_STATUS_CHANGE",= "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"return": [{"current-progress": 196608, "id": "job0", "status": "paused",= "total-progress": 4194304, "type": "backup"}]} +{"return": {}} +{"data": {"id": "job0", "status": "running"}, "event": "JOB_STATUS_CHANGE"= , "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"return": [{"current-progress": 262144, "id": "job0", "status": "running"= , "total-progress": 4194304, "type": "backup"}]} =3D=3D=3D Testing job-pause/job-resume =3D=3D=3D -{u'return': {}} -{u'timestamp': {u'seconds': 'SECS', u'microseconds': 'USECS'}, u'data': {u= 'status': u'paused', u'id': u'job0'}, u'event': u'JOB_STATUS_CHANGE'} -{u'return': [{u'status': u'paused', u'current-progress': 262144, u'total-p= rogress': 4194304, u'id': u'job0', u'type': u'backup'}]} -{u'return': {}} -{u'timestamp': {u'seconds': 'SECS', u'microseconds': 'USECS'}, u'data': {u= 'status': u'running', u'id': u'job0'}, u'event': u'JOB_STATUS_CHANGE'} -{u'return': [{u'status': u'running', u'current-progress': 327680, u'total-= progress': 4194304, u'id': u'job0', u'type': u'backup'}]} -{u'error': {u'class': u'GenericError', u'desc': u"Job 'job0' in state 'run= ning' cannot accept command verb 'complete'"}} -{u'error': {u'class': u'GenericError', u'desc': u"Job 'job0' in state 'run= ning' cannot accept command verb 'finalize'"}} -{u'error': {u'class': u'GenericError', u'desc': u"Job 'job0' in state 'run= ning' cannot accept command verb 'dismiss'"}} -{u'error': {u'class': u'GenericError', u'desc': u"Job 'job0' in state 'run= ning' cannot accept command verb 'complete'"}} -{u'error': {u'class': u'GenericError', u'desc': u"Job 'job0' in state 'run= ning' cannot accept command verb 'finalize'"}} -{u'error': {u'class': u'GenericError', u'desc': u"Job 'job0' in state 'run= ning' cannot accept command verb 'dismiss'"}} -{u'return': {}} +{"return": {}} +{"data": {"id": "job0", "status": "paused"}, "event": "JOB_STATUS_CHANGE",= "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"return": [{"current-progress": 262144, "id": "job0", "status": "paused",= "total-progress": 4194304, "type": "backup"}]} +{"return": {}} +{"data": {"id": "job0", "status": "running"}, "event": "JOB_STATUS_CHANGE"= , "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"return": [{"current-progress": 327680, "id": "job0", "status": "running"= , "total-progress": 4194304, "type": "backup"}]} +{"error": {"class": "GenericError", "desc": "Job 'job0' in state 'running'= cannot accept command verb 'complete'"}} +{"error": {"class": "GenericError", "desc": "Job 'job0' in state 'running'= cannot accept command verb 'finalize'"}} +{"error": {"class": "GenericError", "desc": "Job 'job0' in state 'running'= cannot accept command verb 'dismiss'"}} +{"error": {"class": "GenericError", "desc": "Job 'job0' in state 'running'= cannot accept command verb 'complete'"}} +{"error": {"class": "GenericError", "desc": "Job 'job0' in state 'running'= cannot accept command verb 'finalize'"}} +{"error": {"class": "GenericError", "desc": "Job 'job0' in state 'running'= cannot accept command verb 'dismiss'"}} +{"return": {}} =20 Waiting for PENDING state... -{u'timestamp': {u'seconds': 'SECS', u'microseconds': 'USECS'}, u'data': {u= 'status': u'waiting', u'id': u'job0'}, u'event': u'JOB_STATUS_CHANGE'} -{u'timestamp': {u'seconds': 'SECS', u'microseconds': 'USECS'}, u'data': {u= 'status': u'pending', u'id': u'job0'}, u'event': u'JOB_STATUS_CHANGE'} -{u'return': [{u'status': u'pending', u'current-progress': 4194304, u'total= -progress': 4194304, u'id': u'job0', u'type': u'backup'}]} -{u'error': {u'class': u'GenericError', u'desc': u"Job 'job0' in state 'pen= ding' cannot accept command verb 'pause'"}} -{u'error': {u'class': u'GenericError', u'desc': u"Job 'job0' in state 'pen= ding' cannot accept command verb 'complete'"}} -{u'error': {u'class': u'GenericError', u'desc': u"Job 'job0' in state 'pen= ding' cannot accept command verb 'dismiss'"}} -{u'error': {u'class': u'GenericError', u'desc': u"Job 'job0' in state 'pen= ding' cannot accept command verb 'pause'"}} -{u'error': {u'class': u'GenericError', u'desc': u"Job 'job0' in state 'pen= ding' cannot accept command verb 'complete'"}} -{u'error': {u'class': u'GenericError', u'desc': u"Job 'job0' in state 'pen= ding' cannot accept command verb 'dismiss'"}} -{u'return': {}} -{u'timestamp': {u'seconds': 'SECS', u'microseconds': 'USECS'}, u'data': {u= 'status': u'concluded', u'id': u'job0'}, u'event': u'JOB_STATUS_CHANGE'} -{u'timestamp': {u'seconds': 'SECS', u'microseconds': 'USECS'}, u'data': {u= 'status': u'null', u'id': u'job0'}, u'event': u'JOB_STATUS_CHANGE'} -{u'return': []} +{"data": {"id": "job0", "status": "waiting"}, "event": "JOB_STATUS_CHANGE"= , "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"id": "job0", "status": "pending"}, "event": "JOB_STATUS_CHANGE"= , "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"return": [{"current-progress": 4194304, "id": "job0", "status": "pending= ", "total-progress": 4194304, "type": "backup"}]} +{"error": {"class": "GenericError", "desc": "Job 'job0' in state 'pending'= cannot accept command verb 'pause'"}} +{"error": {"class": "GenericError", "desc": "Job 'job0' in state 'pending'= cannot accept command verb 'complete'"}} +{"error": {"class": "GenericError", "desc": "Job 'job0' in state 'pending'= cannot accept command verb 'dismiss'"}} +{"error": {"class": "GenericError", "desc": "Job 'job0' in state 'pending'= cannot accept command verb 'pause'"}} +{"error": {"class": "GenericError", "desc": "Job 'job0' in state 'pending'= cannot accept command verb 'complete'"}} +{"error": {"class": "GenericError", "desc": "Job 'job0' in state 'pending'= cannot accept command verb 'dismiss'"}} +{"return": {}} +{"data": {"id": "job0", "status": "concluded"}, "event": "JOB_STATUS_CHANG= E", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"id": "job0", "status": "null"}, "event": "JOB_STATUS_CHANGE", "= timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"return": []} =20 =20 Starting block job: drive-backup (auto-finalize: False; auto-dismiss: Fals= e) -{u'return': {}} -{u'return': [{u'status': u'running', u'current-progress': 'FILTERED', u'to= tal-progress': 'FILTERED', u'id': u'job0', u'type': u'backup'}]} -{u'timestamp': {u'seconds': 'SECS', u'microseconds': 'USECS'}, u'data': {u= 'status': u'created', u'id': u'job0'}, u'event': u'JOB_STATUS_CHANGE'} -{u'timestamp': {u'seconds': 'SECS', u'microseconds': 'USECS'}, u'data': {u= 'status': u'running', u'id': u'job0'}, u'event': u'JOB_STATUS_CHANGE'} +{"return": {}} +{"return": [{"current-progress": "FILTERED", "id": "job0", "status": "runn= ing", "total-progress": "FILTERED", "type": "backup"}]} +{"data": {"id": "job0", "status": "created"}, "event": "JOB_STATUS_CHANGE"= , "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"id": "job0", "status": "running"}, "event": "JOB_STATUS_CHANGE"= , "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} =20 Pause/resume in RUNNING =3D=3D=3D Testing block-job-pause/block-job-resume =3D=3D=3D -{u'return': {}} -{u'timestamp': {u'seconds': 'SECS', u'microseconds': 'USECS'}, u'data': {u= 'status': u'paused', u'id': u'job0'}, u'event': u'JOB_STATUS_CHANGE'} -{u'return': [{u'status': u'paused', u'current-progress': 65536, u'total-pr= ogress': 4194304, u'id': u'job0', u'type': u'backup'}]} -{u'return': {}} -{u'timestamp': {u'seconds': 'SECS', u'microseconds': 'USECS'}, u'data': {u= 'status': u'running', u'id': u'job0'}, u'event': u'JOB_STATUS_CHANGE'} -{u'return': [{u'status': u'running', u'current-progress': 131072, u'total-= progress': 4194304, u'id': u'job0', u'type': u'backup'}]} +{"return": {}} +{"data": {"id": "job0", "status": "paused"}, "event": "JOB_STATUS_CHANGE",= "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"return": [{"current-progress": 65536, "id": "job0", "status": "paused", = "total-progress": 4194304, "type": "backup"}]} +{"return": {}} +{"data": {"id": "job0", "status": "running"}, "event": "JOB_STATUS_CHANGE"= , "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"return": [{"current-progress": 131072, "id": "job0", "status": "running"= , "total-progress": 4194304, "type": "backup"}]} =3D=3D=3D Testing block-job-pause/job-resume =3D=3D=3D -{u'return': {}} -{u'timestamp': {u'seconds': 'SECS', u'microseconds': 'USECS'}, u'data': {u= 'status': u'paused', u'id': u'job0'}, u'event': u'JOB_STATUS_CHANGE'} -{u'return': [{u'status': u'paused', u'current-progress': 131072, u'total-p= rogress': 4194304, u'id': u'job0', u'type': u'backup'}]} -{u'return': {}} -{u'timestamp': {u'seconds': 'SECS', u'microseconds': 'USECS'}, u'data': {u= 'status': u'running', u'id': u'job0'}, u'event': u'JOB_STATUS_CHANGE'} -{u'return': [{u'status': u'running', u'current-progress': 196608, u'total-= progress': 4194304, u'id': u'job0', u'type': u'backup'}]} +{"return": {}} +{"data": {"id": "job0", "status": "paused"}, "event": "JOB_STATUS_CHANGE",= "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"return": [{"current-progress": 131072, "id": "job0", "status": "paused",= "total-progress": 4194304, "type": "backup"}]} +{"return": {}} +{"data": {"id": "job0", "status": "running"}, "event": "JOB_STATUS_CHANGE"= , "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"return": [{"current-progress": 196608, "id": "job0", "status": "running"= , "total-progress": 4194304, "type": "backup"}]} =3D=3D=3D Testing job-pause/block-job-resume =3D=3D=3D -{u'return': {}} -{u'timestamp': {u'seconds': 'SECS', u'microseconds': 'USECS'}, u'data': {u= 'status': u'paused', u'id': u'job0'}, u'event': u'JOB_STATUS_CHANGE'} -{u'return': [{u'status': u'paused', u'current-progress': 196608, u'total-p= rogress': 4194304, u'id': u'job0', u'type': u'backup'}]} -{u'return': {}} -{u'timestamp': {u'seconds': 'SECS', u'microseconds': 'USECS'}, u'data': {u= 'status': u'running', u'id': u'job0'}, u'event': u'JOB_STATUS_CHANGE'} -{u'return': [{u'status': u'running', u'current-progress': 262144, u'total-= progress': 4194304, u'id': u'job0', u'type': u'backup'}]} +{"return": {}} +{"data": {"id": "job0", "status": "paused"}, "event": "JOB_STATUS_CHANGE",= "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"return": [{"current-progress": 196608, "id": "job0", "status": "paused",= "total-progress": 4194304, "type": "backup"}]} +{"return": {}} +{"data": {"id": "job0", "status": "running"}, "event": "JOB_STATUS_CHANGE"= , "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"return": [{"current-progress": 262144, "id": "job0", "status": "running"= , "total-progress": 4194304, "type": "backup"}]} =3D=3D=3D Testing job-pause/job-resume =3D=3D=3D -{u'return': {}} -{u'timestamp': {u'seconds': 'SECS', u'microseconds': 'USECS'}, u'data': {u= 'status': u'paused', u'id': u'job0'}, u'event': u'JOB_STATUS_CHANGE'} -{u'return': [{u'status': u'paused', u'current-progress': 262144, u'total-p= rogress': 4194304, u'id': u'job0', u'type': u'backup'}]} -{u'return': {}} -{u'timestamp': {u'seconds': 'SECS', u'microseconds': 'USECS'}, u'data': {u= 'status': u'running', u'id': u'job0'}, u'event': u'JOB_STATUS_CHANGE'} -{u'return': [{u'status': u'running', u'current-progress': 327680, u'total-= progress': 4194304, u'id': u'job0', u'type': u'backup'}]} -{u'error': {u'class': u'GenericError', u'desc': u"Job 'job0' in state 'run= ning' cannot accept command verb 'complete'"}} -{u'error': {u'class': u'GenericError', u'desc': u"Job 'job0' in state 'run= ning' cannot accept command verb 'finalize'"}} -{u'error': {u'class': u'GenericError', u'desc': u"Job 'job0' in state 'run= ning' cannot accept command verb 'dismiss'"}} -{u'error': {u'class': u'GenericError', u'desc': u"Job 'job0' in state 'run= ning' cannot accept command verb 'complete'"}} -{u'error': {u'class': u'GenericError', u'desc': u"Job 'job0' in state 'run= ning' cannot accept command verb 'finalize'"}} -{u'error': {u'class': u'GenericError', u'desc': u"Job 'job0' in state 'run= ning' cannot accept command verb 'dismiss'"}} -{u'return': {}} +{"return": {}} +{"data": {"id": "job0", "status": "paused"}, "event": "JOB_STATUS_CHANGE",= "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"return": [{"current-progress": 262144, "id": "job0", "status": "paused",= "total-progress": 4194304, "type": "backup"}]} +{"return": {}} +{"data": {"id": "job0", "status": "running"}, "event": "JOB_STATUS_CHANGE"= , "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"return": [{"current-progress": 327680, "id": "job0", "status": "running"= , "total-progress": 4194304, "type": "backup"}]} +{"error": {"class": "GenericError", "desc": "Job 'job0' in state 'running'= cannot accept command verb 'complete'"}} +{"error": {"class": "GenericError", "desc": "Job 'job0' in state 'running'= cannot accept command verb 'finalize'"}} +{"error": {"class": "GenericError", "desc": "Job 'job0' in state 'running'= cannot accept command verb 'dismiss'"}} +{"error": {"class": "GenericError", "desc": "Job 'job0' in state 'running'= cannot accept command verb 'complete'"}} +{"error": {"class": "GenericError", "desc": "Job 'job0' in state 'running'= cannot accept command verb 'finalize'"}} +{"error": {"class": "GenericError", "desc": "Job 'job0' in state 'running'= cannot accept command verb 'dismiss'"}} +{"return": {}} =20 Waiting for PENDING state... -{u'timestamp': {u'seconds': 'SECS', u'microseconds': 'USECS'}, u'data': {u= 'status': u'waiting', u'id': u'job0'}, u'event': u'JOB_STATUS_CHANGE'} -{u'timestamp': {u'seconds': 'SECS', u'microseconds': 'USECS'}, u'data': {u= 'status': u'pending', u'id': u'job0'}, u'event': u'JOB_STATUS_CHANGE'} -{u'return': [{u'status': u'pending', u'current-progress': 4194304, u'total= -progress': 4194304, u'id': u'job0', u'type': u'backup'}]} -{u'error': {u'class': u'GenericError', u'desc': u"Job 'job0' in state 'pen= ding' cannot accept command verb 'pause'"}} -{u'error': {u'class': u'GenericError', u'desc': u"Job 'job0' in state 'pen= ding' cannot accept command verb 'complete'"}} -{u'error': {u'class': u'GenericError', u'desc': u"Job 'job0' in state 'pen= ding' cannot accept command verb 'dismiss'"}} -{u'error': {u'class': u'GenericError', u'desc': u"Job 'job0' in state 'pen= ding' cannot accept command verb 'pause'"}} -{u'error': {u'class': u'GenericError', u'desc': u"Job 'job0' in state 'pen= ding' cannot accept command verb 'complete'"}} -{u'error': {u'class': u'GenericError', u'desc': u"Job 'job0' in state 'pen= ding' cannot accept command verb 'dismiss'"}} -{u'return': {}} -{u'timestamp': {u'seconds': 'SECS', u'microseconds': 'USECS'}, u'data': {u= 'status': u'concluded', u'id': u'job0'}, u'event': u'JOB_STATUS_CHANGE'} -{u'return': [{u'status': u'concluded', u'current-progress': 4194304, u'tot= al-progress': 4194304, u'id': u'job0', u'type': u'backup'}]} -{u'error': {u'class': u'GenericError', u'desc': u"Job 'job0' in state 'con= cluded' cannot accept command verb 'pause'"}} -{u'error': {u'class': u'GenericError', u'desc': u"Job 'job0' in state 'con= cluded' cannot accept command verb 'complete'"}} -{u'error': {u'class': u'GenericError', u'desc': u"Job 'job0' in state 'con= cluded' cannot accept command verb 'finalize'"}} -{u'error': {u'class': u'GenericError', u'desc': u"Job 'job0' in state 'con= cluded' cannot accept command verb 'pause'"}} -{u'error': {u'class': u'GenericError', u'desc': u"Job 'job0' in state 'con= cluded' cannot accept command verb 'complete'"}} -{u'error': {u'class': u'GenericError', u'desc': u"Job 'job0' in state 'con= cluded' cannot accept command verb 'finalize'"}} -{u'return': {}} -{u'timestamp': {u'seconds': 'SECS', u'microseconds': 'USECS'}, u'data': {u= 'status': u'null', u'id': u'job0'}, u'event': u'JOB_STATUS_CHANGE'} -{u'return': []} +{"data": {"id": "job0", "status": "waiting"}, "event": "JOB_STATUS_CHANGE"= , "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"data": {"id": "job0", "status": "pending"}, "event": "JOB_STATUS_CHANGE"= , "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"return": [{"current-progress": 4194304, "id": "job0", "status": "pending= ", "total-progress": 4194304, "type": "backup"}]} +{"error": {"class": "GenericError", "desc": "Job 'job0' in state 'pending'= cannot accept command verb 'pause'"}} +{"error": {"class": "GenericError", "desc": "Job 'job0' in state 'pending'= cannot accept command verb 'complete'"}} +{"error": {"class": "GenericError", "desc": "Job 'job0' in state 'pending'= cannot accept command verb 'dismiss'"}} +{"error": {"class": "GenericError", "desc": "Job 'job0' in state 'pending'= cannot accept command verb 'pause'"}} +{"error": {"class": "GenericError", "desc": "Job 'job0' in state 'pending'= cannot accept command verb 'complete'"}} +{"error": {"class": "GenericError", "desc": "Job 'job0' in state 'pending'= cannot accept command verb 'dismiss'"}} +{"return": {}} +{"data": {"id": "job0", "status": "concluded"}, "event": "JOB_STATUS_CHANG= E", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"return": [{"current-progress": 4194304, "id": "job0", "status": "conclud= ed", "total-progress": 4194304, "type": "backup"}]} +{"error": {"class": "GenericError", "desc": "Job 'job0' in state 'conclude= d' cannot accept command verb 'pause'"}} +{"error": {"class": "GenericError", "desc": "Job 'job0' in state 'conclude= d' cannot accept command verb 'complete'"}} +{"error": {"class": "GenericError", "desc": "Job 'job0' in state 'conclude= d' cannot accept command verb 'finalize'"}} +{"error": {"class": "GenericError", "desc": "Job 'job0' in state 'conclude= d' cannot accept command verb 'pause'"}} +{"error": {"class": "GenericError", "desc": "Job 'job0' in state 'conclude= d' cannot accept command verb 'complete'"}} +{"error": {"class": "GenericError", "desc": "Job 'job0' in state 'conclude= d' cannot accept command verb 'finalize'"}} +{"return": {}} +{"data": {"id": "job0", "status": "null"}, "event": "JOB_STATUS_CHANGE", "= timestamp": {"microseconds": "USECS", "seconds": "SECS"}} +{"return": []} diff --git a/tests/qemu-iotests/222.out b/tests/qemu-iotests/222.out index 48f336a02b..16643dde30 100644 --- a/tests/qemu-iotests/222.out +++ b/tests/qemu-iotests/222.out @@ -8,13 +8,13 @@ Done =20 --- Setting up Fleecing Graph --- =20 -{u'return': {}} -{u'return': {}} +{"return": {}} +{"return": {}} =20 --- Setting up NBD Export --- =20 -{u'return': {}} -{u'return': {}} +{"return": {}} +{"return": {}} =20 --- Sanity Check --- =20 @@ -29,13 +29,13 @@ read -P0 0x3fe0000 64k --- Testing COW --- =20 write -P0xab 0 64k -{u'return': u''} +{"return": ""} write -P0xad 0x00f8000 64k -{u'return': u''} +{"return": ""} write -P0x1d 0x2008000 64k -{u'return': u''} +{"return": ""} write -P0xea 0x3fe0000 64k -{u'return': u''} +{"return": ""} =20 --- Verifying Data --- =20 @@ -49,10 +49,10 @@ read -P0 0x3fe0000 64k =20 --- Cleanup --- =20 -{u'return': {}} -{u'timestamp': {u'seconds': 'SECS', u'microseconds': 'USECS'}, u'data': {u= 'device': u'drive0', u'type': u'backup', u'speed': 0, u'len': 67108864, u'o= ffset': 393216}, u'event': u'BLOCK_JOB_CANCELLED'} -{u'return': {}} -{u'return': {}} +{"return": {}} +{"data": {"device": "drive0", "len": 67108864, "offset": 393216, "speed": = 0, "type": "backup"}, "event": "BLOCK_JOB_CANCELLED", "timestamp": {"micros= econds": "USECS", "seconds": "SECS"}} +{"return": {}} +{"return": {}} =20 --- Confirming writes --- =20 diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index ed91095505..134e12f834 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -254,7 +254,10 @@ def filter_img_info(output, filename): def log(msg, filters=3D[]): for flt in filters: msg =3D flt(msg) - print(msg) + if type(msg) is dict or type(msg) is list: + print(json.dumps(msg, sort_keys=3DTrue)) + else: + print(msg) =20 class Timeout: def __init__(self, seconds, errmsg =3D "Timeout"): @@ -442,10 +445,11 @@ class VM(qtest.QEMUQtestMachine): return result =20 def qmp_log(self, cmd, filters=3D[filter_testfiles], **kwargs): - logmsg =3D "{'execute': '%s', 'arguments': %s}" % (cmd, kwargs) + logmsg =3D '{"execute": "%s", "arguments": %s}' % \ + (cmd, json.dumps(kwargs, sort_keys=3DTrue)) log(logmsg, filters) result =3D self.qmp(cmd, **kwargs) - log(str(result), filters) + log(json.dumps(result, sort_keys=3DTrue), filters) return result =20 def run_job(self, job, auto_finalize=3DTrue, auto_dismiss=3DFalse): --=20 2.17.1