From cf76d362434d2dac23b7a26ba19ca37ddf7d62f3 Mon Sep 17 00:00:00 2001 From: Arun Kumar Date: Tue, 16 Jun 2020 16:56:45 +0530 Subject: [Test] Add TC creation of heketi volume with clusters argument Change-Id: I7b095ea60a571a70cbfab177d823e49525330e86 Signed-off-by: Arun Kumar --- .../functional/heketi/test_heketi_create_volume.py | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) 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)) -- cgit