diff options
author | Arun Kumar <aanand01762@gmail.com> | 2020-03-20 16:08:44 +0530 |
---|---|---|
committer | Vaibhav Mahajan <vamahaja@redhat.com> | 2020-04-06 09:05:29 +0000 |
commit | cbfb8d69396347de15d355b23346165aa1e1e17b (patch) | |
tree | ed75f814b6c6034e05f51744cf8f57947c4ddfc1 /tests/functional/heketi/test_heketi_node_operations.py | |
parent | 32bf8c1d1d02a385604687cd4d8788348194f07a (diff) |
[Test] Add TC check node addition in heketi db
Change-Id: I2cde18222ba56a25962e3e3e63580c7ac2f38ceb
Signed-off-by: Arun Kumar <aanand01762@gmail.com>
Diffstat (limited to 'tests/functional/heketi/test_heketi_node_operations.py')
-rw-r--r-- | tests/functional/heketi/test_heketi_node_operations.py | 47 |
1 files changed, 38 insertions, 9 deletions
diff --git a/tests/functional/heketi/test_heketi_node_operations.py b/tests/functional/heketi/test_heketi_node_operations.py index 12a508f0..e6ea2d60 100644 --- a/tests/functional/heketi/test_heketi_node_operations.py +++ b/tests/functional/heketi/test_heketi_node_operations.py @@ -166,16 +166,8 @@ class TestHeketiNodeOperations(baseclass.BaseClass): return storage_hostname, storage_ip - @pytest.mark.tier0 @podcmd.GlustoPod() - def test_heketi_node_add_with_valid_cluster(self): - """Test heketi node add operation with valid cluster id""" - if (openshift_storage_version.get_openshift_storage_version() - < "3.11.4"): - self.skipTest( - "This test case is not supported for < OCS 3.11.4 builds due " - "to bug BZ-1732831") - + def heketi_node_add_with_valid_cluster(self): h_client, h_server = self.heketi_client_node, self.heketi_server_url ocp_node = self.ocp_master_node[0] @@ -245,6 +237,43 @@ class TestHeketiNodeOperations(baseclass.BaseClass): storage_ip, ep_addresses) self.assertIn(storage_ip, ep_addresses, err_msg) + @pytest.mark.tier0 + def test_heketi_node_add_with_valid_cluster(self): + """Test heketi node add operation with valid cluster id""" + if (openshift_storage_version.get_openshift_storage_version() + < "3.11.4"): + self.skipTest( + "This test case is not supported for < OCS 3.11.4 builds due " + "to bug BZ-1732831") + + # Add node to valid cluster id + self.heketi_node_add_with_valid_cluster() + + def test_validate_heketi_node_add_with_db_check(self): + """Test heketi db check after node add operation""" + if (openshift_storage_version.get_openshift_storage_version() + < "3.11.4"): + self.skipTest( + "This test case is not supported for < OCS 3.11.4 builds due " + "to bug BZ-1732831") + + # Get the total number of nodes in heketi db + intial_db_info = heketi_ops.heketi_db_check( + self.heketi_client_node, self.heketi_server_url, json=True) + initial_node_count = intial_db_info['nodes']['total'] + + # Add node to valid cluster id + self.heketi_node_add_with_valid_cluster() + + # Verify the addition of node in heketi db + final_db_info = heketi_ops.heketi_db_check( + self.heketi_client_node, self.heketi_server_url, json=True) + final_node_count = final_db_info['nodes']['total'] + msg = ( + "Initial node count {} and final node count {} in heketi db is" + " not as expected".format(initial_node_count, final_node_count)) + self.assertEqual(initial_node_count + 1, final_node_count, msg) + @pytest.mark.tier1 def test_heketi_node_add_with_invalid_cluster(self): """Test heketi node add operation with invalid cluster id""" |