[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 07/22] tests/acceptance/virtiofs_submounts.py: evaluate strin
From: |
Alex Bennée |
Subject: |
Re: [PATCH 07/22] tests/acceptance/virtiofs_submounts.py: evaluate string not length |
Date: |
Thu, 04 Feb 2021 13:23:21 +0000 |
User-agent: |
mu4e 1.5.7; emacs 28.0.50 |
Cleber Rosa <crosa@redhat.com> writes:
> If the vmlinuz variable is set to anything that evaluates to True,
> then the respective arguments should be set. If the variable contains
> an empty string, than it will evaluate to False, and the extra
> arguments will not be set.
>
> This keeps the same logic, but improves readability a bit.
>
> Signed-off-by: Cleber Rosa <crosa@redhat.com>
> ---
> tests/acceptance/virtiofs_submounts.py | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tests/acceptance/virtiofs_submounts.py
> b/tests/acceptance/virtiofs_submounts.py
> index f1b49f03bb..f25a386a19 100644
> --- a/tests/acceptance/virtiofs_submounts.py
> +++ b/tests/acceptance/virtiofs_submounts.py
> @@ -241,7 +241,7 @@ class VirtiofsSubmountsTest(BootLinux):
>
> super(VirtiofsSubmountsTest, self).setUp(pubkey)
>
> - if len(vmlinuz) > 0:
> + if vmlinuz:
> self.vm.add_args('-kernel', vmlinuz,
> '-append', 'console=ttyS0 root=/dev/sda1')
And this is were I gave up because I can't see how to run the test:
./tests/venv/bin/avocado run ./tests/acceptance/virtiofs_submounts.py
JOB ID : b3d9bfcfcd603189a471bec7d770fca3b50a81ee
JOB LOG :
/home/alex/avocado/job-results/job-2021-02-04T13.21-b3d9bfc/job.log
(1/5)
./tests/acceptance/virtiofs_submounts.py:VirtiofsSubmountsTest.test_pre_virtiofsd_set_up:
CANCEL: vmlinuz parameter not set; you must point it to a Linux kernel binary
to test (to run this test with the on-image kernel, set it to an empty string)
(0.00 s)
(2/5)
./tests/acceptance/virtiofs_submounts.py:VirtiofsSubmountsTest.test_pre_launch_set_up:
CANCEL: vmlinuz parameter not set; you must point it to a Linux kernel binary
to test (to run this test with the on-image kernel, set it to an empty string)
(0.00 s)
(3/5)
./tests/acceptance/virtiofs_submounts.py:VirtiofsSubmountsTest.test_post_launch_set_up:
CANCEL: vmlinuz parameter not set; you must point it to a Linux kernel binary
to test (to run this test with the on-image kernel, set it to an empty
string) (0.00 s)
(4/5)
./tests/acceptance/virtiofs_submounts.py:VirtiofsSubmountsTest.test_post_mount_set_up:
CANCEL: vmlinuz parameter not set; you must point it to a Linux kernel binary
to test (to run this test with the on-image kernel, set it to an empty string)
(0.00 s)
(5/5)
./tests/acceptance/virtiofs_submounts.py:VirtiofsSubmountsTest.test_two_runs:
CANCEL: vmlinuz parameter not set; you must point it to a Linux kernel binary
to test (to run this test with the on-image kernel, set it to an empty string)
(0.00 s)
RESULTS : PASS 0 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 |
CANCEL 5
JOB TIME : 0.56 s
Given the test seems to make assumptions about an environment being
setup for it I think we need some documentation somewhere about what
those pre-requisites are. FWIW I also had the following locally applied
to workaround the fact the losetup and mkfs.xfs binaries aren't visible
to normal users.
modified tests/acceptance/virtiofs_submounts.py
@@ -173,7 +173,10 @@ class VirtiofsSubmountsTest(LinuxTest):
self.run(('bash', self.get_data('cleanup.sh'), scratch_dir))
@skipUnless(*has_cmds(('sudo -n', ('sudo', '-n', 'true')),
- 'ssh-keygen', 'bash', 'losetup', 'mkfs.xfs',
'mount'))
+ 'ssh-keygen', 'bash',
+ ('losetup', ('sudo', '-n', 'losetup')),
+ ('mkfs.xfs', ('sudo', '-n', 'which', 'mkfs.xfs')),
+ 'mount'))
def setUp(self):
vmlinuz = self.params.get('vmlinuz')
if vmlinuz is None:
--
Alex Bennée
- Re: [PATCH 13/22] tests/acceptance/virtiofs_submounts.py: add missing accel tag, (continued)
- [PATCH 06/22] tests/acceptance/virtiofs_submounts.py: use a virtio-net device instead, Cleber Rosa, 2021/02/03
- [PATCH 14/22] Acceptance Tests: introduce LinuxTest base class, Cleber Rosa, 2021/02/03
- [PATCH 07/22] tests/acceptance/virtiofs_submounts.py: evaluate string not length, Cleber Rosa, 2021/02/03
- Re: [PATCH 07/22] tests/acceptance/virtiofs_submounts.py: evaluate string not length, Beraldo Leal, 2021/02/04
- Re: [PATCH 07/22] tests/acceptance/virtiofs_submounts.py: evaluate string not length,
Alex Bennée <=
- Re: [PATCH 07/22] tests/acceptance/virtiofs_submounts.py: evaluate string not length, Max Reitz, 2021/02/09
- Re: [PATCH 07/22] tests/acceptance/virtiofs_submounts.py: evaluate string not length, Alex Bennée, 2021/02/09
- Re: [PATCH 07/22] tests/acceptance/virtiofs_submounts.py: evaluate string not length, Max Reitz, 2021/02/09
- Re: [PATCH 07/22] tests/acceptance/virtiofs_submounts.py: evaluate string not length, Alex Bennée, 2021/02/09
- Re: [PATCH 07/22] tests/acceptance/virtiofs_submounts.py: evaluate string not length, Max Reitz, 2021/02/09
- Re: [PATCH 07/22] tests/acceptance/virtiofs_submounts.py: evaluate string not length, Alex Bennée, 2021/02/09
- Re: [PATCH 07/22] tests/acceptance/virtiofs_submounts.py: evaluate string not length, Philippe Mathieu-Daudé, 2021/02/09
- Re: [PATCH 07/22] tests/acceptance/virtiofs_submounts.py: evaluate string not length, Cleber Rosa, 2021/02/15
[PATCH 18/22] Acceptance Tests: set up existing ssh keys by default, Cleber Rosa, 2021/02/03