diff options
author | Daniel P. Berrangé <berrange@redhat.com> | 2021-10-29 12:04:49 +0100 |
---|---|---|
committer | Daniel Berrangé <berrange@redhat.com> | 2021-11-05 12:40:38 +0000 |
commit | cfa88603a29250bc3c8c3546f56f2c79d107a1bf (patch) | |
tree | 1b8e3250271b8f40d6e71604e12afea012461ad5 | |
parent | 67695d00cf9bf08edbbb070eb1d07fa410e590aa (diff) | |
download | virt-manager-cfa88603a29250bc3c8c3546f56f2c79d107a1bf.tar.gz |
tests: use different USB device when testing hot-add
Libvirt now validates that all <hostdev> elements refer to distinct host
devices. The test suite violates that constraint by trying to hot-add a
device that alreadye exists in the config.
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
-rw-r--r-- | tests/data/cli/compare/virt-xml-add-host-device.xml | 6 | ||||
-rw-r--r-- | tests/data/testdriver/testsuite.xml | 14 | ||||
-rw-r--r-- | tests/test_cli.py | 2 |
3 files changed, 18 insertions, 4 deletions
diff --git a/tests/data/cli/compare/virt-xml-add-host-device.xml b/tests/data/cli/compare/virt-xml-add-host-device.xml index 099fe853..20ad8d84 100644 --- a/tests/data/cli/compare/virt-xml-add-host-device.xml +++ b/tests/data/cli/compare/virt-xml-add-host-device.xml @@ -3,8 +3,8 @@ </vsock> + <hostdev mode="subsystem" type="usb" managed="yes"> + <source> -+ <vendor id="0x04b3"/> -+ <product id="0x4485"/> ++ <vendor id="0x0483"/> ++ <product id="0x2016"/> + </source> + </hostdev> </devices> @@ -12,4 +12,4 @@ <keywrap> Domain 'test-for-virtxml' defined successfully. -Changes will take effect after the domain is fully powered off.
\ No newline at end of file +Changes will take effect after the domain is fully powered off. diff --git a/tests/data/testdriver/testsuite.xml b/tests/data/testdriver/testsuite.xml index a073cbce..2b4f7679 100644 --- a/tests/data/testdriver/testsuite.xml +++ b/tests/data/testdriver/testsuite.xml @@ -744,6 +744,20 @@ </device> <device> + <name>usb_device_483_2016_noserial</name> + <parent>usb_device_1d6b_1_0000_00_1a_0</parent> + <driver> + <name>usb</name> + </driver> + <capability type='usb_device'> + <bus>3</bus> + <device>2</device> + <product id='0x2016'>Fingerprint Reader</product> + <vendor id='0x0483'>SGS Thomson Microelectronics</vendor> + </capability> +</device> + +<device> <name>mdev_8e37ee90_2b51_45e3_9b25_bf8283c03110</name> <path>/sys/devices/css0/0.0.0023/8e37ee90-2b51-45e3-9b25-bf8283c03110</path> <parent>css_0_0_0023</parent> diff --git a/tests/test_cli.py b/tests/test_cli.py index 3d41e357..98869a5b 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -1350,7 +1350,7 @@ c = vixml.add_category("add/rm devices", "test-for-virtxml --print-diff --define c.add_valid("--add-device --security model=dac") # --add-device works for seclabel c.add_invalid("--add-device --pm suspend_to_disk=yes") # --add-device without a device c.add_invalid("--remove-device --clock utc") # --remove-device without a dev -c.add_compare("--add-device --host-device usb_device_4b3_4485_noserial", "add-host-device") +c.add_compare("--add-device --host-device usb_device_483_2016_noserial", "add-host-device") c.add_compare("--add-device --sound pcspk", "add-sound") c.add_compare("--add-device --disk %(EXISTIMG1)s,bus=virtio,target=vdf", "add-disk-basic") c.add_compare("--add-device --disk %(EXISTIMG1)s", "add-disk-notarget") # filling in acceptable target |