All of lore.kernel.org
 help / color / mirror / Atom feed
From: Liam Merwick <liam.merwick@oracle.com>
To: alex.bennee@linaro.org, fam@euphon.net, philmd@redhat.com
Cc: slp@redhat.com, qemu-devel@nongnu.org, wainersm@redhat.com,
	pbonzini@redhat.com, sgarzare@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	[thread overview]
Message-ID: <1580914565-19675-7-git-send-email-liam.merwick@oracle.com> (raw)
In-Reply-To: <1580914565-19675-1-git-send-email-liam.merwick@oracle.com>

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 <wainersm@redhat.com>
Signed-off-by: Liam Merwick <liam.merwick@oracle.com>
---
 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):
         """
-- 
1.8.3.1



  parent reply	other threads:[~2020-02-05 14:57 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-05 14:55 [PATCH v2 0/6] tests/boot_linux_console: add extra boot acceptance tests Liam Merwick
2020-02-05 14:56 ` [PATCH v2 1/6] tests/boot_linux_console: add microvm acceptance test Liam Merwick
2020-02-06 13:57   ` Philippe Mathieu-Daudé
2020-02-06 14:09     ` Philippe Mathieu-Daudé
2020-02-06 15:05       ` Liam Merwick
2020-02-19 19:02         ` Wainer dos Santos Moschetta
2020-02-05 14:56 ` [PATCH v2 2/6] tests/boot_linux_console: add BIOS " Liam Merwick
2020-02-06 14:12   ` Philippe Mathieu-Daudé
2020-02-19 19:20     ` Wainer dos Santos Moschetta
2020-02-26 17:36       ` Liam Merwick
2020-02-05 14:56 ` [PATCH v2 3/6] travis.yml: install rpm2cpio for acceptance tests Liam Merwick
2020-02-06 14:27   ` Philippe Mathieu-Daudé
2020-02-05 14:56 ` [PATCH v2 4/6] tests/boot_linux_console: add extract_from_rpm method Liam Merwick
2020-02-06 14:27   ` Philippe Mathieu-Daudé
2020-02-05 14:56 ` [PATCH v2 5/6] tests/boot_linux_console: add PVH acceptance tests Liam Merwick
2020-02-06 14:24   ` Philippe Mathieu-Daudé
2020-02-05 14:56 ` Liam Merwick [this message]
2020-02-06 14:26   ` [PATCH v2 6/6] tests/boot_linux_console: use os.path for filesystem paths Philippe Mathieu-Daudé
2020-02-06 15:24 ` [PATCH v2 0/6] tests/boot_linux_console: add extra boot acceptance tests Philippe Mathieu-Daudé

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1580914565-19675-7-git-send-email-liam.merwick@oracle.com \
    --to=liam.merwick@oracle.com \
    --cc=alex.bennee@linaro.org \
    --cc=fam@euphon.net \
    --cc=pbonzini@redhat.com \
    --cc=philmd@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=sgarzare@redhat.com \
    --cc=slp@redhat.com \
    --cc=wainersm@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.