All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] tests/acceptance: enhance s390x devices test
@ 2020-11-30 18:02 Cornelia Huck
  2020-11-30 18:02 ` [PATCH 1/3] tests/acceptance: test virtio-ccw revision handling Cornelia Huck
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Cornelia Huck @ 2020-11-30 18:02 UTC (permalink / raw)
  To: qemu-devel
  Cc: Thomas Huth, Cornelia Huck, Wainer dos Santos Moschetta,
	Halil Pasic, Christian Borntraeger, qemu-s390x, Cleber Rosa,
	Philippe Mathieu-Daudé

This series builds upon the new s390x acceptance test currently
queued on my s390-next branch.

Sadly, the kernel/initrd I'm using does not have the virtio-net driver,
so I cannot test things like mac address specification etc. Instead,
I added some quick checks regarding legacy virtio and propagation of
device type and fid properties.

Next up: maybe some device plug/unplug tests; but I still need to find
some inspiration there.

[And yes, I know that checkpatch moans about long lines -- hard to avoid
if you use a function with a very long name.]

Cornelia Huck (3):
  tests/acceptance: test virtio-ccw revision handling
  tests/acceptance: verify s390x device detection
  tests/acceptance: test s390x zpci fid propagation

 tests/acceptance/machine_s390_ccw_virtio.py | 41 ++++++++++++++++++---
 1 file changed, 36 insertions(+), 5 deletions(-)


base-commit: 875a99a0354211276b6daf635427b3c52a025790
-- 
2.26.2



^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH 1/3] tests/acceptance: test virtio-ccw revision handling
  2020-11-30 18:02 [PATCH 0/3] tests/acceptance: enhance s390x devices test Cornelia Huck
@ 2020-11-30 18:02 ` Cornelia Huck
  2020-12-01 10:43   ` Thomas Huth
  2020-12-04 13:36   ` Wainer dos Santos Moschetta
  2020-11-30 18:02 ` [PATCH 2/3] tests/acceptance: verify s390x device detection Cornelia Huck
                   ` (2 subsequent siblings)
  3 siblings, 2 replies; 13+ messages in thread
From: Cornelia Huck @ 2020-11-30 18:02 UTC (permalink / raw)
  To: qemu-devel
  Cc: Thomas Huth, Cornelia Huck, Wainer dos Santos Moschetta,
	Halil Pasic, Christian Borntraeger, qemu-s390x, Cleber Rosa,
	Philippe Mathieu-Daudé

The max_revision prop of virtio-ccw devices can be used to force
an older revision for compatibility handling. The easiest way to
check this is to force a device to revision 0, which turns off
virtio-1.

Signed-off-by: Cornelia Huck <cohuck@redhat.com>
---
 tests/acceptance/machine_s390_ccw_virtio.py | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/tests/acceptance/machine_s390_ccw_virtio.py b/tests/acceptance/machine_s390_ccw_virtio.py
index db6352c44434..683b6e0dac2e 100644
--- a/tests/acceptance/machine_s390_ccw_virtio.py
+++ b/tests/acceptance/machine_s390_ccw_virtio.py
@@ -51,6 +51,10 @@ class S390CCWVirtioMachine(Test):
                          '-initrd', initrd_path,
                          '-append', kernel_command_line,
                          '-device', 'virtio-net-ccw,devno=fe.1.1111',
+                         '-device',
+                         'virtio-rng-ccw,devno=fe.2.0000,max_revision=0',
+                         '-device',
+                         'virtio-rng-ccw,devno=fe.3.1234,max_revision=2',
                          '-device', 'zpci,uid=5,target=zzz',
                          '-device', 'virtio-net-pci,id=zzz')
         self.vm.launch()
@@ -60,9 +64,19 @@ class S390CCWVirtioMachine(Test):
         # first debug shell is too early, we need to wait for device detection
         exec_command_and_wait_for_pattern(self, 'exit', shell_ready)
 
-        ccw_bus_id="0.1.1111"
+        ccw_bus_ids="0.1.1111  0.2.0000  0.3.1234"
         pci_bus_id="0005:00:00.0"
         exec_command_and_wait_for_pattern(self, 'ls /sys/bus/ccw/devices/',
-                                          ccw_bus_id)
+                                          ccw_bus_ids)
         exec_command_and_wait_for_pattern(self, 'ls /sys/bus/pci/devices/',
                                           pci_bus_id)
+        # check that the device at 0.2.0000 is in legacy mode, while the
+        # device at 0.3.1234 has the virtio-1 feature bit set
+        virtio_rng_features="0000000000000000000000000000110010000000000000000000000000000000"
+        virtio_rng_features_legacy="0000000000000000000000000000110000000000000000000000000000000000"
+        exec_command_and_wait_for_pattern(self,
+                                          'cat /sys/bus/ccw/devices/0.2.0000/virtio?/features',
+                                          virtio_rng_features_legacy)
+        exec_command_and_wait_for_pattern(self,
+                                          'cat /sys/bus/ccw/devices/0.3.1234/virtio?/features',
+                                          virtio_rng_features)
-- 
2.26.2



^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 2/3] tests/acceptance: verify s390x device detection
  2020-11-30 18:02 [PATCH 0/3] tests/acceptance: enhance s390x devices test Cornelia Huck
  2020-11-30 18:02 ` [PATCH 1/3] tests/acceptance: test virtio-ccw revision handling Cornelia Huck
@ 2020-11-30 18:02 ` Cornelia Huck
  2020-12-01 10:49   ` Thomas Huth
  2020-12-04 13:47   ` Wainer dos Santos Moschetta
  2020-11-30 18:02 ` [PATCH 3/3] tests/acceptance: test s390x zpci fid propagation Cornelia Huck
  2020-12-07 13:38 ` [PATCH 0/3] tests/acceptance: enhance s390x devices test Cornelia Huck
  3 siblings, 2 replies; 13+ messages in thread
From: Cornelia Huck @ 2020-11-30 18:02 UTC (permalink / raw)
  To: qemu-devel
  Cc: Thomas Huth, Cornelia Huck, Wainer dos Santos Moschetta,
	Halil Pasic, Christian Borntraeger, qemu-s390x, Cleber Rosa,
	Philippe Mathieu-Daudé

The kernel/initrd combination does not provide the virtio-net
driver; therefore, simply check whether the presented device type
is indeed virtio-net for the two virtio-net-{ccw,pci} devices.

Signed-off-by: Cornelia Huck <cohuck@redhat.com>
---
 tests/acceptance/machine_s390_ccw_virtio.py | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/tests/acceptance/machine_s390_ccw_virtio.py b/tests/acceptance/machine_s390_ccw_virtio.py
index 683b6e0dac2e..e203ee304264 100644
--- a/tests/acceptance/machine_s390_ccw_virtio.py
+++ b/tests/acceptance/machine_s390_ccw_virtio.py
@@ -80,3 +80,14 @@ class S390CCWVirtioMachine(Test):
         exec_command_and_wait_for_pattern(self,
                                           'cat /sys/bus/ccw/devices/0.3.1234/virtio?/features',
                                           virtio_rng_features)
+        # verify that we indeed have virtio-net devices (without having the
+        # virtio-net driver handy)
+        exec_command_and_wait_for_pattern(self,
+                                          'cat /sys/bus/ccw/devices/0.1.1111/cutype',
+                                          '3832/01')
+        exec_command_and_wait_for_pattern(self,
+                                          'cat /sys/bus/pci/devices/0005\:00\:00.0/subsystem_vendor',
+                                          '0x1af4')
+        exec_command_and_wait_for_pattern(self,
+                                          'cat /sys/bus/pci/devices/0005\:00\:00.0/subsystem_device',
+                                          '0x0001')
-- 
2.26.2



^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 3/3] tests/acceptance: test s390x zpci fid propagation
  2020-11-30 18:02 [PATCH 0/3] tests/acceptance: enhance s390x devices test Cornelia Huck
  2020-11-30 18:02 ` [PATCH 1/3] tests/acceptance: test virtio-ccw revision handling Cornelia Huck
  2020-11-30 18:02 ` [PATCH 2/3] tests/acceptance: verify s390x device detection Cornelia Huck
@ 2020-11-30 18:02 ` Cornelia Huck
  2020-12-01 10:52   ` Thomas Huth
  2020-12-04 13:50   ` Wainer dos Santos Moschetta
  2020-12-07 13:38 ` [PATCH 0/3] tests/acceptance: enhance s390x devices test Cornelia Huck
  3 siblings, 2 replies; 13+ messages in thread
From: Cornelia Huck @ 2020-11-30 18:02 UTC (permalink / raw)
  To: qemu-devel
  Cc: Thomas Huth, Cornelia Huck, Wainer dos Santos Moschetta,
	Halil Pasic, Christian Borntraeger, qemu-s390x, Cleber Rosa,
	Philippe Mathieu-Daudé

Verify that a fid specified on the command line shows up correctly
as the function_id in the guest.

Signed-off-by: Cornelia Huck <cohuck@redhat.com>
---
 tests/acceptance/machine_s390_ccw_virtio.py | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/tests/acceptance/machine_s390_ccw_virtio.py b/tests/acceptance/machine_s390_ccw_virtio.py
index e203ee304264..53b8484f8f9c 100644
--- a/tests/acceptance/machine_s390_ccw_virtio.py
+++ b/tests/acceptance/machine_s390_ccw_virtio.py
@@ -56,7 +56,9 @@ class S390CCWVirtioMachine(Test):
                          '-device',
                          'virtio-rng-ccw,devno=fe.3.1234,max_revision=2',
                          '-device', 'zpci,uid=5,target=zzz',
-                         '-device', 'virtio-net-pci,id=zzz')
+                         '-device', 'virtio-net-pci,id=zzz',
+                         '-device', 'zpci,uid=0xa,fid=12,target=serial',
+                         '-device', 'virtio-serial-pci,id=serial')
         self.vm.launch()
 
         shell_ready = "sh: can't access tty; job control turned off"
@@ -65,11 +67,11 @@ class S390CCWVirtioMachine(Test):
         exec_command_and_wait_for_pattern(self, 'exit', shell_ready)
 
         ccw_bus_ids="0.1.1111  0.2.0000  0.3.1234"
-        pci_bus_id="0005:00:00.0"
+        pci_bus_ids="0005:00:00.0  000a:00:00.0"
         exec_command_and_wait_for_pattern(self, 'ls /sys/bus/ccw/devices/',
                                           ccw_bus_ids)
         exec_command_and_wait_for_pattern(self, 'ls /sys/bus/pci/devices/',
-                                          pci_bus_id)
+                                          pci_bus_ids)
         # check that the device at 0.2.0000 is in legacy mode, while the
         # device at 0.3.1234 has the virtio-1 feature bit set
         virtio_rng_features="0000000000000000000000000000110010000000000000000000000000000000"
@@ -91,3 +93,7 @@ class S390CCWVirtioMachine(Test):
         exec_command_and_wait_for_pattern(self,
                                           'cat /sys/bus/pci/devices/0005\:00\:00.0/subsystem_device',
                                           '0x0001')
+        # check fid propagation
+        exec_command_and_wait_for_pattern(self,
+                                          'cat /sys/bus/pci/devices/000a\:00\:00.0/function_id',
+                                          '0x0000000c')
-- 
2.26.2



^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [PATCH 1/3] tests/acceptance: test virtio-ccw revision handling
  2020-11-30 18:02 ` [PATCH 1/3] tests/acceptance: test virtio-ccw revision handling Cornelia Huck
@ 2020-12-01 10:43   ` Thomas Huth
  2020-12-04 13:36   ` Wainer dos Santos Moschetta
  1 sibling, 0 replies; 13+ messages in thread
From: Thomas Huth @ 2020-12-01 10:43 UTC (permalink / raw)
  To: Cornelia Huck, qemu-devel
  Cc: Wainer dos Santos Moschetta, Halil Pasic, Christian Borntraeger,
	qemu-s390x, Cleber Rosa, Philippe Mathieu-Daudé

On 30/11/2020 19.02, Cornelia Huck wrote:
> The max_revision prop of virtio-ccw devices can be used to force
> an older revision for compatibility handling. The easiest way to
> check this is to force a device to revision 0, which turns off
> virtio-1.
> 
> Signed-off-by: Cornelia Huck <cohuck@redhat.com>
> ---
>  tests/acceptance/machine_s390_ccw_virtio.py | 18 ++++++++++++++++--
>  1 file changed, 16 insertions(+), 2 deletions(-)

Reviewed-by: Thomas Huth <thuth@redhat.com>



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 2/3] tests/acceptance: verify s390x device detection
  2020-11-30 18:02 ` [PATCH 2/3] tests/acceptance: verify s390x device detection Cornelia Huck
@ 2020-12-01 10:49   ` Thomas Huth
  2020-12-04 13:47   ` Wainer dos Santos Moschetta
  1 sibling, 0 replies; 13+ messages in thread
From: Thomas Huth @ 2020-12-01 10:49 UTC (permalink / raw)
  To: Cornelia Huck, qemu-devel
  Cc: Wainer dos Santos Moschetta, Halil Pasic, Christian Borntraeger,
	qemu-s390x, Cleber Rosa, Philippe Mathieu-Daudé

On 30/11/2020 19.02, Cornelia Huck wrote:
> The kernel/initrd combination does not provide the virtio-net
> driver; therefore, simply check whether the presented device type
> is indeed virtio-net for the two virtio-net-{ccw,pci} devices.
> 
> Signed-off-by: Cornelia Huck <cohuck@redhat.com>
> ---
>  tests/acceptance/machine_s390_ccw_virtio.py | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/tests/acceptance/machine_s390_ccw_virtio.py b/tests/acceptance/machine_s390_ccw_virtio.py
> index 683b6e0dac2e..e203ee304264 100644
> --- a/tests/acceptance/machine_s390_ccw_virtio.py
> +++ b/tests/acceptance/machine_s390_ccw_virtio.py
> @@ -80,3 +80,14 @@ class S390CCWVirtioMachine(Test):
>          exec_command_and_wait_for_pattern(self,
>                                            'cat /sys/bus/ccw/devices/0.3.1234/virtio?/features',
>                                            virtio_rng_features)
> +        # verify that we indeed have virtio-net devices (without having the
> +        # virtio-net driver handy)
> +        exec_command_and_wait_for_pattern(self,
> +                                          'cat /sys/bus/ccw/devices/0.1.1111/cutype',
> +                                          '3832/01')
> +        exec_command_and_wait_for_pattern(self,
> +                                          'cat /sys/bus/pci/devices/0005\:00\:00.0/subsystem_vendor',
> +                                          '0x1af4')
> +        exec_command_and_wait_for_pattern(self,
> +                                          'cat /sys/bus/pci/devices/0005\:00\:00.0/subsystem_device',
> +                                          '0x0001')

Reviewed-by: Thomas Huth <thuth@redhat.com>



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 3/3] tests/acceptance: test s390x zpci fid propagation
  2020-11-30 18:02 ` [PATCH 3/3] tests/acceptance: test s390x zpci fid propagation Cornelia Huck
@ 2020-12-01 10:52   ` Thomas Huth
  2020-12-04 13:50   ` Wainer dos Santos Moschetta
  1 sibling, 0 replies; 13+ messages in thread
From: Thomas Huth @ 2020-12-01 10:52 UTC (permalink / raw)
  To: Cornelia Huck, qemu-devel
  Cc: Wainer dos Santos Moschetta, Halil Pasic, Christian Borntraeger,
	qemu-s390x, Cleber Rosa, Philippe Mathieu-Daudé

On 30/11/2020 19.02, Cornelia Huck wrote:
> Verify that a fid specified on the command line shows up correctly
> as the function_id in the guest.
> 
> Signed-off-by: Cornelia Huck <cohuck@redhat.com>
> ---
>  tests/acceptance/machine_s390_ccw_virtio.py | 12 +++++++++---
>  1 file changed, 9 insertions(+), 3 deletions(-)
> 
> diff --git a/tests/acceptance/machine_s390_ccw_virtio.py b/tests/acceptance/machine_s390_ccw_virtio.py
> index e203ee304264..53b8484f8f9c 100644
> --- a/tests/acceptance/machine_s390_ccw_virtio.py
> +++ b/tests/acceptance/machine_s390_ccw_virtio.py
> @@ -56,7 +56,9 @@ class S390CCWVirtioMachine(Test):
>                           '-device',
>                           'virtio-rng-ccw,devno=fe.3.1234,max_revision=2',
>                           '-device', 'zpci,uid=5,target=zzz',
> -                         '-device', 'virtio-net-pci,id=zzz')
> +                         '-device', 'virtio-net-pci,id=zzz',
> +                         '-device', 'zpci,uid=0xa,fid=12,target=serial',
> +                         '-device', 'virtio-serial-pci,id=serial')
>          self.vm.launch()
>  
>          shell_ready = "sh: can't access tty; job control turned off"
> @@ -65,11 +67,11 @@ class S390CCWVirtioMachine(Test):
>          exec_command_and_wait_for_pattern(self, 'exit', shell_ready)
>  
>          ccw_bus_ids="0.1.1111  0.2.0000  0.3.1234"
> -        pci_bus_id="0005:00:00.0"
> +        pci_bus_ids="0005:00:00.0  000a:00:00.0"
>          exec_command_and_wait_for_pattern(self, 'ls /sys/bus/ccw/devices/',
>                                            ccw_bus_ids)
>          exec_command_and_wait_for_pattern(self, 'ls /sys/bus/pci/devices/',
> -                                          pci_bus_id)
> +                                          pci_bus_ids)
>          # check that the device at 0.2.0000 is in legacy mode, while the
>          # device at 0.3.1234 has the virtio-1 feature bit set
>          virtio_rng_features="0000000000000000000000000000110010000000000000000000000000000000"
> @@ -91,3 +93,7 @@ class S390CCWVirtioMachine(Test):
>          exec_command_and_wait_for_pattern(self,
>                                            'cat /sys/bus/pci/devices/0005\:00\:00.0/subsystem_device',
>                                            '0x0001')
> +        # check fid propagation
> +        exec_command_and_wait_for_pattern(self,
> +                                          'cat /sys/bus/pci/devices/000a\:00\:00.0/function_id',
> +                                          '0x0000000c')
> 

Reviewed-by: Thomas Huth <thuth@redhat.com>



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 1/3] tests/acceptance: test virtio-ccw revision handling
  2020-11-30 18:02 ` [PATCH 1/3] tests/acceptance: test virtio-ccw revision handling Cornelia Huck
  2020-12-01 10:43   ` Thomas Huth
@ 2020-12-04 13:36   ` Wainer dos Santos Moschetta
  2020-12-07 11:09     ` Cornelia Huck
  1 sibling, 1 reply; 13+ messages in thread
From: Wainer dos Santos Moschetta @ 2020-12-04 13:36 UTC (permalink / raw)
  To: Cornelia Huck, qemu-devel
  Cc: Thomas Huth, Halil Pasic, Christian Borntraeger, qemu-s390x,
	Cleber Rosa, Philippe Mathieu-Daudé

Hi,

On 11/30/20 3:02 PM, Cornelia Huck wrote:
> The max_revision prop of virtio-ccw devices can be used to force
> an older revision for compatibility handling. The easiest way to
> check this is to force a device to revision 0, which turns off
> virtio-1.
>
> Signed-off-by: Cornelia Huck <cohuck@redhat.com>
> ---
>   tests/acceptance/machine_s390_ccw_virtio.py | 18 ++++++++++++++++--
>   1 file changed, 16 insertions(+), 2 deletions(-)
>
> diff --git a/tests/acceptance/machine_s390_ccw_virtio.py b/tests/acceptance/machine_s390_ccw_virtio.py
> index db6352c44434..683b6e0dac2e 100644
> --- a/tests/acceptance/machine_s390_ccw_virtio.py
> +++ b/tests/acceptance/machine_s390_ccw_virtio.py
> @@ -51,6 +51,10 @@ class S390CCWVirtioMachine(Test):
>                            '-initrd', initrd_path,
>                            '-append', kernel_command_line,
>                            '-device', 'virtio-net-ccw,devno=fe.1.1111',
> +                         '-device',
> +                         'virtio-rng-ccw,devno=fe.2.0000,max_revision=0',
> +                         '-device',
> +                         'virtio-rng-ccw,devno=fe.3.1234,max_revision=2',
>                            '-device', 'zpci,uid=5,target=zzz',
>                            '-device', 'virtio-net-pci,id=zzz')
>           self.vm.launch()
> @@ -60,9 +64,19 @@ class S390CCWVirtioMachine(Test):
>           # first debug shell is too early, we need to wait for device detection
>           exec_command_and_wait_for_pattern(self, 'exit', shell_ready)
>   
> -        ccw_bus_id="0.1.1111"
> +        ccw_bus_ids="0.1.1111  0.2.0000  0.3.1234"
>           pci_bus_id="0005:00:00.0"
>           exec_command_and_wait_for_pattern(self, 'ls /sys/bus/ccw/devices/',
> -                                          ccw_bus_id)
> +                                          ccw_bus_ids)
>           exec_command_and_wait_for_pattern(self, 'ls /sys/bus/pci/devices/',
>                                             pci_bus_id)
> +        # check that the device at 0.2.0000 is in legacy mode, while the
> +        # device at 0.3.1234 has the virtio-1 feature bit set
> +        virtio_rng_features="0000000000000000000000000000110010000000000000000000000000000000"
> +        virtio_rng_features_legacy="0000000000000000000000000000110000000000000000000000000000000000"

Do something like...

virtio_rng_features="0000000000000000000000000000" + \
     "110010000000000000000000000000000000"

... and checkpatch should not complain.


Reviewed-by: Wainer dos Santos Moschetta <wainersm@redhat.com>


> +        exec_command_and_wait_for_pattern(self,
> +                                          'cat /sys/bus/ccw/devices/0.2.0000/virtio?/features',
> +                                          virtio_rng_features_legacy)
> +        exec_command_and_wait_for_pattern(self,
> +                                          'cat /sys/bus/ccw/devices/0.3.1234/virtio?/features',
> +                                          virtio_rng_features)



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 2/3] tests/acceptance: verify s390x device detection
  2020-11-30 18:02 ` [PATCH 2/3] tests/acceptance: verify s390x device detection Cornelia Huck
  2020-12-01 10:49   ` Thomas Huth
@ 2020-12-04 13:47   ` Wainer dos Santos Moschetta
  2020-12-07 11:10     ` Cornelia Huck
  1 sibling, 1 reply; 13+ messages in thread
From: Wainer dos Santos Moschetta @ 2020-12-04 13:47 UTC (permalink / raw)
  To: Cornelia Huck, qemu-devel
  Cc: Thomas Huth, Halil Pasic, Christian Borntraeger, qemu-s390x,
	Cleber Rosa, Philippe Mathieu-Daudé


On 11/30/20 3:02 PM, Cornelia Huck wrote:
> The kernel/initrd combination does not provide the virtio-net
> driver; therefore, simply check whether the presented device type
> is indeed virtio-net for the two virtio-net-{ccw,pci} devices.
>
> Signed-off-by: Cornelia Huck <cohuck@redhat.com>
> ---
>   tests/acceptance/machine_s390_ccw_virtio.py | 11 +++++++++++
>   1 file changed, 11 insertions(+)
>
> diff --git a/tests/acceptance/machine_s390_ccw_virtio.py b/tests/acceptance/machine_s390_ccw_virtio.py
> index 683b6e0dac2e..e203ee304264 100644
> --- a/tests/acceptance/machine_s390_ccw_virtio.py
> +++ b/tests/acceptance/machine_s390_ccw_virtio.py
> @@ -80,3 +80,14 @@ class S390CCWVirtioMachine(Test):
>           exec_command_and_wait_for_pattern(self,
>                                             'cat /sys/bus/ccw/devices/0.3.1234/virtio?/features',
>                                             virtio_rng_features)
> +        # verify that we indeed have virtio-net devices (without having the
> +        # virtio-net driver handy)
> +        exec_command_and_wait_for_pattern(self,
> +                                          'cat /sys/bus/ccw/devices/0.1.1111/cutype',
> +                                          '3832/01')
> +        exec_command_and_wait_for_pattern(self,
> +                                          'cat /sys/bus/pci/devices/0005\:00\:00.0/subsystem_vendor',
> +                                          '0x1af4')
> +        exec_command_and_wait_for_pattern(self,
> +                                          'cat /sys/bus/pci/devices/0005\:00\:00.0/subsystem_device',
> +                                          '0x0001')

Here I think it's ok to do...

exec_command_and_wait_for_pattern(self,
         'cat /sys/bus/ccw/devices/0.1.1111/cutype',
         '3832/01')

... so checkpatch is happy, everybody is happy.

Reviewed-by: Wainer dos Santos Moschetta <wainersm@redhat.com>




^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 3/3] tests/acceptance: test s390x zpci fid propagation
  2020-11-30 18:02 ` [PATCH 3/3] tests/acceptance: test s390x zpci fid propagation Cornelia Huck
  2020-12-01 10:52   ` Thomas Huth
@ 2020-12-04 13:50   ` Wainer dos Santos Moschetta
  1 sibling, 0 replies; 13+ messages in thread
From: Wainer dos Santos Moschetta @ 2020-12-04 13:50 UTC (permalink / raw)
  To: Cornelia Huck, qemu-devel
  Cc: Thomas Huth, Halil Pasic, Christian Borntraeger, qemu-s390x,
	Cleber Rosa, Philippe Mathieu-Daudé


On 11/30/20 3:02 PM, Cornelia Huck wrote:
> Verify that a fid specified on the command line shows up correctly
> as the function_id in the guest.
>
> Signed-off-by: Cornelia Huck <cohuck@redhat.com>
> ---
>   tests/acceptance/machine_s390_ccw_virtio.py | 12 +++++++++---
>   1 file changed, 9 insertions(+), 3 deletions(-)


Reviewed-by: Wainer dos Santos Moschetta <wainersm@redhat.com>


>
> diff --git a/tests/acceptance/machine_s390_ccw_virtio.py b/tests/acceptance/machine_s390_ccw_virtio.py
> index e203ee304264..53b8484f8f9c 100644
> --- a/tests/acceptance/machine_s390_ccw_virtio.py
> +++ b/tests/acceptance/machine_s390_ccw_virtio.py
> @@ -56,7 +56,9 @@ class S390CCWVirtioMachine(Test):
>                            '-device',
>                            'virtio-rng-ccw,devno=fe.3.1234,max_revision=2',
>                            '-device', 'zpci,uid=5,target=zzz',
> -                         '-device', 'virtio-net-pci,id=zzz')
> +                         '-device', 'virtio-net-pci,id=zzz',
> +                         '-device', 'zpci,uid=0xa,fid=12,target=serial',
> +                         '-device', 'virtio-serial-pci,id=serial')
>           self.vm.launch()
>   
>           shell_ready = "sh: can't access tty; job control turned off"
> @@ -65,11 +67,11 @@ class S390CCWVirtioMachine(Test):
>           exec_command_and_wait_for_pattern(self, 'exit', shell_ready)
>   
>           ccw_bus_ids="0.1.1111  0.2.0000  0.3.1234"
> -        pci_bus_id="0005:00:00.0"
> +        pci_bus_ids="0005:00:00.0  000a:00:00.0"
>           exec_command_and_wait_for_pattern(self, 'ls /sys/bus/ccw/devices/',
>                                             ccw_bus_ids)
>           exec_command_and_wait_for_pattern(self, 'ls /sys/bus/pci/devices/',
> -                                          pci_bus_id)
> +                                          pci_bus_ids)
>           # check that the device at 0.2.0000 is in legacy mode, while the
>           # device at 0.3.1234 has the virtio-1 feature bit set
>           virtio_rng_features="0000000000000000000000000000110010000000000000000000000000000000"
> @@ -91,3 +93,7 @@ class S390CCWVirtioMachine(Test):
>           exec_command_and_wait_for_pattern(self,
>                                             'cat /sys/bus/pci/devices/0005\:00\:00.0/subsystem_device',
>                                             '0x0001')
> +        # check fid propagation
> +        exec_command_and_wait_for_pattern(self,
> +                                          'cat /sys/bus/pci/devices/000a\:00\:00.0/function_id',
> +                                          '0x0000000c')



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 1/3] tests/acceptance: test virtio-ccw revision handling
  2020-12-04 13:36   ` Wainer dos Santos Moschetta
@ 2020-12-07 11:09     ` Cornelia Huck
  0 siblings, 0 replies; 13+ messages in thread
From: Cornelia Huck @ 2020-12-07 11:09 UTC (permalink / raw)
  To: Wainer dos Santos Moschetta
  Cc: Thomas Huth, qemu-devel, Halil Pasic, Christian Borntraeger,
	qemu-s390x, Cleber Rosa, Philippe Mathieu-Daudé

On Fri, 4 Dec 2020 10:36:33 -0300
Wainer dos Santos Moschetta <wainersm@redhat.com> wrote:

> Hi,
> 
> On 11/30/20 3:02 PM, Cornelia Huck wrote:
> > The max_revision prop of virtio-ccw devices can be used to force
> > an older revision for compatibility handling. The easiest way to
> > check this is to force a device to revision 0, which turns off
> > virtio-1.
> >
> > Signed-off-by: Cornelia Huck <cohuck@redhat.com>
> > ---
> >   tests/acceptance/machine_s390_ccw_virtio.py | 18 ++++++++++++++++--
> >   1 file changed, 16 insertions(+), 2 deletions(-)
> >
> > diff --git a/tests/acceptance/machine_s390_ccw_virtio.py b/tests/acceptance/machine_s390_ccw_virtio.py
> > index db6352c44434..683b6e0dac2e 100644
> > --- a/tests/acceptance/machine_s390_ccw_virtio.py
> > +++ b/tests/acceptance/machine_s390_ccw_virtio.py
> > @@ -51,6 +51,10 @@ class S390CCWVirtioMachine(Test):
> >                            '-initrd', initrd_path,
> >                            '-append', kernel_command_line,
> >                            '-device', 'virtio-net-ccw,devno=fe.1.1111',
> > +                         '-device',
> > +                         'virtio-rng-ccw,devno=fe.2.0000,max_revision=0',
> > +                         '-device',
> > +                         'virtio-rng-ccw,devno=fe.3.1234,max_revision=2',
> >                            '-device', 'zpci,uid=5,target=zzz',
> >                            '-device', 'virtio-net-pci,id=zzz')
> >           self.vm.launch()
> > @@ -60,9 +64,19 @@ class S390CCWVirtioMachine(Test):
> >           # first debug shell is too early, we need to wait for device detection
> >           exec_command_and_wait_for_pattern(self, 'exit', shell_ready)
> >   
> > -        ccw_bus_id="0.1.1111"
> > +        ccw_bus_ids="0.1.1111  0.2.0000  0.3.1234"
> >           pci_bus_id="0005:00:00.0"
> >           exec_command_and_wait_for_pattern(self, 'ls /sys/bus/ccw/devices/',
> > -                                          ccw_bus_id)
> > +                                          ccw_bus_ids)
> >           exec_command_and_wait_for_pattern(self, 'ls /sys/bus/pci/devices/',
> >                                             pci_bus_id)
> > +        # check that the device at 0.2.0000 is in legacy mode, while the
> > +        # device at 0.3.1234 has the virtio-1 feature bit set
> > +        virtio_rng_features="0000000000000000000000000000110010000000000000000000000000000000"
> > +        virtio_rng_features_legacy="0000000000000000000000000000110000000000000000000000000000000000"  
> 
> Do something like...
> 
> virtio_rng_features="0000000000000000000000000000" + \
>      "110010000000000000000000000000000000"
> 
> ... and checkpatch should not complain.

Yes, I can tweak it like that before queuing.

> 
> 
> Reviewed-by: Wainer dos Santos Moschetta <wainersm@redhat.com>

Thanks!

> 
> 
> > +        exec_command_and_wait_for_pattern(self,
> > +                                          'cat /sys/bus/ccw/devices/0.2.0000/virtio?/features',
> > +                                          virtio_rng_features_legacy)
> > +        exec_command_and_wait_for_pattern(self,
> > +                                          'cat /sys/bus/ccw/devices/0.3.1234/virtio?/features',
> > +                                          virtio_rng_features)  



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 2/3] tests/acceptance: verify s390x device detection
  2020-12-04 13:47   ` Wainer dos Santos Moschetta
@ 2020-12-07 11:10     ` Cornelia Huck
  0 siblings, 0 replies; 13+ messages in thread
From: Cornelia Huck @ 2020-12-07 11:10 UTC (permalink / raw)
  To: Wainer dos Santos Moschetta
  Cc: Thomas Huth, qemu-devel, Halil Pasic, Christian Borntraeger,
	qemu-s390x, Cleber Rosa, Philippe Mathieu-Daudé

On Fri, 4 Dec 2020 10:47:34 -0300
Wainer dos Santos Moschetta <wainersm@redhat.com> wrote:

> On 11/30/20 3:02 PM, Cornelia Huck wrote:
> > The kernel/initrd combination does not provide the virtio-net
> > driver; therefore, simply check whether the presented device type
> > is indeed virtio-net for the two virtio-net-{ccw,pci} devices.
> >
> > Signed-off-by: Cornelia Huck <cohuck@redhat.com>
> > ---
> >   tests/acceptance/machine_s390_ccw_virtio.py | 11 +++++++++++
> >   1 file changed, 11 insertions(+)
> >
> > diff --git a/tests/acceptance/machine_s390_ccw_virtio.py b/tests/acceptance/machine_s390_ccw_virtio.py
> > index 683b6e0dac2e..e203ee304264 100644
> > --- a/tests/acceptance/machine_s390_ccw_virtio.py
> > +++ b/tests/acceptance/machine_s390_ccw_virtio.py
> > @@ -80,3 +80,14 @@ class S390CCWVirtioMachine(Test):
> >           exec_command_and_wait_for_pattern(self,
> >                                             'cat /sys/bus/ccw/devices/0.3.1234/virtio?/features',
> >                                             virtio_rng_features)
> > +        # verify that we indeed have virtio-net devices (without having the
> > +        # virtio-net driver handy)
> > +        exec_command_and_wait_for_pattern(self,
> > +                                          'cat /sys/bus/ccw/devices/0.1.1111/cutype',
> > +                                          '3832/01')
> > +        exec_command_and_wait_for_pattern(self,
> > +                                          'cat /sys/bus/pci/devices/0005\:00\:00.0/subsystem_vendor',
> > +                                          '0x1af4')
> > +        exec_command_and_wait_for_pattern(self,
> > +                                          'cat /sys/bus/pci/devices/0005\:00\:00.0/subsystem_device',
> > +                                          '0x0001')  
> 
> Here I think it's ok to do...
> 
> exec_command_and_wait_for_pattern(self,
>          'cat /sys/bus/ccw/devices/0.1.1111/cutype',
>          '3832/01')
> 
> ... so checkpatch is happy, everybody is happy.
> 
> Reviewed-by: Wainer dos Santos Moschetta <wainersm@redhat.com>

Ok, I'll try to raise the general happiness level, then :) Thanks!



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 0/3] tests/acceptance: enhance s390x devices test
  2020-11-30 18:02 [PATCH 0/3] tests/acceptance: enhance s390x devices test Cornelia Huck
                   ` (2 preceding siblings ...)
  2020-11-30 18:02 ` [PATCH 3/3] tests/acceptance: test s390x zpci fid propagation Cornelia Huck
@ 2020-12-07 13:38 ` Cornelia Huck
  3 siblings, 0 replies; 13+ messages in thread
From: Cornelia Huck @ 2020-12-07 13:38 UTC (permalink / raw)
  To: qemu-devel
  Cc: Thomas Huth, Wainer dos Santos Moschetta, Halil Pasic,
	Christian Borntraeger, qemu-s390x, Cleber Rosa,
	Philippe Mathieu-Daudé

On Mon, 30 Nov 2020 19:02:13 +0100
Cornelia Huck <cohuck@redhat.com> wrote:

> This series builds upon the new s390x acceptance test currently
> queued on my s390-next branch.
> 
> Sadly, the kernel/initrd I'm using does not have the virtio-net driver,
> so I cannot test things like mac address specification etc. Instead,
> I added some quick checks regarding legacy virtio and propagation of
> device type and fid properties.
> 
> Next up: maybe some device plug/unplug tests; but I still need to find
> some inspiration there.
> 
> [And yes, I know that checkpatch moans about long lines -- hard to avoid
> if you use a function with a very long name.]
> 
> Cornelia Huck (3):
>   tests/acceptance: test virtio-ccw revision handling
>   tests/acceptance: verify s390x device detection
>   tests/acceptance: test s390x zpci fid propagation
> 
>  tests/acceptance/machine_s390_ccw_virtio.py | 41 ++++++++++++++++++---
>  1 file changed, 36 insertions(+), 5 deletions(-)
> 
> 
> base-commit: 875a99a0354211276b6daf635427b3c52a025790

Queued to s390-next (with some overlong lines fixed up.)



^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2020-12-07 13:39 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-30 18:02 [PATCH 0/3] tests/acceptance: enhance s390x devices test Cornelia Huck
2020-11-30 18:02 ` [PATCH 1/3] tests/acceptance: test virtio-ccw revision handling Cornelia Huck
2020-12-01 10:43   ` Thomas Huth
2020-12-04 13:36   ` Wainer dos Santos Moschetta
2020-12-07 11:09     ` Cornelia Huck
2020-11-30 18:02 ` [PATCH 2/3] tests/acceptance: verify s390x device detection Cornelia Huck
2020-12-01 10:49   ` Thomas Huth
2020-12-04 13:47   ` Wainer dos Santos Moschetta
2020-12-07 11:10     ` Cornelia Huck
2020-11-30 18:02 ` [PATCH 3/3] tests/acceptance: test s390x zpci fid propagation Cornelia Huck
2020-12-01 10:52   ` Thomas Huth
2020-12-04 13:50   ` Wainer dos Santos Moschetta
2020-12-07 13:38 ` [PATCH 0/3] tests/acceptance: enhance s390x devices test Cornelia Huck

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.