qemu-s390x
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] tests/acceptance: test hot(un)plug of ccw devices


From: Cornelia Huck
Subject: [PATCH] tests/acceptance: test hot(un)plug of ccw devices
Date: Thu, 3 Dec 2020 16:39:17 +0100

Hotplug a virtio-net-ccw device, and then hotunplug it again.

Signed-off-by: Cornelia Huck <cohuck@redhat.com>
---

This is on top of "tests/acceptance: enhance s390x devices test"

---
 tests/acceptance/machine_s390_ccw_virtio.py | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/tests/acceptance/machine_s390_ccw_virtio.py 
b/tests/acceptance/machine_s390_ccw_virtio.py
index 53b8484f8f9c..487c25c31d3c 100644
--- a/tests/acceptance/machine_s390_ccw_virtio.py
+++ b/tests/acceptance/machine_s390_ccw_virtio.py
@@ -97,3 +97,17 @@ class S390CCWVirtioMachine(Test):
         exec_command_and_wait_for_pattern(self,
                                           'cat 
/sys/bus/pci/devices/000a\:00\:00.0/function_id',
                                           '0x0000000c')
+        # add another device
+        self.vm.command('device_add', driver='virtio-net-ccw',
+                        devno='fe.0.4711', id='xxx')
+        exec_command_and_wait_for_pattern(self, 'dmesg | tail -n 1', 'CRW')
+        exec_command_and_wait_for_pattern(self, 'ls /sys/bus/ccw/devices/',
+                                          '0.0.4711')
+        # and detach it again
+        self.vm.command('device_del', id='xxx')
+        self.vm.event_wait(name='DEVICE_DELETED',
+                           match={'data': {'device': 'xxx'}})
+        exec_command_and_wait_for_pattern(self, 'dmesg | tail -n 1', 'CRW')
+        exec_command_and_wait_for_pattern(self,
+                                          'ls /sys/bus/ccw/devices/0.0.4711',
+                                          'No such file or directory')
-- 
2.26.2




reply via email to

[Prev in Thread] Current Thread [Next in Thread]