diff options
author | Sri Vignesh <sselvan@redhat.com> | 2019-09-19 11:53:27 +0530 |
---|---|---|
committer | vponomar <vponomar@redhat.com> | 2019-09-25 11:39:37 +0000 |
commit | 203410a740e275cce78e840c30c583c82e563c28 (patch) | |
tree | 1b266d8acfa17b1aafae68d04acc4c69e3fc4c2e /tests/functional/heketi/test_server_state_examine_gluster.py | |
parent | b255aef7fd1c7c8fae34a5e685efc52956b12d48 (diff) |
[Lib+tc]Add testcase and library to validate total count of volumes
Add library to check db results
Validate count of volumes of heketi and db are same
Change-Id: I6e75f2d8d5f19a94c1dced5a07f9c948b4de9ef4
Signed-off-by: Sri Vignesh <sselvan@redhat.com>
Diffstat (limited to 'tests/functional/heketi/test_server_state_examine_gluster.py')
-rw-r--r-- | tests/functional/heketi/test_server_state_examine_gluster.py | 22 |
1 files changed, 22 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 22352024..31859bd0 100644 --- a/tests/functional/heketi/test_server_state_examine_gluster.py +++ b/tests/functional/heketi/test_server_state_examine_gluster.py @@ -43,3 +43,25 @@ class TestHeketiServerStateExamineGluster(BaseClass): self.assertNotIn( "heketi volume list matches with volume list of all nodes", out['report']) + + def test_compare_real_vol_count_with_db_check_info(self): + """Validate volumes using heketi db check""" + + # Create volume + vol = heketi_ops.heketi_volume_create( + self.heketi_client_node, self.heketi_server_url, 1, json=True) + self.addCleanup( + heketi_ops.heketi_volume_delete, self.heketi_client_node, + self.heketi_server_url, vol['id']) + + # Check heketi db + db_result = heketi_ops.heketi_db_check( + self.heketi_client_node, self.heketi_server_url) + vol_count = db_result["volumes"]["total"] + vol_list = heketi_ops.heketi_volume_list( + self.heketi_client_node, self.heketi_server_url, json=True) + count = len(vol_list["volumes"]) + self.assertEqual( + count, vol_count, "Volume count doesn't match expected" + " result %s, actual result is %s" % ( + count, vol_count)) |