From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.5 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 31A23CA9EC0 for ; Mon, 28 Oct 2019 23:53:29 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E43CE20880 for ; Mon, 28 Oct 2019 23:53:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Sa/ZLsz1" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E43CE20880 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:45642 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iPEpD-0005AC-Hc for qemu-devel@archiver.kernel.org; Mon, 28 Oct 2019 19:53:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59055) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iPEmz-000308-15 for qemu-devel@nongnu.org; Mon, 28 Oct 2019 19:51:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iPEmw-0004Bg-UT for qemu-devel@nongnu.org; Mon, 28 Oct 2019 19:51:07 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:23356 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iPEmw-0004BP-RX for qemu-devel@nongnu.org; Mon, 28 Oct 2019 19:51:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1572306666; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=H2G7VV+/5dByTZGXfTIBMJMtStNNZRCf8EfsnWjKSKI=; b=Sa/ZLsz17bCsOtvxePPBEHUjLNjhsyIsmrdlBo+oVn1vP11jEQjnw6YzkkeFj9Dj4QevHC mHqVt8orWNhMhVW0BosIy0lxUHxnkoGGVHO9hpTf+UB4LmEe9nfVDdMuivglnOM7n71WNc Qt/P80wMY2q3s3oU3xOzL3F0gacAx5Q= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-174-4Zb7jMVfM9SGFkS0ttJfzQ-1; Mon, 28 Oct 2019 19:51:01 -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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id ACAC281A334; Mon, 28 Oct 2019 23:50:59 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-123-183.rdu2.redhat.com [10.10.123.183]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8D45E5C1B2; Mon, 28 Oct 2019 23:50:57 +0000 (UTC) From: Cleber Rosa To: Peter Maydell , qemu-devel@nongnu.org, Eduardo Habkost Subject: [PULL 13/16] tests/boot_linux_console: Use Avocado archive::gzip_uncompress() Date: Mon, 28 Oct 2019 19:49:59 -0400 Message-Id: <20191028235002.17691-14-crosa@redhat.com> In-Reply-To: <20191028235002.17691-1-crosa@redhat.com> References: <20191028235002.17691-1-crosa@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-MC-Unique: 4Zb7jMVfM9SGFkS0ttJfzQ-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 205.139.110.120 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fam Zheng , Aleksandar Rikalo , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Fabien Chouteau , KONRAD Frederic , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Wainer dos Santos Moschetta , Willian Rampazzo , Cleber Rosa , qemu-ppc@nongnu.org, Aleksandar Rikalo , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Aurelien Jarno Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daud=C3=A9 Avocado 67.0 [*] introduced the avocado.utils.archive module which provides handling of gzip files. Use the gzip_uncompress() method. [*] https://avocado-framework.readthedocs.io/en/67.0/api/utils/avocado.util= s.html#avocado.utils.archive.gzip_uncompress Suggested-by: Cleber Rosa Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20191028073441.6448-20-philmd@redhat.com> Reviewed-by: Cleber Rosa Tested-by: Cleber Rosa Signed-off-by: Cleber Rosa --- tests/acceptance/boot_linux_console.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot= _linux_console.py index 4b419b0559..67d7e96d98 100644 --- a/tests/acceptance/boot_linux_console.py +++ b/tests/acceptance/boot_linux_console.py @@ -145,10 +145,7 @@ class BootLinuxConsole(Test): initrd_hash =3D 'bf806e17009360a866bf537f6de66590de349a99' initrd_path_gz =3D self.fetch_asset(initrd_url, asset_hash=3Dinitr= d_hash) initrd_path =3D self.workdir + "rootfs.cpio" - - with gzip.open(initrd_path_gz, 'rb') as f_in: - with open(initrd_path, 'wb') as f_out: - shutil.copyfileobj(f_in, f_out) + archive.gzip_uncompress(initrd_path_gz, initrd_path) =20 self.vm.set_machine('malta') self.vm.set_console() --=20 2.21.0