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=-9.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,UNPARSEABLE_RELAY,URIBL_BLOCKED,USER_AGENT_GIT 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 F3A66C35254 for ; Wed, 5 Feb 2020 15:00:40 +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 BED7F21741 for ; Wed, 5 Feb 2020 15:00:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="n8cel0F5" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BED7F21741 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=oracle.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:49190 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1izMAR-0003yM-V3 for qemu-devel@archiver.kernel.org; Wed, 05 Feb 2020 10:00:39 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:46718) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1izM8Y-0001QJ-2h for qemu-devel@nongnu.org; Wed, 05 Feb 2020 09:58:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1izM8W-0004qk-SH for qemu-devel@nongnu.org; Wed, 05 Feb 2020 09:58:41 -0500 Received: from userp2130.oracle.com ([156.151.31.86]:39556) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1izM8W-0004o7-Ip for qemu-devel@nongnu.org; Wed, 05 Feb 2020 09:58:40 -0500 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.27/8.16.0.27) with SMTP id 015EwE6x188776; Wed, 5 Feb 2020 14:58:24 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=corp-2019-08-05; bh=jKD4F/i81ODMhCydEAUkfu0ajc611DYWcWzceMoBqjs=; b=n8cel0F5VTZhX3px/RMlkhKQNWt6t3xSGtUwsDtfWIsddz1T3XlQ+yC2Cuo/dpITrZSB +vWtgGXipSzgdROQ1ZePE2QJS7OHkHJ8dpBTDb5HGo6Np94cFW+nTgiX/HkTTO+bbkQM 8BZUOFgYRd3YWOWN3XVFHJd66OFCvSpbZUQ61HUT9u+is1hTYaN03S18Ppy6LMl4SKNn u+QFveQCAYPqtFgluVbjfPSsXga4+uTezhrlvthFVqdbeAkbv4M1V9M3a94hm9BXKhJ8 zAU7Q3yfxS4ftWUlZVW6wreYoH2NbQPhwFalfcnTbgd5bDc85cDLCTShyCmif+HvUs69 vA== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by userp2130.oracle.com with ESMTP id 2xykbp3hb7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 05 Feb 2020 14:58:24 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.27/8.16.0.27) with SMTP id 015ErRYv035693; Wed, 5 Feb 2020 14:56:23 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserp3030.oracle.com with ESMTP id 2xykbs1jja-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 05 Feb 2020 14:56:23 +0000 Received: from abhmp0013.oracle.com (abhmp0013.oracle.com [141.146.116.19]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 015EuMYZ017963; Wed, 5 Feb 2020 14:56:22 GMT Received: from ol7.uk.oracle.com (/10.175.206.136) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 05 Feb 2020 06:56:21 -0800 From: Liam Merwick To: alex.bennee@linaro.org, fam@euphon.net, philmd@redhat.com Subject: [PATCH v2 4/6] tests/boot_linux_console: add extract_from_rpm method Date: Wed, 5 Feb 2020 14:56:03 +0000 Message-Id: <1580914565-19675-5-git-send-email-liam.merwick@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1580914565-19675-1-git-send-email-liam.merwick@oracle.com> References: <1580914565-19675-1-git-send-email-liam.merwick@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9521 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=940 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1911140001 definitions=main-2002050118 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9521 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1911140001 definitions=main-2002050119 Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by userp2130.oracle.com id 015EwE6x188776 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 156.151.31.86 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: slp@redhat.com, qemu-devel@nongnu.org, wainersm@redhat.com, pbonzini@redhat.com, sgarzare@redhat.com Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Add a method to extract a specified file from an RPM to the test's working directory and return the path to the extracted file. Signed-off-by: Liam Merwick Reviewed-by: Stefano Garzarella Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- tests/acceptance/boot_linux_console.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/bo= ot_linux_console.py index e9375590bc1c..6a473363a122 100644 --- a/tests/acceptance/boot_linux_console.py +++ b/tests/acceptance/boot_linux_console.py @@ -51,6 +51,22 @@ class BootLinuxConsole(Test): os.chdir(cwd) return self.workdir + path =20 + def extract_from_rpm(self, rpm, path): + """ + Extracts a file from an RPM package into the test workdir. + + :param rpm: path to the rpm archive + :param path: path within the rpm archive of the file to be extra= cted + needs to be a relative path (starting with './') be= cause + cpio(1), which is used to extract the file, expects= that. + :returns: path of the extracted file + """ + cwd =3D os.getcwd() + os.chdir(self.workdir) + process.run("rpm2cpio %s | cpio -id %s" % (rpm, path), shell=3DT= rue) + os.chdir(cwd) + return os.path.normpath(os.path.join(self.workdir, path)) + def do_test_x86_64_machine(self): """ Common routine to boot an x86_64 guest. --=20 1.8.3.1