From patchwork Sat Mar 2 21:54:54 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: 1050731 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44BgHG30FXz9s7h for ; Sun, 3 Mar 2019 09:01:41 +1100 (AEDT) Received: from localhost ([127.0.0.1]:59401 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h0ChK-0005L9-Or for incoming@patchwork.ozlabs.org; Sat, 02 Mar 2019 17:01:34 -0500 Received: from eggs.gnu.org ([209.51.188.92]:60697) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h0CgR-0005Fn-Om for qemu-devel@nongnu.org; Sat, 02 Mar 2019 17:00:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h0Cb4-0002nX-Ak for qemu-devel@nongnu.org; Sat, 02 Mar 2019 16:55:06 -0500 Received: from mx1.redhat.com ([209.132.183.28]:45434) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h0Cb4-0002lS-3x for qemu-devel@nongnu.org; Sat, 02 Mar 2019 16:55:06 -0500 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 09C1C86658 for ; Sat, 2 Mar 2019 21:55:05 +0000 (UTC) Received: from x1w.redhat.com (ovpn-204-70.brq.redhat.com [10.40.204.70]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 203695F9CA; Sat, 2 Mar 2019 21:54:57 +0000 (UTC) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Cleber Rosa , qemu-devel@nongnu.org Date: Sat, 2 Mar 2019 22:54:54 +0100 Message-Id: <20190302215454.6189-1-philmd@redhat.com> MIME-Version: 1.0 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.26]); Sat, 02 Mar 2019 21:55:05 +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] 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: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Eduardo Habkost , Caio Carrara Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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 method avocado.utils.archive.extract() will handle the different compression format for us. Signed-off-by: Philippe Mathieu-Daudé Tested-by: Cleber Rosa --- Based-on: 20190221005753.27955-15-crosa@redhat.com 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 d866886067..b62b70bbde 100644 --- a/tests/acceptance/boot_linux_console.py +++ b/tests/acceptance/boot_linux_console.py @@ -58,8 +58,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.system_output("ar t %s" % deb).split()[2].decode() + process.run("ar x %s %s" % (deb, file_path)) + archive.extract(file_path, self.workdir) os.chdir(cwd) return self.workdir + path