From nobody Wed Nov 5 00:14:59 2025 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 1531870884888669.2848947172205; Tue, 17 Jul 2018 16:41:24 -0700 (PDT) Received: from localhost ([::1]:33950 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ffZat-0002yK-V6 for importer@patchew.org; Tue, 17 Jul 2018 19:41:23 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60628) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ffZa0-0002ec-RD for qemu-devel@nongnu.org; Tue, 17 Jul 2018 19:40:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ffZZx-0005KN-NO for qemu-devel@nongnu.org; Tue, 17 Jul 2018 19:40:28 -0400 Received: from mail-ua0-x244.google.com ([2607:f8b0:400c:c08::244]:40122) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ffZZx-0005Iy-A4; Tue, 17 Jul 2018 19:40:25 -0400 Received: by mail-ua0-x244.google.com with SMTP id p22-v6so1796245uao.7; Tue, 17 Jul 2018 16:40:25 -0700 (PDT) Received: from x1.local ([138.117.48.222]) by smtp.gmail.com with ESMTPSA id p34-v6sm480148uae.7.2018.07.17.16.40.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 17 Jul 2018 16:40:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=HHtSD/RW5wJZRqiF35BNEZuBLRmqJCCyFlQEQrcva1c=; b=lTunYD8Az20KIix63inZdnLGp3bSgTEdX1ImQlsjTH06GDquL5VC2+kP7Czg/i0Paq Y9QI/EB4vxCUfFD5KPoqT1kfO8GInXeLI1z/IWJjmXyN/+DHJKFNUOKwuWtqfudUuVcD lZkBwlDrDu20oRS67k4yZatLE16MBw39ghEg3gLa5AS4sDwkNj6ZIM1jK77Qu8EWiFCi oKHxeVMHFAsafuFnJyziIe+diePTEthphgyrCGU1tAMyaW8UexPOADS/bR/y4m7aJpjq /0APXNnDRcH4CVOPkS1Q5Hbi381qcM9lIvUpJwNP73XoNAQmNUEtk8aopUc88RwIJdHi 1zKw== 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 :mime-version:content-transfer-encoding; bh=HHtSD/RW5wJZRqiF35BNEZuBLRmqJCCyFlQEQrcva1c=; b=P/xKfWXsNGrhxG9uA6MgUTjJN3QLE8uJRSmycRhVUhXKyMEOIJqGrXDzaXu9aeVMxd kAa+N9ARClZAaVxAoDE72m5suh8cmAOa5jvD/AmfuFRvJP+Fd85iG2s9YnSJPqi8zefu OP1ucg0HhihtG+h1v57T1sDboAiBVBYOryypIkDuedP9AmyMUNvrZQqPzMGyuX5Qmdkw J7ISw4OcJg1nyBKsFA2f/Atq4swlgfuD8L96j/jHIQuKYbDbWApzH7TpAVvLSKhn1qhl bqu3xuO9DiyzkcjiyTV7/+LXIqU/acokK9IbNfBNBt7dmZmXuNxdSpeyIz2z1lU7ZSD3 N6tA== X-Gm-Message-State: AOUpUlFYQN5hUu8Cok4eQ+DLLmSRr5CUGNcehh352EraiYqED0eIULz9 jdLFDYF3D+ZT7Hjp1swJqJM= X-Google-Smtp-Source: AAOMgpfQgxGw0+1sbZAsgZjwQKmXbTDbmCxSL/COwgTSFjpZo6sqR3OPebyxj0u9wc2ss2lDvZbpdw== X-Received: by 2002:ab0:b:: with SMTP id 11-v6mr2478914uai.19.1531870824495; Tue, 17 Jul 2018 16:40:24 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Fam Zheng , Kevin Wolf , Max Reitz , Eduardo Habkost Date: Tue, 17 Jul 2018 20:40:15 -0300 Message-Id: <20180717234015.22700-1-f4bug@amsat.org> X-Mailer: git-send-email 2.18.0 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:400c:c08::244 Subject: [Qemu-devel] [PATCH for-3.1] qemu-iotests: Adapt to moved location of StringIO module in py3 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: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-block@nongnu.org, qemu-devel@nongnu.org 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 Since 356dc290f the Fedora image default to Python3. This fixes: $ make docker-test-block@fedora [...] 045 [failed, exit status 1] - output mismatch (see 045.out.bad) --- /tmp/qemu-test/src/tests/qemu-iotests/045.out 2018-07-17 16:56:= 18.000000000 +0000 +++ /tmp/qemu-test/build/tests/qemu-iotests/045.out.bad 2018-07-17 17:19:= 22.448409007 +0000 @@ -1,5 +1,6 @@ -........... ----------------------------------------------------------------------- -Ran 11 tests - -OK +Traceback (most recent call last): + File "045", line 178, in + iotests.main(supported_fmts=3D['raw']) + File "/tmp/qemu-test/src/tests/qemu-iotests/iotests.py", line 682, in = main + import StringIO +ModuleNotFoundError: No module named 'StringIO' 132 [failed, exit status 1] - output mismatch (see 132.out.bad) 148 [failed, exit status 1] - output mismatch (see 148.out.bad) 152 [failed, exit status 1] - output mismatch (see 152.out.bad) Failures: 045 132 148 152 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Daniel P. Berrang=C3=A9 --- tests/qemu-iotests/iotests.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index 4e67fbbe96..2fc7165fb9 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -679,13 +679,17 @@ def main(supported_fmts=3D[], supported_oses=3D['linu= x'], supported_cache_modes=3D[], =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 + try: + from StringIO import StringIO + except ImportError: + from io import StringIO + if debug: output =3D sys.stdout verbosity =3D 2 sys.argv.remove('-d') else: - output =3D StringIO.StringIO() + output =3D StringIO() =20 logging.basicConfig(level=3D(logging.DEBUG if debug else logging.WARN)) =20 --=20 2.18.0