From: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
To: Willian Rampazzo <wrampazz@redhat.com>
Cc: Laurent Vivier <laurent@vivier.eu>,
qemu-arm <qemu-arm@nongnu.org>,
qemu-devel <qemu-devel@nongnu.org>, Warner Losh <imp@bsdimp.com>,
Wainer dos Santos Moschetta <wainersm@redhat.com>
Subject: Re: [PATCH v4 1/6] tests/acceptance: Extract QemuBaseTest from Test
Date: Mon, 1 Nov 2021 23:41:18 +0100 [thread overview]
Message-ID: <481299ee-a0db-1b2c-1ef3-e25d8a7bba38@amsat.org> (raw)
In-Reply-To: <CAKJDGDZ0S1f26T3J6ajJ++5cGBNCQveisVvqf2WhXCy8EPsnCA@mail.gmail.com>
On 11/1/21 19:01, Willian Rampazzo wrote:
> On Mon, Sep 27, 2021 at 1:31 PM Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:
>>
>> The Avocado Test::fetch_asset() is handy to download artifacts
>> before running tests. The current class is named Test but only
>> tests system emulation. As we want to test user emulation,
>> refactor the common code as QemuBaseTest.
>>
>> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
>> ---
>> tests/acceptance/avocado_qemu/__init__.py | 72 +++++++++++++----------
>> 1 file changed, 41 insertions(+), 31 deletions(-)
>>
>> diff --git a/tests/acceptance/avocado_qemu/__init__.py b/tests/acceptance/avocado_qemu/__init__.py
>> index 2c4fef3e149..8fcbed74849 100644
>> --- a/tests/acceptance/avocado_qemu/__init__.py
>> +++ b/tests/acceptance/avocado_qemu/__init__.py
>> @@ -175,7 +175,7 @@ def exec_command_and_wait_for_pattern(test, command,
>> """
>> _console_interaction(test, success_message, failure_message, command + '\r')
>>
>> -class Test(avocado.Test):
>> +class QemuBaseTest(avocado.Test):
>> def _get_unique_tag_val(self, tag_name):
>> """
>> Gets a tag value, if unique for a key
>> @@ -185,6 +185,46 @@ def _get_unique_tag_val(self, tag_name):
>> return vals.pop()
>> return None
>>
>> + def setUp(self):
>> + self.arch = self.params.get('arch',
>> + default=self._get_unique_tag_val('arch'))
>> +
>> + self.cpu = self.params.get('cpu',
>> + default=self._get_unique_tag_val('cpu'))
>> +
>> + default_qemu_bin = pick_default_qemu_bin(arch=self.arch)
>> + self.qemu_bin = self.params.get('qemu_bin',
>> + default=default_qemu_bin)
>> + if self.qemu_bin is None:
>> + self.cancel("No QEMU binary defined or found in the build tree")
>> +
>> + def fetch_asset(self, name,
>> + asset_hash=None, algorithm=None,
>> + locations=None, expire=None,
>> + find_only=False, cancel_on_missing=True):
>> + return super(QemuBaseTest, self).fetch_asset(name,
>
> It is preferable to use the PEP3135
> (https://www.python.org/dev/peps/pep-3135/) when calling `super` as
> linter are complaining about it:
>
> return super().fetch_asset(name,
>
> And after reading through the patch I noticed it was a method move,
> so, feel free to take the suggestion or ignore it for now.
This series was sent before commit 14f02d8a9ec ("Merge
'integration-testing-20210927' into staging") :/
I'll modify, thanks.
next prev parent reply other threads:[~2021-11-01 22:48 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-27 16:31 [PATCH v4 0/6] tests/acceptance: Add bFLT loader linux-user test Philippe Mathieu-Daudé
2021-09-27 16:31 ` [PATCH v4 1/6] tests/acceptance: Extract QemuBaseTest from Test Philippe Mathieu-Daudé
2021-11-01 18:01 ` Willian Rampazzo
2021-11-01 22:41 ` Philippe Mathieu-Daudé [this message]
2021-09-27 16:31 ` [PATCH v4 2/6] tests/acceptance: Make pick_default_qemu_bin() more generic Philippe Mathieu-Daudé
2021-11-01 18:52 ` Willian Rampazzo
2021-09-27 16:31 ` [PATCH v4 3/6] tests/acceptance: Introduce QemuUserTest base class Philippe Mathieu-Daudé
2021-11-01 18:59 ` Willian Rampazzo
2021-09-27 16:31 ` [PATCH v4 4/6] tests/acceptance: Share useful helpers from virtiofs_submounts test Philippe Mathieu-Daudé
2021-11-01 19:07 ` Willian Rampazzo
2021-09-27 16:31 ` [PATCH v4 5/6] tests/acceptance: Add bFLT loader linux-user test Philippe Mathieu-Daudé
2021-11-01 17:51 ` Willian Rampazzo
2021-11-01 22:41 ` Philippe Mathieu-Daudé
2021-09-27 16:31 ` [PATCH v4 6/6] tests/acceptance: Rename avocado_qemu.Test -> QemuSystemTest Philippe Mathieu-Daudé
2021-11-01 19:11 ` Willian Rampazzo
2021-11-01 22:42 ` Philippe Mathieu-Daudé
2021-10-25 13:44 ` [PATCH v4 0/6] tests/acceptance: Add bFLT loader linux-user test 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=481299ee-a0db-1b2c-1ef3-e25d8a7bba38@amsat.org \
--to=f4bug@amsat.org \
--cc=imp@bsdimp.com \
--cc=laurent@vivier.eu \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=wainersm@redhat.com \
--cc=wrampazz@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).