diff options
author | Arun Kumar <aanand01762@gmail.com> | 2020-03-20 11:20:56 +0530 |
---|---|---|
committer | Vaibhav Mahajan <vamahaja@redhat.com> | 2020-04-15 06:47:33 +0000 |
commit | 985d6fb4483317709e9298b0f6c808723aac2acd (patch) | |
tree | f2f99ae00445162bba0003499d7e28b0a0bfc61a /tests | |
parent | 3f70c58b82e306e6f10fd743f9d8c3e6318d4d5e (diff) |
[Test] Add TC to validate blockvolume count heketi examine gluster
Change-Id: Iac66f50dffe8688f8c9bd53b1298a68484a39afd
Signed-off-by: Arun Kumar <aanand01762@gmail.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/functional/heketi/test_server_state_examine_gluster.py | 31 |
1 files changed, 31 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 a5f823b6..e023d0db 100644 --- a/tests/functional/heketi/test_server_state_examine_gluster.py +++ b/tests/functional/heketi/test_server_state_examine_gluster.py @@ -136,3 +136,34 @@ class TestHeketiServerStateExamineGluster(BaseClass): "info {} is not same".format( db_bricks_count, topology_bricks_count)) self.assertEqual(topology_bricks_count, db_bricks_count, msg) + + @pytest.mark.tier1 + def test_compare_block_volumes(self): + """Validate blockvolume count using heketi gluster examine""" + # Create some blockvolumes + size = 1 + for i in range(5): + volume = heketi_ops.heketi_blockvolume_create( + self.heketi_client_node, self.heketi_server_url, size, + json=True)['id'] + self.addCleanup( + heketi_ops.heketi_blockvolume_delete, + self.heketi_client_node, self.heketi_server_url, volume) + + # Get the list of blockvolumes from heketi gluster examine + out = heketi_ops.heketi_examine_gluster( + self.heketi_client_node, self.heketi_server_url) + examine_blockvolumes, clusters = [], out['heketidb']['clusterentries'] + for cluster in clusters.values(): + examine_blockvolumes += cluster['Info']['blockvolumes'] + + # Get list of blockvolume from heketi blockvolume list + heketi_block_volumes = heketi_ops.heketi_blockvolume_list( + self.heketi_client_node, self.heketi_server_url, + json=True)['blockvolumes'] + + # Compare volume list + msg = ("Heketi blockvolume list {} and list of blockvolumes in heketi " + "gluster examine {} are not same".format( + heketi_block_volumes, examine_blockvolumes)) + self.assertEqual(heketi_block_volumes, examine_blockvolumes, msg) |