From patchwork Tue Mar 12 23:45:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 10850305 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D44D41390 for ; Tue, 12 Mar 2019 23:56:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BFFCF299C4 for ; Tue, 12 Mar 2019 23:56:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B0747299C6; Tue, 12 Mar 2019 23:56:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 5F988299C4 for ; Tue, 12 Mar 2019 23:56:31 +0000 (UTC) Received: from localhost ([127.0.0.1]:35280 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3rG2-000637-PN for patchwork-qemu-devel@patchwork.kernel.org; Tue, 12 Mar 2019 19:56:30 -0400 Received: from eggs.gnu.org ([209.51.188.92]:56321) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3rCM-0002yF-87 for qemu-devel@nongnu.org; Tue, 12 Mar 2019 19:52:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h3r5p-00025h-C9 for qemu-devel@nongnu.org; Tue, 12 Mar 2019 19:45:58 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33958) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h3r5o-00022o-Ac; Tue, 12 Mar 2019 19:45:56 -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 9887013A4D; Tue, 12 Mar 2019 23:45:55 +0000 (UTC) Received: from x1w.redhat.com (ovpn-204-23.brq.redhat.com [10.40.204.23]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 36DB21973B; Tue, 12 Mar 2019 23:45:51 +0000 (UTC) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Cleber Rosa Date: Wed, 13 Mar 2019 00:45:40 +0100 Message-Id: <20190312234541.2887-2-philmd@redhat.com> In-Reply-To: <20190312234541.2887-1-philmd@redhat.com> References: <20190312234541.2887-1-philmd@redhat.com> MIME-Version: 1.0 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.29]); Tue, 12 Mar 2019 23:45:55 +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/2] BootLinuxConsoleTest: Let extract_from_deb handle various compressions 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: Peter Maydell , qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Andrew Baumann Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Debian binary package format supports various compressions. Per man deb(5): NAME deb - Debian binary package format FORMAT ... The third, last required member is named data.tar. It contains the filesystem as a tar archive, either not compressed (supported since dpkg 1.10.24), or compressed with gzip (with .gz extension), xz (with .xz extension, supported since dpkg 1.15.6), bzip2 (with .bz2 extension, supported since dpkg 1.10.24) or lzma (with .lzma extension, supported since dpkg 1.13.25). List the archive files to have the 3rd name with the correct extension. The function avocado.utils.archive.extract() will handle the different compression format for us. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Cleber Rosa --- v2: Use process.run() (Cleber) --- tests/acceptance/boot_linux_console.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot_linux_console.py index 23fca39422..0936589fd8 100644 --- a/tests/acceptance/boot_linux_console.py +++ b/tests/acceptance/boot_linux_console.py @@ -55,8 +55,9 @@ class BootLinuxConsole(Test): """ cwd = os.getcwd() os.chdir(self.workdir) - process.run("ar x %s data.tar.gz" % deb) - archive.extract("data.tar.gz", self.workdir) + file_path = process.run("ar t %s" % deb).stdout_text.split()[2] + process.run("ar x %s %s" % (deb, file_path)) + archive.extract(file_path, self.workdir) os.chdir(cwd) return self.workdir + path