diff options
author | Arun Kumar <aanand01762@gmail.com> | 2020-06-16 16:56:45 +0530 |
---|---|---|
committer | Vaibhav Mahajan <vamahaja@redhat.com> | 2020-06-24 14:23:40 +0000 |
commit | cf76d362434d2dac23b7a26ba19ca37ddf7d62f3 (patch) | |
tree | cd30e201f25f8077e72dddf0ec822ece64722665 | |
parent | e90319ec40b9cce5cb814d04f4ae4c9a7588097c (diff) |
[Test] Add TC creation of heketi volume with clusters argument
Change-Id: I7b095ea60a571a70cbfab177d823e49525330e86
Signed-off-by: Arun Kumar <aanand01762@gmail.com>
-rw-r--r-- | tests/functional/heketi/test_heketi_create_volume.py | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/functional/heketi/test_heketi_create_volume.py b/tests/functional/heketi/test_heketi_create_volume.py index 1ac3638e..a964206c 100644 --- a/tests/functional/heketi/test_heketi_create_volume.py +++ b/tests/functional/heketi/test_heketi_create_volume.py @@ -780,3 +780,30 @@ class TestHeketiVolume(BaseClass): self.heketi_server_url, volume_name["bricks"][0]["volume"]) self.assertIn( "transport endpoint is not connected", six.text_type(e.exception)) + + @pytest.mark.tier0 + def test_heketi_volume_create_with_clusterid(self): + """Validate creation of heketi volume with clusters argument""" + h_node, h_url = self.heketi_client_node, self.heketi_server_url + + # Get one of the cluster id from heketi cluster list + creation_cluster_id = heketi_cluster_list( + h_node, h_url, json=True)['clusters'][0] + + # Create a heketi volume specific to cluster list + volume_id = heketi_volume_create( + h_node, h_url, self.volume_size, clusters=creation_cluster_id, + json=True)["bricks"][0]["volume"] + self.addCleanup( + heketi_volume_delete, self.heketi_client_node, + self.heketi_server_url, volume_id) + + # Get the cluster id from heketi volume info + info_cluster_id = heketi_volume_info( + h_node, h_url, volume_id, json=True)['cluster'] + + # Match the creation cluster id with the info cluster id + self.assertEqual( + info_cluster_id, creation_cluster_id, + "Volume creation cluster id {} not matching the info cluster id " + "{}".format(creation_cluster_id, info_cluster_id)) |