[PATCH 2/3] tests/acceptance: verify s390x device detection

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


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


Re: [PATCH 2/3] tests/acceptance: verify s390x device detection
Posted by Wainer dos Santos Moschetta 5 years, 2 months ago
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>



Re: [PATCH 2/3] tests/acceptance: verify s390x device detection
Posted by Cornelia Huck 5 years, 2 months ago
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!