From mboxrd@z Thu Jan 1 00:00:00 1970 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) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Sat, 2 Mar 2019 22:54:54 +0100 Message-Id: <20190302215454.6189-1-philmd@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH] BootLinuxConsoleTest: Let extract_from_deb handle various compressions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Cleber Rosa , qemu-devel@nongnu.org Cc: Eduardo Habkost , Caio Carrara , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= 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=C3=A9 --- 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/bo= ot_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 =3D os.getcwd() os.chdir(self.workdir) - process.run("ar x %s data.tar.gz" % deb) - archive.extract("data.tar.gz", self.workdir) + file_path =3D 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 =20 --=20 2.20.1