summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorArun Kumar <aanand01762@gmail.com>2020-05-09 17:28:20 +0530
committerArun Kumar <aanand01762@gmail.com>2020-05-27 17:04:34 +0530
commit9ba2ed7d5fbb0f2342b6d549bf62d4d410fbdb3a (patch)
treec8f2830263579183e2a05ffc7b2bbd38b6275ae9 /tests
parent870bfa3d3c0e33f8a3ff0680e5dc01950fded3f0 (diff)
[Test] Add TC to validate vg and uuid of all devices in heketi topology
Change-Id: I415e380b2b9e4d6aaa1d4333b6481640e2d3419f Signed-off-by: Arun Kumar <aanand01762@gmail.com>
Diffstat (limited to 'tests')
-rwxr-xr-xtests/functional/heketi/test_heketi_device_operations.py22
1 files changed, 22 insertions, 0 deletions
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))