From patchwork Mon Jan 27 16:36:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Liam Merwick X-Patchwork-Id: 1229945 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) 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=oracle.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=oracle.com header.i=@oracle.com header.a=rsa-sha256 header.s=corp-2019-08-05 header.b=XS6odEsW; dkim-atps=neutral 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 ozlabs.org (Postfix) with ESMTPS id 485wWf6rtDz9sRV for ; Tue, 28 Jan 2020 03:42:06 +1100 (AEDT) Received: from localhost ([::1]:47780 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iw7Sf-000649-0B for incoming@patchwork.ozlabs.org; Mon, 27 Jan 2020 11:42:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:33872) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iw7Ob-0000XC-Lt for qemu-devel@nongnu.org; Mon, 27 Jan 2020 11:37:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iw7Oa-00023A-Iv for qemu-devel@nongnu.org; Mon, 27 Jan 2020 11:37:53 -0500 Received: from userp2120.oracle.com ([156.151.31.85]:41220) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iw7Oa-00021f-A9 for qemu-devel@nongnu.org; Mon, 27 Jan 2020 11:37:52 -0500 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.27/8.16.0.27) with SMTP id 00RGITJ1043003; Mon, 27 Jan 2020 16:37:45 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; s=corp-2019-08-05; bh=Pu3hQmBMKM3nLKzsAuJQPA0ccNQERKQHXN77eVCKWjY=; b=XS6odEsWDbyK24vowXplSEuioZ/xHqe7N5c0Vn4ZuETDhnyWjHJvILUtCS/SvRzf3Mz2 oCiSOeVNW0F50bOtO4ZRx4hEpSWRwuvckFT3yNZZBaD2C3zLSX9k7qsPy14FQnZsOxw/ UIrpgEB9+8AD6F03AbylB6aj8Wbbbp4PI6o38VLJNR8SJ0+gGMk0wIGksoWh8Blcgxhz 5IwBYvksZCVY6tcE8Vz0iqxDqMcHTFUxIcxNnlKOAQbX14Xvm6cfSX0Zc8JhJxbeSKdG IqTwdW/BznOmU3qdCb3ks4jKBhUO52F+1UJ9ph3Di7XV/le3gvFSjSpIV10/ZtfrAaH7 YQ== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by userp2120.oracle.com with ESMTP id 2xrear0dkm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 27 Jan 2020 16:37:45 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.27/8.16.0.27) with SMTP id 00RGNUiQ141851; Mon, 27 Jan 2020 16:37:45 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userp3020.oracle.com with ESMTP id 2xrytqcb61-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 27 Jan 2020 16:37:45 +0000 Received: from abhmp0017.oracle.com (abhmp0017.oracle.com [141.146.116.23]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 00RGbhMG027276; Mon, 27 Jan 2020 16:37:43 GMT Received: from ol7.uk.oracle.com (/10.175.203.109) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 27 Jan 2020 08:37:43 -0800 From: Liam Merwick To: alex.bennee@linaro.org, fam@euphon.net, philmd@redhat.com Subject: [PATCH 5/6] tests/boot_linux_console: add extract_from_rpm method Date: Mon, 27 Jan 2020 16:36:33 +0000 Message-Id: <1580142994-1836-6-git-send-email-liam.merwick@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1580142994-1836-1-git-send-email-liam.merwick@oracle.com> References: <1580142994-1836-1-git-send-email-liam.merwick@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9513 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=789 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1911140001 definitions=main-2001270138 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9513 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=858 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1911140001 definitions=main-2001270138 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 156.151.31.85 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+incoming=patchwork.ozlabs.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é --- tests/acceptance/boot_linux_console.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot_linux_console.py index 43bc928b03a2..6af19ae3b14a 100644 --- a/tests/acceptance/boot_linux_console.py +++ b/tests/acceptance/boot_linux_console.py @@ -51,6 +51,20 @@ class BootLinuxConsole(Test): os.chdir(cwd) return self.workdir + path + def extract_from_rpm(self, rpm, path): + """ + Extracts a file from a 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 extracted + :returns: path of the extracted file + """ + cwd = os.getcwd() + os.chdir(self.workdir) + process.run("rpm2cpio %s | cpio -id %s" % (rpm, path), shell=True) + os.chdir(cwd) + return self.workdir + '/' + path + def do_test_x86_64_machine(self): """ :avocado: tags=arch:x86_64