summaryrefslogtreecommitdiffstats
path: root/tests/functional
diff options
context:
space:
mode:
authorSri Vignesh <sselvan@redhat.com>2019-09-23 15:26:49 +0530
committerSri Vignesh <sselvan@redhat.com>2019-11-13 12:56:13 +0530
commit325253963d053378495552ae1c0e54062c6b1291 (patch)
tree4da6bdd1456098b158df8eabe81f2c2135f6597e /tests/functional
parent4507807c8740add2f9a87a82fdf3ac9be24eebe3 (diff)
Add testcase to validate node count with heketi db check
Validate total nodes count in heketi db check is same as heketi node list. Change-Id: I6004537c251f8e512afabe88e0fb284624421b8d Signed-off-by: Sri Vignesh <sselvan@redhat.com>
Diffstat (limited to 'tests/functional')
-rw-r--r--tests/functional/heketi/test_server_state_examine_gluster.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/functional/heketi/test_server_state_examine_gluster.py b/tests/functional/heketi/test_server_state_examine_gluster.py
index 5ddf9064..1afeedd0 100644
--- a/tests/functional/heketi/test_server_state_examine_gluster.py
+++ b/tests/functional/heketi/test_server_state_examine_gluster.py
@@ -70,3 +70,18 @@ class TestHeketiServerStateExamineGluster(BaseClass):
count, vol_count,
"%svolume count doesn't match expected "
"result %s, actual result is %s" % (vol_type, count, vol_count))
+
+ def test_compare_node_count_with_db_check_info(self):
+ """Validate nodes count using heketi db check"""
+
+ # Check heketi db
+ db_result = heketi_ops.heketi_db_check(
+ self.heketi_client_node, self.heketi_server_url)
+ db_nodes_count = db_result["nodes"]["total"]
+ nodes_list = heketi_ops.heketi_node_list(
+ self.heketi_client_node, self.heketi_server_url, json=True)
+ calculated_nodes_count = len(nodes_list)
+ self.assertEqual(
+ calculated_nodes_count, db_nodes_count,
+ "Nodes count from 'DB check' (%s) doesn't match calculated nodes "
+ "count (%s)." % (db_nodes_count, calculated_nodes_count))