qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: Liam Merwick <liam.merwick@oracle.com>,
	alex.bennee@linaro.org, fam@euphon.net
Cc: qemu-devel@nongnu.org, pbonzini@redhat.com, wainersm@redhat.com,
	slp@redhat.com, sgarzare@redhat.com
Subject: Re: [PATCH v2 4/6] tests/boot_linux_console: add extract_from_rpm method
Date: Thu, 6 Feb 2020 15:27:14 +0100	[thread overview]
Message-ID: <c7403e08-e18e-c914-b9b3-1de158cc5fca@redhat.com> (raw)
In-Reply-To: <1580914565-19675-5-git-send-email-liam.merwick@oracle.com>

On 2/5/20 3:56 PM, Liam Merwick wrote:
> 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 <liam.merwick@oracle.com>
> Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
>   tests/acceptance/boot_linux_console.py | 16 ++++++++++++++++
>   1 file changed, 16 insertions(+)
> 
> diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot_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
>   
> +    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 extracted
> +                     needs to be a relative path (starting with './') because
> +                     cpio(1), which is used to extract the file, expects that.
> +        :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 os.path.normpath(os.path.join(self.workdir, path))
> +
>       def do_test_x86_64_machine(self):
>           """
>           Common routine to boot an x86_64 guest.
> 

Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>



  reply	other threads:[~2020-02-06 14:31 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é [this message]
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 ` [PATCH v2 6/6] tests/boot_linux_console: use os.path for filesystem paths Liam Merwick
2020-02-06 14:26   ` 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=c7403e08-e18e-c914-b9b3-1de158cc5fca@redhat.com \
    --to=philmd@redhat.com \
    --cc=alex.bennee@linaro.org \
    --cc=fam@euphon.net \
    --cc=liam.merwick@oracle.com \
    --cc=pbonzini@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).