From patchwork Wed Feb 5 14:56:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Liam Merwick X-Patchwork-Id: 11366435 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AAC4314E3 for ; Wed, 5 Feb 2020 14:57:25 +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 8224121741 for ; Wed, 5 Feb 2020 14:57:25 +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="CwoTmWI7" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8224121741 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:49056 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1izM7I-0007GN-Lg for patchwork-qemu-devel@patchwork.kernel.org; Wed, 05 Feb 2020 09:57:24 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44527) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1izM6Y-0005h7-TQ for qemu-devel@nongnu.org; Wed, 05 Feb 2020 09:56:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1izM6X-00057A-Sp for qemu-devel@nongnu.org; Wed, 05 Feb 2020 09:56:38 -0500 Received: from aserp2120.oracle.com ([141.146.126.78]:52862) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1izM6X-0004nC-Ja for qemu-devel@nongnu.org; Wed, 05 Feb 2020 09:56:37 -0500 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.27/8.16.0.27) with SMTP id 015ErMPV164944; Wed, 5 Feb 2020 14:56:28 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=944UcjO2I/pv72T/OAJrlXdTeg/JyrAktvdNeSTEef4=; b=CwoTmWI7SVEAmwTikutoZHcx2ZZJOkYiqwjRuxHr0ZX7BNzwvZNkOUFbP6Pg4/1gMtm8 025FKLEuK0MsQx/5Tm5PCMJ6aZBBMHr9fJmAgW+6sCuS7Ai29WhINel+oIhE1HBwB2ve uagcPz9MZgmQUkQAk+ABMgdCOSU2iyQBobNvhfp2NeuOVMeShHxF/6u/HjmP/QivG5GJ mBNdYbFmkWszw2mdfEI5ndzNQ1Xb/ed9sxJuu9g/zosvz/SuqKRT/0VFoFs2hb7utLxr Eokj6+1L8itkasXIsr8q6GH9MsMP0CS2GCVQlL8TA8rA8q2bexbvPiN7QUetZ5ihk7/2 bw== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by aserp2120.oracle.com with ESMTP id 2xykbp3h99-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 05 Feb 2020 14:56:28 +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 015EsCEX158884; Wed, 5 Feb 2020 14:56:27 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userp3020.oracle.com with ESMTP id 2xykc31wtm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 05 Feb 2020 14:56:27 +0000 Received: from abhmp0013.oracle.com (abhmp0013.oracle.com [141.146.116.19]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 015EuQeI029164; Wed, 5 Feb 2020 14:56:26 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:25 -0800 From: Liam Merwick To: alex.bennee@linaro.org, fam@euphon.net, philmd@redhat.com Subject: [PATCH v2 6/6] tests/boot_linux_console: use os.path for filesystem paths Date: Wed, 5 Feb 2020 14:56:05 +0000 Message-Id: <1580914565-19675-7-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> 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=618 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=688 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1911140001 definitions=main-2002050118 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 141.146.126.78 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Change extract_from_deb() to use os.path routines to manipulate the filesystem path returned when extracting a file. Suggested-by: Wainer dos Santos Moschetta Signed-off-by: Liam Merwick Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé --- tests/acceptance/boot_linux_console.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot_linux_console.py index 9c55218cb5bb..434608f12027 100644 --- a/tests/acceptance/boot_linux_console.py +++ b/tests/acceptance/boot_linux_console.py @@ -49,7 +49,12 @@ class BootLinuxConsole(Test): process.run("ar x %s %s" % (deb, file_path)) archive.extract(file_path, self.workdir) os.chdir(cwd) - return self.workdir + path + # Return complete path to extracted file. Because callers to + # extract_from_deb() specify 'path' with a leading slash, it is + # necessary to use os.path.relpath() as otherwise os.path.join() + # interprets it as an absolute path and drops the self.workdir part. + return os.path.normpath(os.path.join(self.workdir, + os.path.relpath(path, '/'))) def extract_from_rpm(self, rpm, path): """