diff mbox series

[6/6] tests/acceptance/virtio_seg_max_adjust: Restrict to Linux host

Message ID 20200122223247.30419-7-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. 22, 2020, 10:32 p.m. UTC
This test is failing on OSX:

  TestFail: machine type pc-i440fx-2.0: <class 'TypeError'>

Looking at the job.log:

  Unexpected error in object_property_find() at qom/object.c:1201:
  qemu-system-x86_64: -device virtio-blk-pci,id=scsi0,drive=drive0: can't apply global virtio-blk-device.scsi=true: Property '.scsi' not found

Which makes sense looking at hw/block/virtio-blk.c:

  1261 static Property virtio_blk_properties[] = {
  1262     DEFINE_BLOCK_PROPERTIES(VirtIOBlock, conf.conf),
  ...
  1268 #ifdef __linux__
  1269     DEFINE_PROP_BIT64("scsi", VirtIOBlock, host_features,
  1270                       VIRTIO_BLK_F_SCSI, false),
  1271 #endif

Fix by only running this test on a Linux host:

 (38/55) tests/acceptance/virtio_seg_max_adjust.py:VirtioMaxSegSettingsCheck.test_machine_types:  SKIP: Host OS is not Linux

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 tests/acceptance/virtio_seg_max_adjust.py | 3 +++
 1 file changed, 3 insertions(+)

Comments

Cornelia Huck Jan. 23, 2020, 11:51 a.m. UTC | #1
On Wed, 22 Jan 2020 23:32:47 +0100
Philippe Mathieu-Daudé <philmd@redhat.com> wrote:

> This test is failing on OSX:
> 
>   TestFail: machine type pc-i440fx-2.0: <class 'TypeError'>
> 
> Looking at the job.log:
> 
>   Unexpected error in object_property_find() at qom/object.c:1201:
>   qemu-system-x86_64: -device virtio-blk-pci,id=scsi0,drive=drive0: can't apply global virtio-blk-device.scsi=true: Property '.scsi' not found
> 
> Which makes sense looking at hw/block/virtio-blk.c:
> 
>   1261 static Property virtio_blk_properties[] = {
>   1262     DEFINE_BLOCK_PROPERTIES(VirtIOBlock, conf.conf),
>   ...
>   1268 #ifdef __linux__
>   1269     DEFINE_PROP_BIT64("scsi", VirtIOBlock, host_features,
>   1270                       VIRTIO_BLK_F_SCSI, false),
>   1271 #endif
> 
> Fix by only running this test on a Linux host:
> 
>  (38/55) tests/acceptance/virtio_seg_max_adjust.py:VirtioMaxSegSettingsCheck.test_machine_types:  SKIP: Host OS is not Linux

Does this work with the change I proposed in the other thread? If it
does, I'd prefer to send a proper fix for that. (Well, I'd prefer to
fix it regardless.)

Or is there other Linux-specific stuff in there? Does not look like it
at a glance, we were just bitten by the unrelated scsi property thing.

> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
>  tests/acceptance/virtio_seg_max_adjust.py | 3 +++
>  1 file changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/tests/acceptance/virtio_seg_max_adjust.py b/tests/acceptance/virtio_seg_max_adjust.py
index 2fc6bfcbd8..f8fd03e3b6 100755
--- a/tests/acceptance/virtio_seg_max_adjust.py
+++ b/tests/acceptance/virtio_seg_max_adjust.py
@@ -27,6 +27,7 @@  sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..', 'python'))
 from qemu.machine import QEMUMachine
 from avocado_qemu import Test
 from avocado.core.exceptions import TestSkipError
+from avocado import skipUnless
 
 #list of machine types and virtqueue properties to test
 VIRTIO_SCSI_PROPS = {'seg_max_adjust': 'seg_max_adjust'}
@@ -117,6 +118,8 @@  class VirtioMaxSegSettingsCheck(Test):
             return True
         return False
 
+
+    @skipUnless(sys.platform.startswith('linux'), 'Host OS is not Linux')
     def test_machine_types(self):
         """
         :avocado: tags=arch:i386