[PATCH 3/3] tests/acceptance: test s390x zpci fid propagation

Cornelia Huck posted 3 patches 5 years, 2 months ago
[PATCH 3/3] tests/acceptance: test s390x zpci fid propagation
Posted by Cornelia Huck 5 years, 2 months ago
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


Re: [PATCH 3/3] tests/acceptance: test s390x zpci fid propagation
Posted by Thomas Huth 5 years, 2 months ago
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>


Re: [PATCH 3/3] tests/acceptance: test s390x zpci fid propagation
Posted by Wainer dos Santos Moschetta 5 years, 2 months ago
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')