diff mbox series

[v2,19/29] tests/acceptance/virtio_check_params: Only test Xen as superuser

Message ID 20200129212345.20547-20-philmd@redhat.com (mailing list archive)
State New, archived
Headers show
Series tests/acceptance/virtio_seg_max_adjust: Restrict it to Linux/X86 | expand

Commit Message

Philippe Mathieu-Daudé Jan. 29, 2020, 9:23 p.m. UTC
When running the test unprivileged, we get:

  $ avocado --show=app,machine run tests/acceptance/virtio_check_params.py
  JOB ID     : b631d5d692e49b791b211d33b80730315d561d45
  JOB LOG    : job-results/job-2020-01-22T17.56-b631d5d/job.log
   (1/1) tests/acceptance/virtio_check_params.py:VirtioMaxSegSettingsCheck.test_machine_types:
  machine: {'name': 'pc-i440fx-2.12', 'seg_max_adjust': 'false', 'device': 'virtio-scsi-pci'}
  machine: {'name': 'pc-i440fx-2.0', 'seg_max_adjust': 'false', 'device': 'virtio-scsi-pci'}
  machine: {'name': 'xenpv', 'seg_max_adjust': 'false', 'device': 'virtio-scsi-pci'}
  FAIL: machine type xenpv: <class 'qemu.qmp.QMPConnectError'> (0.40 s)

Looking at the job.log file we find:

  xencall: error: Could not obtain handle on privileged command interface: No such file or directory
  xen be core: xen be core: can't open xen interface

Do not run this test on Xen machines if not superuser.

Acked-by: Cornelia Huck <cohuck@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 tests/acceptance/virtio_check_params.py | 2 ++
 1 file changed, 2 insertions(+)

Comments

Cornelia Huck Jan. 30, 2020, 12:37 p.m. UTC | #1
On Wed, 29 Jan 2020 22:23:35 +0100
Philippe Mathieu-Daudé <philmd@redhat.com> wrote:

> When running the test unprivileged, we get:
> 
>   $ avocado --show=app,machine run tests/acceptance/virtio_check_params.py
>   JOB ID     : b631d5d692e49b791b211d33b80730315d561d45
>   JOB LOG    : job-results/job-2020-01-22T17.56-b631d5d/job.log
>    (1/1) tests/acceptance/virtio_check_params.py:VirtioMaxSegSettingsCheck.test_machine_types:
>   machine: {'name': 'pc-i440fx-2.12', 'seg_max_adjust': 'false', 'device': 'virtio-scsi-pci'}
>   machine: {'name': 'pc-i440fx-2.0', 'seg_max_adjust': 'false', 'device': 'virtio-scsi-pci'}
>   machine: {'name': 'xenpv', 'seg_max_adjust': 'false', 'device': 'virtio-scsi-pci'}
>   FAIL: machine type xenpv: <class 'qemu.qmp.QMPConnectError'> (0.40 s)
> 
> Looking at the job.log file we find:
> 
>   xencall: error: Could not obtain handle on privileged command interface: No such file or directory
>   xen be core: xen be core: can't open xen interface
> 
> Do not run this test on Xen machines if not superuser.
> 
> Acked-by: Cornelia Huck <cohuck@redhat.com>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
>  tests/acceptance/virtio_check_params.py | 2 ++
>  1 file changed, 2 insertions(+)

I still think changing the title to "Test Xen only as superuser" would
be an improvement.
Philippe Mathieu-Daudé Jan. 30, 2020, 1:29 p.m. UTC | #2
On 1/30/20 1:37 PM, Cornelia Huck wrote:
> On Wed, 29 Jan 2020 22:23:35 +0100
> Philippe Mathieu-Daudé <philmd@redhat.com> wrote:
> 
>> When running the test unprivileged, we get:
>>
>>    $ avocado --show=app,machine run tests/acceptance/virtio_check_params.py
>>    JOB ID     : b631d5d692e49b791b211d33b80730315d561d45
>>    JOB LOG    : job-results/job-2020-01-22T17.56-b631d5d/job.log
>>     (1/1) tests/acceptance/virtio_check_params.py:VirtioMaxSegSettingsCheck.test_machine_types:
>>    machine: {'name': 'pc-i440fx-2.12', 'seg_max_adjust': 'false', 'device': 'virtio-scsi-pci'}
>>    machine: {'name': 'pc-i440fx-2.0', 'seg_max_adjust': 'false', 'device': 'virtio-scsi-pci'}
>>    machine: {'name': 'xenpv', 'seg_max_adjust': 'false', 'device': 'virtio-scsi-pci'}
>>    FAIL: machine type xenpv: <class 'qemu.qmp.QMPConnectError'> (0.40 s)
>>
>> Looking at the job.log file we find:
>>
>>    xencall: error: Could not obtain handle on privileged command interface: No such file or directory
>>    xen be core: xen be core: can't open xen interface
>>
>> Do not run this test on Xen machines if not superuser.
>>
>> Acked-by: Cornelia Huck <cohuck@redhat.com>
>> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
>> ---
>>   tests/acceptance/virtio_check_params.py | 2 ++
>>   1 file changed, 2 insertions(+)
> 
> I still think changing the title to "Test Xen only as superuser" would
> be an improvement.

If it fits the 72chars in patch subject, I'm happy to change :)
diff mbox series

Patch

diff --git a/tests/acceptance/virtio_check_params.py b/tests/acceptance/virtio_check_params.py
index f679b0eec7..ad736bcda3 100755
--- a/tests/acceptance/virtio_check_params.py
+++ b/tests/acceptance/virtio_check_params.py
@@ -118,6 +118,8 @@  class VirtioMaxSegSettingsCheck(Test):
 
     def test_machine_types(self):
         EXCLUDED_MACHINES = ['none', 'isapc', 'microvm']
+        if os.geteuid() != 0:
+            EXCLUDED_MACHINES += ['xenfv', 'xenpv']
         # collect all machine types except the ones in EXCLUDED_MACHINES
         with QEMUMachine(self.qemu_bin) as vm:
             vm.launch()