diff --git a/libvirt/tests/cfg/virtual_interface/iface_nodedev_info.cfg b/libvirt/tests/cfg/virtual_interface/iface_nodedev_info.cfg deleted file mode 100644 index 35fc71fbd1..0000000000 --- a/libvirt/tests/cfg/virtual_interface/iface_nodedev_info.cfg +++ /dev/null @@ -1,13 +0,0 @@ -- iface.nodedev_info: - type = iface_nodedev_info - start_vm = no - - variants dev_type: - - vdpa: - only x86_64 - func_supported_since_libvirt_ver = (7, 3, 0) - func_supported_since_qemu_kvm_ver = (6, 0, 0) - dev_dict = {'path': 'vdpa0', 'name': 'vdpa_vdpa0', 'driver_name': 'vhost_vdpa', 'cap_type': 'vdpa'} - variants test_target: - - simulator: - - mellanox: diff --git a/libvirt/tests/cfg/virtual_network/nodedev/nodedev_vdpa_interface.cfg b/libvirt/tests/cfg/virtual_network/nodedev/nodedev_vdpa_interface.cfg new file mode 100644 index 0000000000..35f3f3babd --- /dev/null +++ b/libvirt/tests/cfg/virtual_network/nodedev/nodedev_vdpa_interface.cfg @@ -0,0 +1,11 @@ +- virtual_network.nodedev.vdpa_interface: + type = nodedev_vdpa_interface + start_vm = no + only x86_64 + + func_supported_since_libvirt_ver = (7, 3, 0) + func_supported_since_qemu_kvm_ver = (6, 0, 0) + dev_dict = {'path': 'vdpa0', 'name': 'vdpa_vdpa0', 'driver_name': 'vhost_vdpa', 'cap_type': 'vdpa'} + variants test_target: + - simulator: + - mellanox: diff --git a/libvirt/tests/src/virtual_interface/iface_nodedev_info.py b/libvirt/tests/src/virtual_network/nodedev/nodedev_vdpa_interface.py similarity index 78% rename from libvirt/tests/src/virtual_interface/iface_nodedev_info.py rename to libvirt/tests/src/virtual_network/nodedev/nodedev_vdpa_interface.py index 6d85597533..785df3117e 100644 --- a/libvirt/tests/src/virtual_interface/iface_nodedev_info.py +++ b/libvirt/tests/src/virtual_network/nodedev/nodedev_vdpa_interface.py @@ -23,28 +23,6 @@ def check_environment(params): libvirt_version.is_libvirt_feature_supported(params) utils_misc.is_qemu_function_supported(params) - def setup_test(dev_type): - """ - Setup test environment for a specific interface if needed - - :param dev_type: interface type - :return: An object of special test environment - """ - test_env_obj = None - if dev_type == 'vdpa': - test_env_obj = setup_vdpa() - - return test_env_obj - - def teardown_test(dev_type): - """ - Default cleanup - - :param dev_type: interface type - """ - if dev_type == 'vdpa': - teardown_vdpa() - def setup_vdpa(): """ Setup vDPA environment @@ -84,7 +62,8 @@ def check_nodedev_info(dev_dict): if dev_name not in result.stdout_text: test.fail("Failed to list %s device!" % dev_name) - test.log.info("TEST_STEP2: Check device info using virsh nodedev-dumpxml.") + test.log.info("TEST_STEP2: Check device info using virsh " + "nodedev-dumpxml.") dev_xml = nodedev_xml.NodedevXML.new_from_dumpxml(dev_name) test.log.debug("Nodedev xml: {}".format(dev_xml)) if not all([getattr(dev_xml, attr).endswith(value) for attr, value in @@ -96,16 +75,17 @@ def check_nodedev_info(dev_dict): test.fail("Failed to validate node device xml!") check_environment(params) + # Variable assignment - dev_type = params.get('dev_type', '') dev_dict = eval(params.get('dev_dict', '{}')) test_obj = None try: # Execute test - test.log.info("TEST_CASE: %s", check_nodedev_info.__doc__.split('\n')[0]) - test_obj = setup_test(dev_type) + test.log.info("TEST_CASE: %s", + check_nodedev_info.__doc__.split('\n')[0]) + test_obj = setup_vdpa() check_nodedev_info(dev_dict) finally: - teardown_test(dev_type) + teardown_vdpa()