libvirt/tests/nodedevmdevctldata
Jonathon Jongsma a9c1febcf4 nodedev: fix xml output for mdev parents in test suite
Commit 51fbbfdce8 attempted to get the proper nodedev name for the
parent of an defined mdev by traversing the filesystem and looking for a
device that had the appropriate sysfs path.  This works, but it would be
cleaner to to avoid mucking around in the filesystem and instead just
just examine the list of devices we have in memory.

We already had a function nodeDeviceFindAddressByName() which constructs
an address for parent device in a format that can be used with mdevctl.
So if we refactor this function into a a function that simply formats an
address for an arbitrary virNodeDeviceObj*, then we can use this
function as a predicate for our new virNodeDeviceObjListFind() function
from the previous commit. This will search our list of devices for one
whose address matches the address we get from mdevctl.

One nice benefit of this approach is that our test cases will now
display xml output with the proper parent name for mdevs (assuming that
we've added the appropriate mock parent devices to the test driver).
Previously they just displayed 'computer' for the parent because the
alternative would have required specially constructing a mock filesystem
environment with a sysfs that mapped to the appropriate parent.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-08-06 15:02:23 -05:00
..
mdev_d069d019_36ea_4111_8f0a_8c9a70e21366-create.argv nodedev: Switch to using long options for mdevctl 2021-04-19 10:24:13 -05:00
mdev_d069d019_36ea_4111_8f0a_8c9a70e21366-create.json nodedev: driver: Swap virMdevctlStart and virMdevctlCreate 2021-04-19 10:24:13 -05:00
mdev_d069d019_36ea_4111_8f0a_8c9a70e21366-define.argv nodedev: Switch to using long options for mdevctl 2021-04-19 10:24:13 -05:00
mdev_d069d019_36ea_4111_8f0a_8c9a70e21366-define.json nodedev: add function to generate mdevctl define command 2021-04-07 15:08:59 -05:00
mdev_d069d019_36ea_4111_8f0a_8c9a70e21366-start.argv tests: nodedev: Make the mdevctl test function and helper generic 2021-04-19 10:24:13 -05:00
mdev_d069d019_36ea_4111_8f0a_8c9a70e21366-stop.argv tests: nodedev: Make the mdevctl test function and helper generic 2021-04-19 10:24:13 -05:00
mdev_d069d019_36ea_4111_8f0a_8c9a70e21366-undefine.argv tests: nodedev: Make the mdevctl test function and helper generic 2021-04-19 10:24:13 -05:00
mdev_d2441d39_495e_4243_ad9f_beb3f14c23d9-create.argv nodedev: Switch to using long options for mdevctl 2021-04-19 10:24:13 -05:00
mdev_d2441d39_495e_4243_ad9f_beb3f14c23d9-create.json nodedev: driver: Swap virMdevctlStart and virMdevctlCreate 2021-04-19 10:24:13 -05:00
mdev_d2441d39_495e_4243_ad9f_beb3f14c23d9-define.argv nodedev: Switch to using long options for mdevctl 2021-04-19 10:24:13 -05:00
mdev_d2441d39_495e_4243_ad9f_beb3f14c23d9-define.json nodedev: add function to generate mdevctl define command 2021-04-07 15:08:59 -05:00
mdev_fedc4916_1ca8_49ac_b176_871d16c13076-create.argv nodedev: Switch to using long options for mdevctl 2021-04-19 10:24:13 -05:00
mdev_fedc4916_1ca8_49ac_b176_871d16c13076-create.json nodedev: driver: Swap virMdevctlStart and virMdevctlCreate 2021-04-19 10:24:13 -05:00
mdev_fedc4916_1ca8_49ac_b176_871d16c13076-define.argv nodedev: Switch to using long options for mdevctl 2021-04-19 10:24:13 -05:00
mdev_fedc4916_1ca8_49ac_b176_871d16c13076-define.json nodedev: add function to generate mdevctl define command 2021-04-07 15:08:59 -05:00
mdevctl-list-defined.argv nodedevmdevctltest: Use internal linewrapping and variable command path stripping 2021-04-12 15:55:10 +02:00
mdevctl-list-empty.json nodedev: fix internal error when no defined mdevs exist 2021-07-22 10:53:44 -05:00
mdevctl-list-empty.out.xml nodedev: fix internal error when no defined mdevs exist 2021-07-22 10:53:44 -05:00
mdevctl-list-multiple.json nodedev: handle mdevs from multiple parents 2021-07-01 16:34:03 +02:00
mdevctl-list-multiple.out.xml nodedev: fix xml output for mdev parents in test suite 2021-08-06 15:02:23 -05:00