[PATCH virt-manager v1 2/3] tests: modify MDEV names

Shalini Chellathurai Saroja shalini at linux.ibm.com
Wed Nov 10 10:28:32 UTC 2021


Modify MDEV names according to the changed naming convention of
MDEV node devices in libvirt version 7.8.0 and later.

Signed-off-by: Shalini Chellathurai Saroja <shalini at linux.ibm.com>
---
 tests/data/testdriver/testdriver.xml |  9 ++++++---
 tests/data/testdriver/testsuite.xml  |  6 ++++--
 tests/test_cli.py                    | 12 ++++++------
 tests/test_nodedev.py                |  9 ++++++---
 tests/uitests/test_addhardware.py    |  2 +-
 5 files changed, 23 insertions(+), 15 deletions(-)

diff --git a/tests/data/testdriver/testdriver.xml b/tests/data/testdriver/testdriver.xml
index 5875732a..f66070dd 100644
--- a/tests/data/testdriver/testdriver.xml
+++ b/tests/data/testdriver/testdriver.xml
@@ -3667,7 +3667,7 @@ ba</description>
 </device>
 
 <device>
-  <name>mdev_8e37ee90_2b51_45e3_9b25_bf8283c03110</name>
+  <name>mdev_8e37ee90_2b51_45e3_9b25_bf8283c03110_0_0_0023</name>
   <path>/sys/devices/css0/0.0.0023/8e37ee90-2b51-45e3-9b25-bf8283c03110</path>
   <parent>css_0_0_0023</parent>
   <driver>
@@ -3675,6 +3675,7 @@ ba</description>
   </driver>
   <capability type='mdev'>
     <type id='vfio_ccw-io'/>
+    <uuid>8e37ee90-2b51-45e3-9b25-bf8283c03110</uuid>
     <iommuGroup number='0'/>
   </capability>
 </device>
@@ -3698,7 +3699,7 @@ ba</description>
 </device>
 
 <device>
-  <name>mdev_11f92c9d_b0b0_4016_b306_a8071277f8b9</name>
+  <name>mdev_11f92c9d_b0b0_4016_b306_a8071277f8b9_matrix</name>
   <path>/sys/devices/vfio_ap/matrix/11f92c9d-b0b0-4016-b306-a8071277f8b9</path>
   <parent>ap_matrix</parent>
   <driver>
@@ -3706,6 +3707,7 @@ ba</description>
   </driver>
   <capability type='mdev'>
     <type id='vfio_ap-passthrough'/>
+    <uuid>11f92c9d-b0b0-4016-b306-a8071277f8b9</uuid>
     <iommuGroup number='2'/>
     <attr name='assign_adapter' value='1'/>
     <attr name='assign_domain' value='2'/>
@@ -3713,7 +3715,7 @@ ba</description>
 </device>
 
 <device>
-  <name>mdev_4b20d080_1b54_4048_85b3_a6a62d165c01</name>
+  <name>mdev_4b20d080_1b54_4048_85b3_a6a62d165c01_0000_06_00_0</name>
   <path>/sys/devices/pci0000:00/0000:00:02.0/4b20d080-1b54-4048-85b3-a6a62d165c01</path>
   <parent>pci_0000_06_00_0</parent>
   <driver>
@@ -3721,6 +3723,7 @@ ba</description>
   </driver>
  <capability type='mdev'>
     <type id='nvidia-11'/>
+    <uuid>4b20d080-1b54-4048-85b3-a6a62d165c01</uuid>
     <iommuGroup number='12'/>
   </capability>
 </device>
diff --git a/tests/data/testdriver/testsuite.xml b/tests/data/testdriver/testsuite.xml
index 2b4f7679..f9ff2cc8 100644
--- a/tests/data/testdriver/testsuite.xml
+++ b/tests/data/testdriver/testsuite.xml
@@ -758,7 +758,7 @@
 </device>
 
 <device>
-  <name>mdev_8e37ee90_2b51_45e3_9b25_bf8283c03110</name>
+  <name>mdev_8e37ee90_2b51_45e3_9b25_bf8283c03110_0_0_0023</name>
   <path>/sys/devices/css0/0.0.0023/8e37ee90-2b51-45e3-9b25-bf8283c03110</path>
   <parent>css_0_0_0023</parent>
   <driver>
@@ -766,12 +766,13 @@
   </driver>
   <capability type='mdev'>
     <type id='vfio_ccw-io'/>
+    <uuid>8e37ee90-2b51-45e3-9b25-bf8283c03110</uuid>
     <iommuGroup number='0'/>
   </capability>
 </device>
 
 <device>
-  <name>mdev_b1ae8bf6_38b0_4c81_9d44_78ce3f520496</name>
+  <name>mdev_b1ae8bf6_38b0_4c81_9d44_78ce3f520496_0_0_0023</name>
   <path>/sys/devices/css0/0.0.0023/b1ae8bf6-38b0-4c81-9d44-78ce3f520496</path>
   <parent>css_0_0_0023</parent>
   <driver>
@@ -779,6 +780,7 @@
   </driver>
   <capability type='mdev'>
     <type id='vfio_ccw-io'/>
+    <uuid>b1ae8bf6-38b0-4c81-9d44-78ce3f520496</uuid>
     <iommuGroup number='0'/>
   </capability>
 </device>
diff --git a/tests/test_cli.py b/tests/test_cli.py
index b6e7873e..2559f237 100644
--- a/tests/test_cli.py
+++ b/tests/test_cli.py
@@ -702,9 +702,9 @@ source.reservations.managed=no,source.reservations.source.type=unix,source.reser
 --hostdev wlan0,type=net
 --hostdev /dev/vdz,type=storage
 --hostdev /dev/pty7,type=misc
---hostdev mdev_8e37ee90_2b51_45e3_9b25_bf8283c03110,address.type=ccw,address.cssid=0xfe,address.ssid=0x1,address.devno=0x0008
---hostdev mdev_11f92c9d_b0b0_4016_b306_a8071277f8b9
---hostdev mdev_4b20d080_1b54_4048_85b3_a6a62d165c01,address.type=pci,address.domain=0x0000,address.bus=0x01,address.slot=0x01,address.function=0x0,address.zpci.uid=0x0001,address.zpci.fid=0x00000001
+--hostdev mdev_8e37ee90_2b51_45e3_9b25_bf8283c03110_0_0_0023,address.type=ccw,address.cssid=0xfe,address.ssid=0x1,address.devno=0x0008
+--hostdev mdev_11f92c9d_b0b0_4016_b306_a8071277f8b9_matrix
+--hostdev mdev_4b20d080_1b54_4048_85b3_a6a62d165c01_0000_06_00_0,address.type=pci,address.domain=0x0000,address.bus=0x01,address.slot=0x01,address.function=0x0,address.zpci.uid=0x0001,address.zpci.fid=0x00000001
 
 
 --filesystem /source,/target,alias.name=testfsalias,driver.ats=on,driver.iommu=off,driver.packed=on
@@ -1362,8 +1362,8 @@ c.add_compare("--remove-device --disk /dev/null", "remove-disk-path")
 c.add_compare("--remove-device --video all", "remove-video-all")
 c.add_compare("--remove-device --host-device 0x04b3:0x4485", "remove-hostdev-name")
 c.add_compare("--remove-device --memballoon all", "remove-memballoon")
-c.add_compare("--add-device --hostdev mdev_8e37ee90_2b51_45e3_9b25_bf8283c03110", "add-hostdev-mdev")
-c.add_compare("--remove-device --hostdev mdev_b1ae8bf6_38b0_4c81_9d44_78ce3f520496", "remove-hostdev-mdev")
+c.add_compare("--add-device --hostdev mdev_8e37ee90_2b51_45e3_9b25_bf8283c03110_0_0_0023", "add-hostdev-mdev")
+c.add_compare("--remove-device --hostdev mdev_b1ae8bf6_38b0_4c81_9d44_78ce3f520496_0_0_0023", "remove-hostdev-mdev")
 
 c = vixml.add_category("add/rm devices and start", "test-state-shutoff --print-diff --start")
 c.add_invalid("--add-device --pm suspend_to_disk=yes")  # --add-device without a device
@@ -1374,7 +1374,7 @@ c.add_compare("--define --add-device --host-device usb_device_4b3_4485_noserial"
 c.add_compare("--add-device --disk %(EXISTIMG1)s,bus=virtio,target=vdf", "add-disk-basic-start")
 c.add_compare("--add-device --disk %(NEWIMG1)s,size=.01", "add-disk-create-storage-start")
 c.add_compare("--remove-device --disk /dev/null", "remove-disk-path-start")
-c.add_compare("--add-device --hostdev mdev_8e37ee90_2b51_45e3_9b25_bf8283c03110", "add-hostdev-mdev-start")
+c.add_compare("--add-device --hostdev mdev_8e37ee90_2b51_45e3_9b25_bf8283c03110_0_0_0023", "add-hostdev-mdev-start")
 
 c = vixml.add_category("add/rm devices OS KVM", "--connect %(URI-KVM)s test --print-diff --define")
 c.add_compare("--add-device --disk %(EXISTIMG1)s", "kvm-add-disk-os-from-xml")  # Guest OS (none) from XML
diff --git a/tests/test_nodedev.py b/tests/test_nodedev.py
index 79678bc8..9c40f2d7 100644
--- a/tests/test_nodedev.py
+++ b/tests/test_nodedev.py
@@ -128,32 +128,35 @@ def testDRMDevice():
 
 def testDASDMdev():
     conn = utils.URIs.open_testdriver_cached()
-    devname = "mdev_8e37ee90_2b51_45e3_9b25_bf8283c03110"
+    devname = "mdev_8e37ee90_2b51_45e3_9b25_bf8283c03110_0_0_0023"
     dev = _nodeDevFromName(conn, devname)
     assert dev.name == devname
     assert dev.parent == "css_0_0_0023"
     assert dev.device_type == "mdev"
     assert dev.type_id == "vfio_ccw-io"
+    assert dev.uuid == "8e37ee90-2b51-45e3-9b25-bf8283c03110"
 
 
 def testAPQNMdev():
     conn = utils.URIs.open_testdriver_cached()
-    devname = "mdev_11f92c9d_b0b0_4016_b306_a8071277f8b9"
+    devname = "mdev_11f92c9d_b0b0_4016_b306_a8071277f8b9_matrix"
     dev = _nodeDevFromName(conn, devname)
     assert dev.name == devname
     assert dev.parent == "ap_matrix"
     assert dev.device_type == "mdev"
     assert dev.type_id == "vfio_ap-passthrough"
+    assert dev.uuid == "11f92c9d-b0b0-4016-b306-a8071277f8b9"
 
 
 def testPCIMdev():
     conn = utils.URIs.open_testdriver_cached()
-    devname = "mdev_4b20d080_1b54_4048_85b3_a6a62d165c01"
+    devname = "mdev_4b20d080_1b54_4048_85b3_a6a62d165c01_0000_06_00_0"
     dev = _nodeDevFromName(conn, devname)
     assert dev.name == devname
     assert dev.parent == "pci_0000_06_00_0"
     assert dev.device_type == "mdev"
     assert dev.type_id == "nvidia-11"
+    assert dev.uuid == "4b20d080-1b54-4048-85b3-a6a62d165c01"
 
 
 # NodeDevice 2 Device XML tests
diff --git a/tests/uitests/test_addhardware.py b/tests/uitests/test_addhardware.py
index 56acc2fa..13a60035 100644
--- a/tests/uitests/test_addhardware.py
+++ b/tests/uitests/test_addhardware.py
@@ -462,7 +462,7 @@ def testAddHosts(app):
     # Add MDEV device
     _open_addhw(app, details)
     tab = _select_hw(addhw, "MDEV Host Device", "host-tab")
-    tab.find_fuzzy("mdev_8e37ee90_2b51_45e3_9b25_bf8283c03110",
+    tab.find_fuzzy("mdev_8e37ee90_2b51_45e3_9b25_bf8283c03110_0_0_0023",
                    "table cell").click()
     _finish(addhw, check=details)
 
-- 
2.30.2




More information about the virt-tools-list mailing list