From nobody Thu May 2 21:57:29 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; dkim=fail; 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 Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1513705033707704.3807188316057; Tue, 19 Dec 2017 09:37:13 -0800 (PST) Received: from localhost ([::1]:56343 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRLp8-0002P7-Ie for importer@patchew.org; Tue, 19 Dec 2017 12:37:02 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60062) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRLn6-00018m-Pm for qemu-devel@nongnu.org; Tue, 19 Dec 2017 12:34:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eRLn5-0000RO-Tp for qemu-devel@nongnu.org; Tue, 19 Dec 2017 12:34:56 -0500 Received: from mail-qk0-x242.google.com ([2607:f8b0:400d:c09::242]:35697) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eRLn5-0000R3-Pq for qemu-devel@nongnu.org; Tue, 19 Dec 2017 12:34:55 -0500 Received: by mail-qk0-x242.google.com with SMTP id 143so8759363qki.2 for ; Tue, 19 Dec 2017 09:34:55 -0800 (PST) Received: from x1.local ([138.117.48.211]) by smtp.gmail.com with ESMTPSA id z17sm9295525qti.59.2017.12.19.09.34.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Dec 2017 09:34:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=XWOpif8kcnFhkSX98v7zRorxd3crdZsLJxaNA4v8X2c=; b=E76iYD2yhIVh9OLTers0eylq6OY6e1Vyv46z5VKxzzixaKeRHMxtGh96bb2nK4N85o FOvuPJW3fZunmjYokH0yYEV+cahCM6adqBBTsVtkQrFiBjwcqVnfDWDny4FYSj8y7w8Q HX3Z3FPSstlP+2AyYyrT1i0OUXJbTc0a+QXPcYpyUkmuiS4az8BBDbkTjAscqzyJEra/ Hb482SW2tC+0fh5qTQUIBq2gy2kGz0PuoB0BPS2s0OYdqknPwqNSRLyNCZ6rniZ9S3Oz afjrx8dLlPv69GQTja/1fr4hiwVDUyhpwlTezIdeGbgQDFg0SebvVOCw6/s36Tz9TluT uEnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=XWOpif8kcnFhkSX98v7zRorxd3crdZsLJxaNA4v8X2c=; b=sTkeGQv+X0/NK7atbo4AbxWsb3Fq4t9ssIWjWARfztX+0M7QjFTWygFKMkQ9tSr5x5 jEIXHo3RBxsZmx4oV+cUZpwGXBoW95CRC1JA1OcyJQz9f/DizWYpler9hwTyWk6uCpPU g2PcG9+8rKvUyAjG8zsU9NUNjSO86tOy+fxVLEt76CFMwXy7muLdgWldJQIbO9inMXqY mB2jko8sO3ckCvBjLi6gT/QY+nn9EBKKGFg3fQLy8LjSWNwffw9OwZycw8uOvmUslcDc tUqrAnt9d7QOKt2oRVyO8sHS93yVtHJF7aXBQHy0SYa9qSi1S6VkUOqSUid6XY0aS8Td 6t2A== X-Gm-Message-State: AKGB3mKA3XvplgcxUxiEC+gZ40Fi106rIhFU2gMJLs5H2jEGBYWfuIld Bz4IiepSjq7eFN0v1+1xmZ0= X-Google-Smtp-Source: ACJfBotmYhsvdMmtRkA3cPoxvmVO9aQNPfkIEpZ8fVw2xUGUTBc/10DEA1BvayzHdF9CBhLa39rDtQ== X-Received: by 10.55.11.12 with SMTP id 12mr596031qkl.286.1513704895197; Tue, 19 Dec 2017 09:34:55 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Cleber Rosa , Eduardo Habkost , =?UTF-8?q?Luk=C3=A1=C5=A1=20Doktor?= , "Daniel P . Berrange" , Eric Blake , Stefan Hajnoczi , Fam Zheng , Markus Armbruster Date: Tue, 19 Dec 2017 14:34:17 -0300 Message-Id: <20171219173425.8113-2-f4bug@amsat.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20171219173425.8113-1-f4bug@amsat.org> References: <20171219173425.8113-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::242 Subject: [Qemu-devel] [PATCH 1/9] qemu.py: replace iteritems() by items() for python3 compatibility 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: Janosch Frank , Nir Soffer , Ishani Chugh , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org, Paolo Bonzini Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Daniel P. Berrange --- scripts/qemu.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/qemu.py b/scripts/qemu.py index 9bfdf6d37d..5e12ac7c8c 100644 --- a/scripts/qemu.py +++ b/scripts/qemu.py @@ -247,7 +247,7 @@ class QEMUMachine(object): def qmp(self, cmd, conv_keys=3DTrue, **args): '''Invoke a QMP command and return the response dict''' qmp_args =3D dict() - for key, value in args.iteritems(): + for key, value in args.items(): if conv_keys: qmp_args[key.replace('_', '-')] =3D value else: --=20 2.15.1 From nobody Thu May 2 21:57:29 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; dkim=fail; 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 Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1513705050482701.7479019744243; Tue, 19 Dec 2017 09:37:30 -0800 (PST) Received: from localhost ([::1]:56344 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRLpM-0002b8-6O for importer@patchew.org; Tue, 19 Dec 2017 12:37:16 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60177) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRLnJ-0001HH-73 for qemu-devel@nongnu.org; Tue, 19 Dec 2017 12:35:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eRLnE-0000Vr-Gl for qemu-devel@nongnu.org; Tue, 19 Dec 2017 12:35:09 -0500 Received: from mail-qk0-x241.google.com ([2607:f8b0:400d:c09::241]:33717) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eRLnE-0000Vc-Ck for qemu-devel@nongnu.org; Tue, 19 Dec 2017 12:35:04 -0500 Received: by mail-qk0-x241.google.com with SMTP id x7so6079451qkb.0 for ; Tue, 19 Dec 2017 09:35:04 -0800 (PST) Received: from x1.local ([138.117.48.211]) by smtp.gmail.com with ESMTPSA id z17sm9295525qti.59.2017.12.19.09.34.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Dec 2017 09:35:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=M7hjtABggCQ4QkSM+7PuwuAVd6ke+nYRWe8hmrCmUlw=; b=UOREV5jH7f3KLLF/S+6OOU5D8RoqgutxecGP11IuwtAE8j4k/aJDguTy/6n2rTJ1An 6vK8BogQbrPPS+47lXGig9AwqXYtudyCiEgU6xjNaEp3sPS8nMg+fxt0IBN8FlAbuCal UPT6AOKhSCVg+YL9hnnP6GaI9WRcX1y9Fn6wldwfZ/xfkYKLyii+Zk61otEwrQ4kQLV5 dbIMs+c3C4HYcPJlo4VbrMzjedlYXzf+gN8cLUHXXSl+FYt6T5TZJ9avHNkpnpv57pK4 sUukJ+nw5bDlbvOIxHXoEtoxy8T+n8A7WJAS1/zCMjZNdfrjKbrwxRp+izMcIYuAeBby RR9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=M7hjtABggCQ4QkSM+7PuwuAVd6ke+nYRWe8hmrCmUlw=; b=VNxoptOfPMW2UFLNEj9IW+383ZpZk6AHO2hdXi859vgkFGtg9DQdb/gj0RIQ6ephYL mOCE9K0settz/x10WfikxvtuxQbsU4Xzs2SX7JWpaLa4oH57pVhmHHcx0ma4FSmh24KM woZIvhO+tuR5Ei7UaYp7iRLTV4U6MuNyjKY4H2fyEojjDO2zI28S9TN5skY2baI7kZem 36+y3qJNveWzT83N6V6obS80AdEKt6I72kqVRS9AXj0uHOhm+DqjcU/4H5gM7aoYHWnN LsSVy8NESxqweCm0nrJ0DMk7hh8YPGViROpt1GHLcnpdU48JNWpMCPVZv2cvWtsKeLoQ pWCg== X-Gm-Message-State: AKGB3mLKAL19SeVJmmThBSx2jSyWgtII6xcVYdUd/dcQivIggmHTRuO7 4gc7/OqZj15NAuT4fhVc+etDIU1FkX8= X-Google-Smtp-Source: ACJfBov/aMdduSNQtQLW7cicjPhSaa9wl3ynR7brZYB+ocuC15yktdmNbeGWEKKGe87XnUgbHDvmvw== X-Received: by 10.55.166.207 with SMTP id p198mr6166860qke.302.1513704903888; Tue, 19 Dec 2017 09:35:03 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Cleber Rosa , Eduardo Habkost , =?UTF-8?q?Luk=C3=A1=C5=A1=20Doktor?= , "Daniel P . Berrange" , Eric Blake , Stefan Hajnoczi , Fam Zheng , Markus Armbruster Date: Tue, 19 Dec 2017 14:34:18 -0300 Message-Id: <20171219173425.8113-3-f4bug@amsat.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20171219173425.8113-1-f4bug@amsat.org> References: <20171219173425.8113-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::241 Subject: [Qemu-devel] [PATCH 2/9] qmp.py: encode JSON unicode as byte strings for python3 compatibility 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: Janosch Frank , Nir Soffer , Ishani Chugh , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org, Paolo Bonzini Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 the socket API expects byte strings. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Daniel P. Berrange --- scripts/qmp/qmp.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/qmp/qmp.py b/scripts/qmp/qmp.py index 07c9632e9e..1080195e04 100644 --- a/scripts/qmp/qmp.py +++ b/scripts/qmp/qmp.py @@ -166,7 +166,7 @@ class QEMUMonitorProtocol(object): """ self.logger.debug(">>> %s", qmp_cmd) try: - self.__sock.sendall(json.dumps(qmp_cmd)) + self.__sock.sendall(json.dumps(qmp_cmd).encode()) except socket.error as err: if err[0] =3D=3D errno.EPIPE: return --=20 2.15.1 From nobody Thu May 2 21:57:29 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; dkim=fail; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 151370504723819.221164633931494; Tue, 19 Dec 2017 09:37:27 -0800 (PST) Received: from localhost ([::1]:56346 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRLpV-0002kq-6T for importer@patchew.org; Tue, 19 Dec 2017 12:37:25 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60265) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRLnQ-0001Oi-4Z for qemu-devel@nongnu.org; Tue, 19 Dec 2017 12:35:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eRLnO-0000b4-Oi for qemu-devel@nongnu.org; Tue, 19 Dec 2017 12:35:16 -0500 Received: from mail-qt0-x244.google.com ([2607:f8b0:400d:c0d::244]:46860) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eRLnO-0000ao-9o; Tue, 19 Dec 2017 12:35:14 -0500 Received: by mail-qt0-x244.google.com with SMTP id r39so25075189qtr.13; Tue, 19 Dec 2017 09:35:14 -0800 (PST) Received: from x1.local ([138.117.48.211]) by smtp.gmail.com with ESMTPSA id z17sm9295525qti.59.2017.12.19.09.35.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Dec 2017 09:35:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=aX3uwmiYWHOyegbOpMVEi8fFdPKLwjeUO69cwAIgf/w=; b=gb/KUm5CcN6MD8YUkgRPzHrTcA3bdqAjJ37fy0s9/z2xhQWovIUkg9vNG3wFihf5RX LB1JpsozsWr8DgxvDxDOELejxkyIKxYUOqYxlVq//wlonO0NpvnSBIz5Gfzlfi7B+W+M Z7Fwp2UbcZu8ZOylZEZ0hE5vUqFGsciHzUJ/V5BLUbPH68hNDnI17DtAcrBpR0WtVwVr BsAkbf42HGviVeuoAXsxRJinF50psd9dqve8kLrGbJHAdTbI6j8e5aczXBavwRCROV+t F1OTTt//6BOwNGxmKQGJUcZ876FT3ijbem98p4PhBH/Bj42Gtu+mzt9cxQYmSRDxS6Nj dVYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=aX3uwmiYWHOyegbOpMVEi8fFdPKLwjeUO69cwAIgf/w=; b=TyMOL5y+L6Dy6K4S33gDfR9v1kJTVCMs4yIHBD9QNCIsQ3TIgFR6+kEW5VQcse+vDK 9M/Sa/2v1RkuA15Vzw+D2ctgGPudzb21yidvPfppvVMHlCMo/xWogygGGnLC4GH5oj3O vLqmHwQpYu4ZoQEQjH4rGomo13eiTo1rX2gYnyOj5VSacO+ZoKC+gEwPtNwCiBFV6lKi w9SS+3ZOE+yQhTMiOvAfKbjXP+/vSfsY8v96vzYqed6BbiJpwdCA2StEXesWxLQCIBtD /lnj6b+F7JJs4KLkm+0m/BrEelNuZW5PVqPBfw3RHhAJ4MTWaPMCk4Ztg2c2/UgET8wn WcBw== X-Gm-Message-State: AKGB3mJ82ejtcB2LHUZzTAskuwptbd7wouZqR46L5+Dr0SWpvZoYCA1R EOEyQgfwcZtwOkxb3uEeKjE= X-Google-Smtp-Source: ACJfBov+H6lM2/45/tbnYUnirFnLK0xycwqqhPz8j5k8qBZA03mS9zXDQrmDABmhSLlBPv2VIVCUgg== X-Received: by 10.200.56.75 with SMTP id r11mr5918693qtb.65.1513704913714; Tue, 19 Dec 2017 09:35:13 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Kevin Wolf , Max Reitz , Cleber Rosa , Eduardo Habkost , =?UTF-8?q?Luk=C3=A1=C5=A1=20Doktor?= , "Daniel P . Berrange" , Eric Blake , Stefan Hajnoczi , Fam Zheng , Markus Armbruster Date: Tue, 19 Dec 2017 14:34:19 -0300 Message-Id: <20171219173425.8113-4-f4bug@amsat.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20171219173425.8113-1-f4bug@amsat.org> References: <20171219173425.8113-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::244 Subject: [Qemu-devel] [PATCH 3/9] iotests: replace print statement by print() function for python3 compatibility 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: Janosch Frank , qemu-block@nongnu.org, Nir Soffer , Ishani Chugh , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org, Paolo Bonzini , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- tests/qemu-iotests/149 | 3 ++- tests/qemu-iotests/165 | 3 ++- tests/qemu-iotests/iotests.py | 5 +++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/tests/qemu-iotests/149 b/tests/qemu-iotests/149 index 223cd68ad5..d3ffa259db 100755 --- a/tests/qemu-iotests/149 +++ b/tests/qemu-iotests/149 @@ -20,6 +20,7 @@ # Exercise the QEMU 'luks' block driver to validate interoperability # with the Linux dm-crypt + cryptsetup implementation =20 +from __future__ import print_function import subprocess import os import os.path @@ -376,7 +377,7 @@ def test_once(config, qemu_img=3DFalse): finally: iotests.log("# Delete image") delete_image(config) - print + print() =20 =20 # Obviously we only work with the luks image format diff --git a/tests/qemu-iotests/165 b/tests/qemu-iotests/165 index a3932db3de..ab29066076 100755 --- a/tests/qemu-iotests/165 +++ b/tests/qemu-iotests/165 @@ -18,6 +18,7 @@ # along with this program. If not, see . # =20 +from __future__ import print_function import os import re import iotests @@ -85,7 +86,7 @@ class TestPersistentDirtyBitmap(iotests.QMPTestCase): log =3D re.sub(r'^\[I \d+\.\d+\] OPENED\n', '', log) log =3D re.sub(r'\[I \+\d+\.\d+\] CLOSED\n?$', '', log) if log: - print log + print(log) =20 self.vm =3D self.mkVm() self.vm.launch() diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index 6f057904a9..85c9d2c211 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -16,6 +16,7 @@ # along with this program. If not, see . # =20 +from __future__ import print_function import errno import os import re @@ -145,7 +146,7 @@ def filter_qmp_event(event): def log(msg, filters=3D[]): for flt in filters: msg =3D flt(msg) - print msg + print(msg) =20 class Timeout: def __init__(self, seconds, errmsg =3D "Timeout"): @@ -417,7 +418,7 @@ def notrun(reason): seq =3D os.path.basename(sys.argv[0]) =20 open('%s/%s.notrun' % (output_dir, seq), 'wb').write(reason + '\n') - print '%s not run: %s' % (seq, reason) + print("{} not run: {}".format(seq, reason)) sys.exit(0) =20 def verify_image_format(supported_fmts=3D[], unsupported_fmts=3D[]): --=20 2.15.1 From nobody Thu May 2 21:57:29 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; dkim=fail; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1513705181616907.9679818525718; Tue, 19 Dec 2017 09:39:41 -0800 (PST) Received: from localhost ([::1]:56428 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRLrg-0004te-Hb for importer@patchew.org; Tue, 19 Dec 2017 12:39:40 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60407) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRLnb-0001Y2-0M for qemu-devel@nongnu.org; Tue, 19 Dec 2017 12:35:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eRLnZ-0000pA-Js for qemu-devel@nongnu.org; Tue, 19 Dec 2017 12:35:26 -0500 Received: from mail-qt0-x241.google.com ([2607:f8b0:400d:c0d::241]:42335) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eRLnZ-0000oL-0g; Tue, 19 Dec 2017 12:35:25 -0500 Received: by mail-qt0-x241.google.com with SMTP id g9so25127158qth.9; Tue, 19 Dec 2017 09:35:24 -0800 (PST) Received: from x1.local ([138.117.48.211]) by smtp.gmail.com with ESMTPSA id z17sm9295525qti.59.2017.12.19.09.35.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Dec 2017 09:35:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=lmRJW4yKf0vSdn703V2+bNG5R+HoFG5Tl0NtUOZc8Oo=; b=WPyyAxohPK4tqk/VHVcG5xJ7+/d4qFf2H7sgRgz1JP72UK1rTm3+VJfkdFD3xgzDvw d52J5bnAguM8LGK3RS45Hebr+UmN1bWn57XgEFMTuW9O7tyGHI3WY4hQwnFeiIpSfEmw 0GVg/0UJBIeDj5ZIDbqXg+p4JEv6HuIrjRHoYj5Ybqc9B3JlipmSfwTER7tCUNT7JZtx zkUp6XmhebRDm4X8zRDsYX4iQr1cMqmXvdZGhnBuOLPg3a7DxJbi2koq4BIMofCMQJ5l ylJxPJEG5VlvW07y8XvhKbaUaLVw9YGhjkLnfIH2uJHwVvVr7pfAyRncLSSaLrcCAwJ/ LMnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=lmRJW4yKf0vSdn703V2+bNG5R+HoFG5Tl0NtUOZc8Oo=; b=itZDbdEHyjutewIxaCZHqQHXhDQU8fZ4d/10zPilcEulZh6gccIHGInx+iJBNsiqND vxXpBrBEzVbutuMlaCokRXNCRzk6l+fWn4qV+Yyg94Vol7UbuQl6UnFz/S0qjmI4r/ri 832nY/I2DanburqrLUeTdPUmAOlHkpfbd2uhFV0+Bwa5/ckfY+Vdx7KuXHbSG0ofLwwb Cl+k5hA8Mez/jQiY40YOR0MDm8VZ+Y7qtubJjLLo2zux5BaM7rR63OD5u6EhkCk8WYyb SXPhFId3JiAaxS/uZ4CEaiGdX4rpAsl9VXcMfWdZ7E962tBGmFm3rs8/HuJl3Sy4Oi6k vQog== X-Gm-Message-State: AKGB3mLwuF7/RPgk/irCAikBgcg3ft5Ffe6YIZyfl99Y9YQBJ0ITLDZE ECjUe+A7DpQsAu5at1fmVMo= X-Google-Smtp-Source: ACJfBoumEcfoM7P6HpRvG5lTaPs1lHXRSxJ971AwwVUjeN+mkK+m3xuv7YdVBEsA057I+IjDwvAL+g== X-Received: by 10.200.57.39 with SMTP id s36mr6135138qtb.208.1513704924506; Tue, 19 Dec 2017 09:35:24 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Kevin Wolf , Max Reitz , Cleber Rosa , Eduardo Habkost , =?UTF-8?q?Luk=C3=A1=C5=A1=20Doktor?= , "Daniel P . Berrange" , Eric Blake , Stefan Hajnoczi , Fam Zheng , Markus Armbruster Date: Tue, 19 Dec 2017 14:34:20 -0300 Message-Id: <20171219173425.8113-5-f4bug@amsat.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20171219173425.8113-1-f4bug@amsat.org> References: <20171219173425.8113-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::241 Subject: [Qemu-devel] [PATCH 4/9] iotests: use octal numbers for python3 compatibility 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: Janosch Frank , qemu-block@nongnu.org, Nir Soffer , Ishani Chugh , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org, Paolo Bonzini , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Daniel P. Berrange --- tests/qemu-iotests/118 | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/tests/qemu-iotests/118 b/tests/qemu-iotests/118 index 8a9e838c90..3cf21218f0 100755 --- a/tests/qemu-iotests/118 +++ b/tests/qemu-iotests/118 @@ -417,14 +417,14 @@ class TestChangeReadOnly(ChangeBaseClass): =20 def tearDown(self): self.vm.shutdown() - os.chmod(old_img, 0666) - os.chmod(new_img, 0666) + os.chmod(old_img, 0o666) + os.chmod(new_img, 0o666) os.remove(old_img) os.remove(new_img) =20 def test_ro_ro_retain(self): - os.chmod(old_img, 0444) - os.chmod(new_img, 0444) + os.chmod(old_img, 0o444) + os.chmod(new_img, 0o444) self.vm.add_drive(old_img, 'media=3Ddisk,read-only=3Don', 'floppy') self.vm.launch() =20 @@ -443,7 +443,7 @@ class TestChangeReadOnly(ChangeBaseClass): self.assert_qmp(result, 'return[0]/inserted/image/filename', new_i= mg) =20 def test_ro_rw_retain(self): - os.chmod(old_img, 0444) + os.chmod(old_img, 0o444) self.vm.add_drive(old_img, 'media=3Ddisk,read-only=3Don', 'floppy') self.vm.launch() =20 @@ -462,7 +462,7 @@ class TestChangeReadOnly(ChangeBaseClass): self.assert_qmp(result, 'return[0]/inserted/image/filename', new_i= mg) =20 def test_rw_ro_retain(self): - os.chmod(new_img, 0444) + os.chmod(new_img, 0o444) self.vm.add_drive(old_img, 'media=3Ddisk', 'floppy') self.vm.launch() =20 @@ -483,7 +483,7 @@ class TestChangeReadOnly(ChangeBaseClass): self.assert_qmp(result, 'return[0]/inserted/image/filename', old_i= mg) =20 def test_ro_rw(self): - os.chmod(old_img, 0444) + os.chmod(old_img, 0o444) self.vm.add_drive(old_img, 'media=3Ddisk,read-only=3Don', 'floppy') self.vm.launch() =20 @@ -503,7 +503,7 @@ class TestChangeReadOnly(ChangeBaseClass): self.assert_qmp(result, 'return[0]/inserted/image/filename', new_i= mg) =20 def test_rw_ro(self): - os.chmod(new_img, 0444) + os.chmod(new_img, 0o444) self.vm.add_drive(old_img, 'media=3Ddisk', 'floppy') self.vm.launch() =20 @@ -542,7 +542,7 @@ class TestChangeReadOnly(ChangeBaseClass): self.assert_qmp(result, 'return[0]/inserted/image/filename', new_i= mg) =20 def test_make_ro_rw(self): - os.chmod(new_img, 0444) + os.chmod(new_img, 0o444) self.vm.add_drive(old_img, 'media=3Ddisk', 'floppy') self.vm.launch() =20 @@ -562,7 +562,7 @@ class TestChangeReadOnly(ChangeBaseClass): self.assert_qmp(result, 'return[0]/inserted/image/filename', old_i= mg) =20 def test_make_rw_ro_by_retain(self): - os.chmod(old_img, 0444) + os.chmod(old_img, 0o444) self.vm.add_drive(old_img, 'media=3Ddisk,read-only=3Don', 'floppy') self.vm.launch() =20 @@ -581,7 +581,7 @@ class TestChangeReadOnly(ChangeBaseClass): self.assert_qmp(result, 'return[0]/inserted/image/filename', new_i= mg) =20 def test_make_ro_rw_by_retain(self): - os.chmod(new_img, 0444) + os.chmod(new_img, 0o444) self.vm.add_drive(old_img, 'media=3Ddisk', 'floppy') self.vm.launch() =20 @@ -600,7 +600,7 @@ class TestChangeReadOnly(ChangeBaseClass): self.assert_qmp(result, 'return[0]/inserted/image/filename', old_i= mg) =20 def test_rw_ro_cycle(self): - os.chmod(new_img, 0444) + os.chmod(new_img, 0o444) self.vm.add_drive(old_img, 'media=3Ddisk', 'floppy') self.vm.launch() =20 --=20 2.15.1 From nobody Thu May 2 21:57:29 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; dkim=fail; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1513705311121491.4417909747177; Tue, 19 Dec 2017 09:41:51 -0800 (PST) Received: from localhost ([::1]:56529 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRLth-0006nG-3L for importer@patchew.org; Tue, 19 Dec 2017 12:41:45 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60607) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRLnl-0001iE-8L for qemu-devel@nongnu.org; Tue, 19 Dec 2017 12:35:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eRLnk-00013i-6O for qemu-devel@nongnu.org; Tue, 19 Dec 2017 12:35:37 -0500 Received: from mail-qk0-x244.google.com ([2607:f8b0:400d:c09::244]:39669) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eRLnk-00013V-22; Tue, 19 Dec 2017 12:35:36 -0500 Received: by mail-qk0-x244.google.com with SMTP id u184so23485406qkd.6; Tue, 19 Dec 2017 09:35:35 -0800 (PST) Received: from x1.local ([138.117.48.211]) by smtp.gmail.com with ESMTPSA id z17sm9295525qti.59.2017.12.19.09.35.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Dec 2017 09:35:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ZabmL2HAiwp9VQauDwjOsgkCUH7m3mzlFgjajmoLiXc=; b=fCOpGRkkR6yLJFZ7X4Fc79i3LYT6ZKmw5kjsXl7TSdFYsxdtGo+Guw66h3RmFKPCg0 rXlNoK19CbWwoyr4gQwGlu77WJwmcvL9L85jRTo96Yus7A5vSrSZLnc1WC4AHVoIwLSJ DWXEiSW1fX190tTLM8aeo0zwNl/E6ZOCm+zY1lAlIJiolrNYbi7PFb5Y3eNCoOY+2Q9F l6NtcgkFF+/6m4LZKWPmOzGHUcxLzR4XBpiY5v9/8sncJH8Kz2zePf/8rdXIl+wCcObp kERX4hmVK+Nbkg2f2FRXRSJMPRLdONOz8GeLkY6tGz0nLwpl6V60r7etsbYDvfPHKfEO WLnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=ZabmL2HAiwp9VQauDwjOsgkCUH7m3mzlFgjajmoLiXc=; b=WQEMQfoR45ExO07hIaxqnkIMiopjwJbCadg+L6kdvs9+m3z5iksuvvIZgpBUSGfquV cGU8NCjGkgE4XjIuXfbTjtIDoZHRvay4UmSu8g6uvgmzSTq+AU7XIQrVA57R5PdsNpsF /8A2s+btcPsmgVB2krTBWrdXM1wFwk0+JOrdRPR1mrDwMtHFOlKT++XYGay6AiXxl/4S X8SbXWMknZglqnHWolfsQ4wx3C+q9wWvNUjNeI7kHv0GNXOrLT+/XZXVaWUCR+aY7n5T gTsSMjtqkMJhtBbzroyIp/sQ/yNv5JNL0zaOxrWoK/5tJSHQMhMN6fZPYFzpZB8nESkt QL7A== X-Gm-Message-State: AKGB3mIuKso+dYFZq/0M2ExDot3DSH0camfRPaVWabOWNvXVI/BO+cl8 z++poDxZnnPs+v7zwbP7CMc= X-Google-Smtp-Source: ACJfBousiZuih3lpV4ZR0H9vHV8mDaTVdqSoxzSVomPH2v29ly8CpDTD9l0sLsFbxlvFbdy6zcHR0g== X-Received: by 10.55.6.2 with SMTP id 2mr5780261qkg.178.1513704935447; Tue, 19 Dec 2017 09:35:35 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Kevin Wolf , Max Reitz , Cleber Rosa , Eduardo Habkost , =?UTF-8?q?Luk=C3=A1=C5=A1=20Doktor?= , "Daniel P . Berrange" , Eric Blake , Stefan Hajnoczi , Fam Zheng , Markus Armbruster Date: Tue, 19 Dec 2017 14:34:21 -0300 Message-Id: <20171219173425.8113-6-f4bug@amsat.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20171219173425.8113-1-f4bug@amsat.org> References: <20171219173425.8113-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::244 Subject: [Qemu-devel] [PATCH 5/9] iotests: replace xrange() by range() for python3 compatibility 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: Janosch Frank , qemu-block@nongnu.org, Nir Soffer , Ishani Chugh , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org, Paolo Bonzini , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Daniel P. Berrange --- tests/qemu-iotests/044 | 14 +++++++------- tests/qemu-iotests/163 | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/qemu-iotests/044 b/tests/qemu-iotests/044 index 11ea0f4d35..1e96800176 100755 --- a/tests/qemu-iotests/044 +++ b/tests/qemu-iotests/044 @@ -52,23 +52,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 ''.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 ''.join(struct.pack('>H', 1) for j in xrange(0, 64 = * 256)) - for block in xrange(0, h.refcount_table_clusters): + sector =3D ''.join(struct.pack('>H', 1) for j in range(0, 64 *= 256)) + 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 ''.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 +79,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 ''.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/163 b/tests/qemu-iotests/163 index 403842354e..fb0d0257ec 100644 --- a/tests/qemu-iotests/163 +++ b/tests/qemu-iotests/163 @@ -41,7 +41,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): --=20 2.15.1 From nobody Thu May 2 21:57:29 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; dkim=fail; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1513705200311618.0958110187945; Tue, 19 Dec 2017 09:40:00 -0800 (PST) Received: from localhost ([::1]:56433 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRLry-0005B4-HE for importer@patchew.org; Tue, 19 Dec 2017 12:39:58 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60730) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRLnu-0001o9-OL for qemu-devel@nongnu.org; Tue, 19 Dec 2017 12:35:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eRLnt-0001FR-Ko for qemu-devel@nongnu.org; Tue, 19 Dec 2017 12:35:46 -0500 Received: from mail-qt0-x244.google.com ([2607:f8b0:400d:c0d::244]:39329) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eRLnt-0001FE-GD; Tue, 19 Dec 2017 12:35:45 -0500 Received: by mail-qt0-x244.google.com with SMTP id k19so25120619qtj.6; Tue, 19 Dec 2017 09:35:45 -0800 (PST) Received: from x1.local ([138.117.48.211]) by smtp.gmail.com with ESMTPSA id z17sm9295525qti.59.2017.12.19.09.35.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Dec 2017 09:35:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=R8PeJYR13qN9VidiGQpxaBVu+5+qZxHBcUPhrx2ReMA=; b=IiwSRl2BGdIca8BNtjEuTvAGGsNPzAilvRh1TLbBxe70G/shYmUs0+xJpQm4A2dEgN MURzJOH88nyYGEBbEXt6O1PlXrR+lJg+2VL08aV5eLVwMMZMSaiSL1VPH2bKv8GKAhaB icm/9+s5xLP7ZlD+DfbeF8vurNgSoYYGJgWESErKhq9xsF4HJhw21AjkdAIP84Gv0fbH Z4ysZwoQZtPVYFQ7iWJHlaq40hc2+Gkl7vgqXfdlleP9Fu2nmvKIU0hpqw2+gdT1PZGx aTxeHsW6kpoq12nj9WTSazTBVKIHb2ZDc+G5JpojcDncmzDx1OrQTybwjYz5f8BEgrca 5OoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=R8PeJYR13qN9VidiGQpxaBVu+5+qZxHBcUPhrx2ReMA=; b=I5dexWojIuSeEJ0RWou1qnOncYN3g50R0IkQwGPINx/JN5cygsTgGDevm3CNq0lRMl kWlDlzGO/FK7DhJTunZzzNpqzcKG0/UN2hKffkofQ4egrT+gfYBmFtzu1rg8why3AjJd LPJIrXZQBT+WL8q604bChmZ9ADF9KPim1xQaekftAivW+gVtMJ8OK36WT7xeTQXQwe9a YKKUziI/M8ctCj1HiDiTckt3BhbMcaBWsva1RC1vrtSmbPq8lyqQt5kVpHYGpHD6EK4L DvgJI3SiON8mZBvxNX2iyZOkXFeAFqGDxjHdSa65PRF2M2HjgGGiZnQFvLtQMN0hmU6N pueQ== X-Gm-Message-State: AKGB3mJ3iOsG3kkQPL8qRWARG2jihuTSnTbY53/HKOz8Ckxdb1MVhau5 zau+vWNRvuLe0iGYek0lREcDfmCQ4i0= X-Google-Smtp-Source: ACJfBotsm/QcV/dFBHSj7ILd/zZ6/iOuUThbAYZjcstwQS1AIQIQeDvCYqenb6b/V4ix3DKlI+Q+YA== X-Received: by 10.200.26.234 with SMTP id h39mr6017079qtk.135.1513704945017; Tue, 19 Dec 2017 09:35:45 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Kevin Wolf , Max Reitz , Cleber Rosa , Eduardo Habkost , =?UTF-8?q?Luk=C3=A1=C5=A1=20Doktor?= , "Daniel P . Berrange" , Eric Blake , Stefan Hajnoczi , Fam Zheng , Markus Armbruster Date: Tue, 19 Dec 2017 14:34:22 -0300 Message-Id: <20171219173425.8113-7-f4bug@amsat.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20171219173425.8113-1-f4bug@amsat.org> References: <20171219173425.8113-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::244 Subject: [Qemu-devel] [PATCH 6/9] iotests: replace dict.has_key() by 'in' operator for python3 compatibility 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: Janosch Frank , qemu-block@nongnu.org, Nir Soffer , Ishani Chugh , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org, Paolo Bonzini , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Daniel P. Berrange --- tests/qemu-iotests/093 | 2 +- tests/qemu-iotests/096 | 4 ++-- tests/qemu-iotests/136 | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/qemu-iotests/093 b/tests/qemu-iotests/093 index 5c36a5fb4d..28b1d021ca 100755 --- a/tests/qemu-iotests/093 +++ b/tests/qemu-iotests/093 @@ -237,7 +237,7 @@ class ThrottleTestGroupNames(iotests.QMPTestCase): if name: self.assertEqual(info["group"], name) else: - self.assertFalse(info.has_key('group')) + self.assertFalse('group' in info) return =20 raise Exception("No group information found for '%s'" % device) diff --git a/tests/qemu-iotests/096 b/tests/qemu-iotests/096 index aeeb3753cf..a69439602d 100644 --- a/tests/qemu-iotests/096 +++ b/tests/qemu-iotests/096 @@ -53,9 +53,9 @@ class TestLiveSnapshot(iotests.QMPTestCase): self.assertEqual(r['iops'], self.iops) self.assertEqual(r['iops_size'], self.iops_size) else: - self.assertFalse(r.has_key('group')) + self.assertFalse('group' in r) self.assertEqual(r['iops'], 0) - self.assertFalse(r.has_key('iops_size')) + self.assertFalse('iops_size' in r) =20 def testSnapshot(self): self.checkConfig('base') diff --git a/tests/qemu-iotests/136 b/tests/qemu-iotests/136 index 88b97ea7c6..a154d8ef9d 100644 --- a/tests/qemu-iotests/136 +++ b/tests/qemu-iotests/136 @@ -203,7 +203,7 @@ sector =3D "%d" if (self.accounted_ops(read =3D True, write =3D True, flush =3D Tr= ue) !=3D 0): self.assertLess(0, stats['idle_time_ns']) else: - self.assertFalse(stats.has_key('idle_time_ns')) + self.assertFalse('idle_time_ns' in stats) =20 # This test does not alter these, so they must be all 0 self.assertEqual(0, stats['rd_merged']) --=20 2.15.1 From nobody Thu May 2 21:57:29 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; dkim=fail; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1513705184150920.9669262252498; Tue, 19 Dec 2017 09:39:44 -0800 (PST) Received: from localhost ([::1]:56429 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRLrj-0004wR-74 for importer@patchew.org; Tue, 19 Dec 2017 12:39:43 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60822) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRLo4-0001zH-BR for qemu-devel@nongnu.org; Tue, 19 Dec 2017 12:35:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eRLo3-0001P1-Eh for qemu-devel@nongnu.org; Tue, 19 Dec 2017 12:35:56 -0500 Received: from mail-qt0-x241.google.com ([2607:f8b0:400d:c0d::241]:33375) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eRLo3-0001OQ-9k; Tue, 19 Dec 2017 12:35:55 -0500 Received: by mail-qt0-x241.google.com with SMTP id e2so25171472qti.0; Tue, 19 Dec 2017 09:35:55 -0800 (PST) Received: from x1.local ([138.117.48.211]) by smtp.gmail.com with ESMTPSA id z17sm9295525qti.59.2017.12.19.09.35.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Dec 2017 09:35:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=rkVi9flY7vrrczgZHqveIet3JT8ZE3KOW9uKk4Yszw4=; b=GZlXPySRWSL6dopcUNTyVyX+Au95ubZ9Ll6ckcv/yCojbUB5ypBf08HNmPM9QAybW5 GaX4n28H1Vq204CLqAKqkN+405JxbXTHH2ZnvCKqmNXe+HGIXgV3iEbxoNl5Ih6Ckkdc Yr3FPCfmqnu519OkbyCy/L9vU4pstq9L8TPrP4bYz9bTUEE5VNMS8nmWMsjYP1Rr6Yoy Im5BizQAgpb4ETjayi3+yIizuOauulfRvNZiyN39JUqYNXe3hASCcnBYG9x4hKi/ppay wcyKAG7kbDTWoM4fPY2lMUVrjrot2VNmcWTDZzqZ8IisOMXKj3oKsxceRspsLKdPYPuP AyoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=rkVi9flY7vrrczgZHqveIet3JT8ZE3KOW9uKk4Yszw4=; b=faT63vcyccMKwYRdloXLbayIaWV3AQz6YLrsfFzfzB2Qj2K4lXvtCZHTgGkrankz/F H/ZbTGQ1LATATa7Ha9/wXDYoqk5fyCJ9tCfBbsMN6ZZsYKtJLfVgWq38jnjWNcaRn6fs 6JBSS/RVRod0fj02Sf+bzoTuLd/Yd2PsCo2WBpD5Cqc4nbYOCOew1iAQYNbVhfpu3u3O JsTPMImyxNUOYeHfIewnUPsXJ/k6baxDnjMC/UcAVgMNGlGYQ9ds7mpaEuy77VbMau05 snRnRVrKb/7qJdH8lfFULlkROIDjNWI5sm7eBHR6LrtxHEEGfPZJ/14Mh/FblzMfugZL eMAg== X-Gm-Message-State: AKGB3mLrrFXwRFTzen3luevJTonqaiFjwln0yCh8EwwKOi/d0VT+s1YU 8X/kyYdWbGAPX1hbTNu2YHA= X-Google-Smtp-Source: ACJfBou/TJaZGx1MSIStYFZ/NFyHqZp3C69n7rNMWV9kwTg7C4kbWK+MCfgcvBmZeofOfbMiyegZsQ== X-Received: by 10.237.62.4 with SMTP id l4mr6109611qtf.331.1513704954833; Tue, 19 Dec 2017 09:35:54 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Kevin Wolf , Max Reitz , Cleber Rosa , Eduardo Habkost , =?UTF-8?q?Luk=C3=A1=C5=A1=20Doktor?= , "Daniel P . Berrange" , Eric Blake , Stefan Hajnoczi , Fam Zheng , Markus Armbruster Date: Tue, 19 Dec 2017 14:34:23 -0300 Message-Id: <20171219173425.8113-8-f4bug@amsat.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20171219173425.8113-1-f4bug@amsat.org> References: <20171219173425.8113-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::241 Subject: [Qemu-devel] [PATCH 7/9] iotests: replace lambda function by lambda expression for python3 compatibility 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: Janosch Frank , qemu-block@nongnu.org, Nir Soffer , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org, Paolo Bonzini , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Daniel P. Berrange --- tests/qemu-iotests/065 | 4 ++-- tests/qemu-iotests/139 | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/qemu-iotests/065 b/tests/qemu-iotests/065 index 72aa9707c7..e95f7f817b 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 [drive for drive in result if drive['device'] =3D=3D 'dr= ive0'][0] 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/139 b/tests/qemu-iotests/139 index f8f02808a9..b54c816c16 100644 --- 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 --=20 2.15.1 From nobody Thu May 2 21:57:29 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; dkim=fail; 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 Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 151370541425436.62275594149628; Tue, 19 Dec 2017 09:43:34 -0800 (PST) Received: from localhost ([::1]:56665 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRLv7-00081z-MQ for importer@patchew.org; Tue, 19 Dec 2017 12:43:13 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60908) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRLoD-00026K-E9 for qemu-devel@nongnu.org; Tue, 19 Dec 2017 12:36:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eRLoC-0001eK-97 for qemu-devel@nongnu.org; Tue, 19 Dec 2017 12:36:05 -0500 Received: from mail-qt0-x244.google.com ([2607:f8b0:400d:c0d::244]:42345) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eRLoC-0001eA-4M; Tue, 19 Dec 2017 12:36:04 -0500 Received: by mail-qt0-x244.google.com with SMTP id g9so25129568qth.9; Tue, 19 Dec 2017 09:36:04 -0800 (PST) Received: from x1.local ([138.117.48.211]) by smtp.gmail.com with ESMTPSA id z17sm9295525qti.59.2017.12.19.09.35.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Dec 2017 09:36:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=+P95wyEjFhNaTEs6fyJ8B/+cLVLEsU52WY7R5PGysGI=; b=W12Tnl+fSSNydDTKyYij6rQpXldNUBnzTEFviPH3fyY+O9c9bzONhOdHnJO6gSfPa0 Sg38G8cfkJqRXv/Q/+i7mtwZq6ELuIBaqRjsXkoKzFRodJG4+vprvJSDEwjm0sgZFHGs 4elzvGTz/PkUXGe3uuQrJfNwqAF1gj0Yl3zAYja+5bmb5li4jIL28AlThdA2lOLHbiL2 451EzmHQwZe8JYnJpCnZSd2tO7dyybd7FtVzOJO0FGlSJ8m2Ka0qrv+htCayMEwnKBKy 8nnyJ31u+bwYIlbY+Nnun45TErin/c7soXbmAWp1I53Capj7nvUtw81hWPw0A8/52jZT MdXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=+P95wyEjFhNaTEs6fyJ8B/+cLVLEsU52WY7R5PGysGI=; b=gvkNgmbFSzJgks2xZxFVm09OnYMousrHsUu94hgZ/VzCdrqGSiNn/AW4g6YbWYOJKZ 04uU2YfNwUax5NWiEqkcRLxCCbv/23QYZVmoUTIAVtvJyDVNHbmXJwVx2qR37ZYxzrbE 5atzIclpXxSE2wY5BLFOmqW0vN2cnQdrD9+9XUN1xaXTj0H8sYBepSWT/bBtyc5Di2oZ A1BHXqOHs1vW/MgU1K96jC30mt5L4US8RpeXut4zmlJhO/LjzwwKdgiYyJAKXMy8e1sS KLrnFb60MN2YUKdWBZyRNH6TSxLyzhYXUtTt3J//nIdRe1kgZXgO4bu7u99UHPNe3Wr/ 36MQ== X-Gm-Message-State: AKGB3mJCdc5JxIOIyJnhZy05LlpkrqnANa+gTLHNk3f4YF7WIcVtNAoE n0T6ttDI55Q8zmoFqkSZJPXiSzxOLJk= X-Google-Smtp-Source: ACJfBovB9UZ/WDIuAWxuAuCRCKsGDQcuWV2CMWycCyx1XAO5I5GowcDAx/enRg3LZDGd/sVYJ4kczA== X-Received: by 10.200.47.230 with SMTP id m35mr5677928qta.220.1513704963643; Tue, 19 Dec 2017 09:36:03 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Kevin Wolf , Max Reitz , Cleber Rosa , Eduardo Habkost , =?UTF-8?q?Luk=C3=A1=C5=A1=20Doktor?= , "Daniel P . Berrange" , Eric Blake , Stefan Hajnoczi , Fam Zheng , Markus Armbruster Date: Tue, 19 Dec 2017 14:34:24 -0300 Message-Id: <20171219173425.8113-9-f4bug@amsat.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20171219173425.8113-1-f4bug@amsat.org> References: <20171219173425.8113-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::244 Subject: [Qemu-devel] [PATCH 8/9] iotests: replace assertEquals() by assertEqual() for python3 compatibility 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: Janosch Frank , qemu-block@nongnu.org, Nir Soffer , Ishani Chugh , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org, Paolo Bonzini , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Daniel P. Berrange --- tests/qemu-iotests/041 | 6 +++--- tests/qemu-iotests/118 | 4 ++-- tests/qemu-iotests/iotests.py | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/qemu-iotests/041 b/tests/qemu-iotests/041 index a860a31e9a..fa0f20af0e 100755 --- a/tests/qemu-iotests/041 +++ b/tests/qemu-iotests/041 @@ -457,7 +457,7 @@ new_state =3D "1" self.assert_qmp(result, 'return', {}) =20 event =3D self.vm.get_qmp_event(wait=3DTrue) - self.assertEquals(event['event'], 'BLOCK_JOB_ERROR') + self.assertEqual(event['event'], 'BLOCK_JOB_ERROR') self.assert_qmp(event, 'data/device', 'drive0') self.assert_qmp(event, 'data/operation', 'read') result =3D self.vm.qmp('query-block-jobs') @@ -478,7 +478,7 @@ new_state =3D "1" self.assert_qmp(result, 'return', {}) =20 event =3D self.vm.get_qmp_event(wait=3DTrue) - self.assertEquals(event['event'], 'BLOCK_JOB_ERROR') + self.assertEqual(event['event'], 'BLOCK_JOB_ERROR') self.assert_qmp(event, 'data/device', 'drive0') self.assert_qmp(event, 'data/operation', 'read') result =3D self.vm.qmp('query-block-jobs') @@ -609,7 +609,7 @@ new_state =3D "1" self.assert_qmp(result, 'return', {}) =20 event =3D self.vm.get_qmp_event(wait=3DTrue) - self.assertEquals(event['event'], 'BLOCK_JOB_ERROR') + self.assertEqual(event['event'], 'BLOCK_JOB_ERROR') self.assert_qmp(event, 'data/device', 'drive0') self.assert_qmp(event, 'data/operation', 'write') result =3D self.vm.qmp('query-block-jobs') diff --git a/tests/qemu-iotests/118 b/tests/qemu-iotests/118 index 3cf21218f0..8158b4bd25 100755 --- a/tests/qemu-iotests/118 +++ b/tests/qemu-iotests/118 @@ -295,7 +295,7 @@ class GeneralChangeTestsBaseClass(ChangeBaseClass): result =3D self.vm.qmp('blockdev-close-tray', device=3D'drive0') # Should be a no-op self.assert_qmp(result, 'return', {}) - self.assertEquals(self.vm.get_qmp_events(wait=3DFalse), []) + self.assertEqual(self.vm.get_qmp_events(wait=3DFalse), []) =20 def test_remove_on_closed(self): if not self.has_real_tray: @@ -476,7 +476,7 @@ class TestChangeReadOnly(ChangeBaseClass): read_only_mode=3D'r= etain') self.assert_qmp(result, 'error/class', 'GenericError') =20 - self.assertEquals(self.vm.get_qmp_events(wait=3DFalse), []) + self.assertEqual(self.vm.get_qmp_events(wait=3DFalse), []) =20 result =3D self.vm.qmp('query-block') self.assert_qmp(result, 'return[0]/inserted/ro', False) diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index 85c9d2c211..4c515d2e6c 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -385,7 +385,7 @@ class QMPTestCase(unittest.TestCase): def wait_ready_and_cancel(self, drive=3D'drive0'): self.wait_ready(drive=3Ddrive) event =3D self.cancel_and_wait(drive=3Ddrive) - self.assertEquals(event['event'], 'BLOCK_JOB_COMPLETED') + self.assertEqual(event['event'], 'BLOCK_JOB_COMPLETED') self.assert_qmp(event, 'data/type', 'mirror') self.assert_qmp(event, 'data/offset', event['data']['len']) =20 --=20 2.15.1 From nobody Thu May 2 21:57:29 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; dkim=fail; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 151370550271155.86610284111043; Tue, 19 Dec 2017 09:45:02 -0800 (PST) Received: from localhost ([::1]:56716 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRLwo-0000rS-Lu for importer@patchew.org; Tue, 19 Dec 2017 12:44:58 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:32784) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRLoQ-0002It-9O for qemu-devel@nongnu.org; Tue, 19 Dec 2017 12:36:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eRLoL-0001nz-IX for qemu-devel@nongnu.org; Tue, 19 Dec 2017 12:36:18 -0500 Received: from mail-qt0-x244.google.com ([2607:f8b0:400d:c0d::244]:42346) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eRLoL-0001ng-Dv; Tue, 19 Dec 2017 12:36:13 -0500 Received: by mail-qt0-x244.google.com with SMTP id g9so25130173qth.9; Tue, 19 Dec 2017 09:36:13 -0800 (PST) Received: from x1.local ([138.117.48.211]) by smtp.gmail.com with ESMTPSA id z17sm9295525qti.59.2017.12.19.09.36.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Dec 2017 09:36:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=KLwRckLENHthGgrTU6zVlFxbTOmmFebc3fomKtcccVM=; b=AJlhnvVEhDUAwMsysWCAnqdJ20Bg8f5ExmI9h5uowR2j3xjAoAokz7wg1Qgr1/kPcj nG5XwGjV56qglx+RLsAbSWktEkoS03VrGalPzQwJ9RiO5emZQ1+gAoPlcZtZ9rc7HGAb sj700Zw84aINeTa8XlAdwN9BTBqvQM9segrDN7jc94MY0d37VOHkoqQuG6AAiRSCF8ht 7YEOGvLSE9oGmqDJ6rYdQcStBQ0rMmEB80QNWfOjzwDS3+aKDhz1F5A2KpERJDnnF/2p Fy+XktL0db1LOV0Gn6+jT+wQcrq4FUFhbVH/o0VOEb4pdin1t0pzzS2Qms1ERkt17hrm B4Vg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=KLwRckLENHthGgrTU6zVlFxbTOmmFebc3fomKtcccVM=; b=orxZt/e/ufL7ynSJBDCeKZVe4QOiLVQgehu932gRL6VSxeTd2pjqCg3m80IIutf663 oc2MWftR/nIgis8211W0/fW35Q37I0x8RtRwTetRMjkxboijWW/JpcDWFiIgtvZw8V/1 rXzltZiZ4du88B7G8x3JlJPa7tf0651PYfavctc0rOpixDLrgy4HnZyeuZmefMoCZiFq A+cDaCORdi5wyQovKEOvcPQYOpdnytiibPmMEkJx+5W9jf64Qej+VQ7+sCJk2DoCY4NN oFl40FapLAidL6AUF1/PzfAxXcoNyrlDdKtKGsgX9Zbwget7033VNf0ZStkXM8lwUXt/ Z3XQ== X-Gm-Message-State: AKGB3mISQKbf3yJldO6+id7LTnDDhQmOUaoM9Sjzq3nHkViOD05quQTn FO+3zIb1AT1vJQ/YC62lrPc= X-Google-Smtp-Source: ACJfBouO2CwBR0AB2xJu9XibqWn91fDyG1GZBqXgb70482OewyIp3zwwBVYyLrIbFo/DqJ0ys34LIg== X-Received: by 10.237.33.205 with SMTP id m13mr6277662qtc.131.1513704972917; Tue, 19 Dec 2017 09:36:12 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Kevin Wolf , Max Reitz , Cleber Rosa , Eduardo Habkost , =?UTF-8?q?Luk=C3=A1=C5=A1=20Doktor?= , "Daniel P . Berrange" , Eric Blake , Stefan Hajnoczi , Fam Zheng , Markus Armbruster Date: Tue, 19 Dec 2017 14:34:25 -0300 Message-Id: <20171219173425.8113-10-f4bug@amsat.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20171219173425.8113-1-f4bug@amsat.org> References: <20171219173425.8113-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::244 Subject: [Qemu-devel] [PATCH 9/9] iotests.py: use io.StringIO with python3 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: Janosch Frank , qemu-block@nongnu.org, Nir Soffer , Ishani Chugh , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org, Paolo Bonzini , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Daniel P. Berrange --- tests/qemu-iotests/iotests.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index 4c515d2e6c..0e1b8ab6e6 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -459,13 +459,16 @@ def main(supported_fmts=3D[], supported_oses=3D['linu= x']): =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() + try: + from StringIO import StringIO + except ImportError: + from io import StringIO + output =3D StringIO() =20 logging.basicConfig(level=3D(logging.DEBUG if debug else logging.WARN)) =20 --=20 2.15.1