From 9ba2ed7d5fbb0f2342b6d549bf62d4d410fbdb3a Mon Sep 17 00:00:00 2001 From: Arun Kumar Date: Sat, 9 May 2020 17:28:20 +0530 Subject: [Test] Add TC to validate vg and uuid of all devices in heketi topology Change-Id: I415e380b2b9e4d6aaa1d4333b6481640e2d3419f Signed-off-by: Arun Kumar --- .../heketi/test_heketi_device_operations.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'tests/functional/heketi/test_heketi_device_operations.py') diff --git a/tests/functional/heketi/test_heketi_device_operations.py b/tests/functional/heketi/test_heketi_device_operations.py index 0d362767..806450db 100755 --- a/tests/functional/heketi/test_heketi_device_operations.py +++ b/tests/functional/heketi/test_heketi_device_operations.py @@ -17,6 +17,7 @@ from openshiftstoragelibs.heketi_ops import ( heketi_topology_info, heketi_volume_create, heketi_volume_delete, + validate_dev_path_vg_and_uuid, ) from openshiftstoragelibs import utils @@ -569,3 +570,24 @@ class TestHeketiDeviceOperations(BaseClass): heketi_device_delete(h_node, h_url, device_delete_id) self.addCleanup( heketi_device_add, h_node, h_url, device_name, node_id) + + @pytest.mark.tier0 + def test_dev_path_mapping_basic_validation(self): + """Validate dev_path of all the devices""" + node_with_devices = dict() + h_node, h_url = self.heketi_client_node, self.heketi_server_url + + # Get the hostname and devices attached to each host + topology_info = heketi_topology_info(h_node, h_url, json=True) + for cluster in topology_info['clusters']: + for node in cluster['nodes']: + node_with_devices[node['hostnames']['manage'][0]] = [ + device['id'] for device in node['devices']] + + # Validate dev_path of each device + for node, devices in node_with_devices.items(): + for dev in list(devices): + is_true = validate_dev_path_vg_and_uuid( + h_node, h_url, node, dev) + self.assertTrue(is_true, "Failed to verify dv_path for the " + "device {}".format(dev)) -- cgit