diff options
author | Valerii Ponomarov <vponomar@redhat.com> | 2018-12-19 18:28:10 +0530 |
---|---|---|
committer | Valerii Ponomarov <vponomar@redhat.com> | 2018-12-19 18:28:10 +0530 |
commit | 179d08f211a77ed5c6b2754b694f95fc03b1b029 (patch) | |
tree | d575157c076290dea06b0c7b1bb7755215e951bc | |
parent | 5826be464a45fe89183cd39a2c56b73e886dfafa (diff) |
Cleanup heketi config options
Removing several unused options and replacing couple of them
with built-in values.
Change-Id: I458f0eae6a68ddcb2711d454c81cdcee8142673a
5 files changed, 26 insertions, 50 deletions
diff --git a/cns-libs/cnslibs/cns/cns_baseclass.py b/cns-libs/cnslibs/cns/cns_baseclass.py index f497beb7..234511aa 100644 --- a/cns-libs/cnslibs/cns/cns_baseclass.py +++ b/cns-libs/cnslibs/cns/cns_baseclass.py @@ -59,13 +59,6 @@ class CnsBaseClass(unittest.TestCase): cls.heketi_server_url = heketi_config['heketi_server_url'] cls.heketi_cli_user = heketi_config['heketi_cli_user'] cls.heketi_cli_key = heketi_config['heketi_cli_key'] - cls.heketi_ssh_key = heketi_config['heketi_ssh_key'] - cls.heketi_config_file = heketi_config['heketi_config_file'] - cls.heketi_volume = {} - cls.heketi_volume['size'] = g.config['cns']['heketi_volume']['size'] - cls.heketi_volume['name'] = g.config['cns']['heketi_volume']['name'] - cls.heketi_volume['expand_size'] = ( - g.config['cns']['heketi_volume']['expand_size']) cls.gluster_servers = g.config['gluster_servers'].keys() cls.gluster_servers_info = g.config['gluster_servers'] diff --git a/cns-libs/cnslibs/common/heketi_libs.py b/cns-libs/cnslibs/common/heketi_libs.py index 3ebe91ee..c6529af4 100644 --- a/cns-libs/cnslibs/common/heketi_libs.py +++ b/cns-libs/cnslibs/common/heketi_libs.py @@ -45,12 +45,6 @@ class HeketiBaseClass(unittest.TestCase): cls.gluster_servers = g.config['gluster_servers'].keys() cls.gluster_servers_info = g.config['gluster_servers'] cls.topo_info = g.config['cns']['trusted_storage_pool_list'] - cls.heketi_ssh_key = heketi_config['heketi_ssh_key'] - cls.heketi_config_file = heketi_config['heketi_config_file'] - cls.heketi_volume = { - 'size': g.config['cns']['heketi_volume']['size'], - 'name': g.config['cns']['heketi_volume']['name'], - 'expand_size': g.config['cns']['heketi_volume']['expand_size']} # Constructs topology info dictionary cls.topology_info = OrderedDict() diff --git a/tests/cns_tests_sample_config.yml b/tests/cns_tests_sample_config.yml index 8d4a73b1..89f0f162 100644 --- a/tests/cns_tests_sample_config.yml +++ b/tests/cns_tests_sample_config.yml @@ -53,12 +53,6 @@ cns: heketi_server_url: "http://heketi-storage-project.cloudapps.mystorage.com" heketi_cli_user: "admin" heketi_cli_key: "admin" - heketi_ssh_key: "/etc/heketi/heketi_key" - heketi_config_file: "/etc/heketi/heketi.json" - heketi_volume: - size: 1 - name: "autotests-heketi-vol-name" - expand_size: 2 dynamic_provisioning: storage_classes: file_storage_class: diff --git a/tests/functional/common/heketi/heketi_tests/test_heketi_create_volume.py b/tests/functional/common/heketi/heketi_tests/test_heketi_create_volume.py index 261f5cc2..7f2a61da 100644 --- a/tests/functional/common/heketi/heketi_tests/test_heketi_create_volume.py +++ b/tests/functional/common/heketi/heketi_tests/test_heketi_create_volume.py @@ -27,7 +27,7 @@ class TestHeketiVolume(HeketiBaseClass): @classmethod def setUpClass(cls): super(TestHeketiVolume, cls).setUpClass() - cls.volume_size = cls.heketi_volume['size'] + cls.volume_size = 1 @podcmd.GlustoPod() def test_volume_create_and_list_volume(self): @@ -40,7 +40,7 @@ class TestHeketiVolume(HeketiBaseClass): self.heketi_server_url, self.volume_size, json=True) self.assertTrue(out, ("Failed to create heketi " - "volume of size %s" % str(self.volume_size))) + "volume of size %s" % self.volume_size)) g.log.info("Heketi volume successfully created" % out) volume_id = out["bricks"][0]["volume"] self.addCleanup(self.delete_volumes, volume_id) @@ -84,7 +84,7 @@ class TestHeketiVolume(HeketiBaseClass): self.heketi_server_url, self.volume_size, json=True) self.assertTrue(out, ("Failed to create heketi " - "volume of size %s" % str(self.volume_size))) + "volume of size %s" % self.volume_size)) g.log.info("Heketi volume successfully created" % out) volume_id = out["bricks"][0]["volume"] self.addCleanup(self.delete_volumes, volume_id) @@ -124,7 +124,7 @@ class TestHeketiVolume(HeketiBaseClass): self.heketi_server_url, self.volume_size, json=True) self.assertTrue(out, ("Failed to create heketi " - "volume of size %s" % str(self.volume_size))) + "volume of size %s" % self.volume_size)) g.log.info("Heketi volume successfully created" % out) volume_id = out["bricks"][0]["volume"] self.addCleanup(self.delete_volumes, volume_id) diff --git a/tests/functional/common/heketi/test_heketi_volume_operations.py b/tests/functional/common/heketi/test_heketi_volume_operations.py index b0deb31e..ac7df139 100644 --- a/tests/functional/common/heketi/test_heketi_volume_operations.py +++ b/tests/functional/common/heketi/test_heketi_volume_operations.py @@ -26,6 +26,7 @@ class TestHeketiVolumeOperations(HeketiBaseClass): def setUpClass(cls): super(TestHeketiVolumeOperations, cls).setUpClass() cls.volume_id = None + cls.volume_size = 1 def volume_cleanup(self, volume_id): """ @@ -81,39 +82,35 @@ class TestHeketiVolumeOperations(HeketiBaseClass): Test to create volume with default options. """ - volume_size = self.heketi_volume['size'] - kwargs = {"json": True} vol_info = heketi_volume_create(self.heketi_client_node, - self.heketi_server_url, volume_size, - **kwargs) + self.heketi_server_url, + self.volume_size, json=True) self.assertTrue(vol_info, ("Failed to create heketi volume of size %s" - % str(volume_size))) + % self.volume_size)) self.addCleanup(self.volume_cleanup, vol_info['id']) - self.assertEqual(vol_info['size'], int(volume_size), + self.assertEqual(vol_info['size'], self.volume_size, ("Failed to create volume with default options." "Expected Size: %s, Actual Size: %s" - % (str(volume_size), str(vol_info['size'])))) + % (self.volume_size, vol_info['size']))) def test_heketi_with_expand_volume(self): """ Test volume expand and size if updated correctly in heketi-cli info """ - kwargs = {"json": True} - volume_size = self.heketi_volume['size'] vol_info = heketi_volume_create(self.heketi_client_node, - self.heketi_server_url, volume_size, - **kwargs) + self.heketi_server_url, + self.volume_size, json=True) self.assertTrue(vol_info, ("Failed to create heketi volume of size %s" - % str(volume_size))) + % self.volume_size)) self.addCleanup(self.volume_cleanup, vol_info['id']) - self.assertEqual(vol_info['size'], int(volume_size), + self.assertEqual(vol_info['size'], self.volume_size, ("Failed to create volume." "Expected Size: %s, Actual Size: %s" - % (str(volume_size), str(vol_info['size'])))) + % (self.volume_size, vol_info['size']))) volume_id = vol_info["id"] - expand_size = self.heketi_volume['expand_size'] + expand_size = 2 ret = heketi_volume_expand(self.heketi_client_node, self.heketi_server_url, volume_id, expand_size) @@ -121,8 +118,8 @@ class TestHeketiVolumeOperations(HeketiBaseClass): % volume_id)) volume_info = heketi_volume_info(self.heketi_client_node, self.heketi_server_url, - volume_id, **kwargs) - expected_size = int(volume_size) + int(expand_size) + volume_id, json=True) + expected_size = self.volume_size + expand_size self.assertEqual(volume_info['size'], expected_size, ("Volume Expansion failed Expected Size: %s, Actual " "Size: %s" % (str(expected_size), @@ -239,19 +236,17 @@ class TestHeketiVolumeOperations(HeketiBaseClass): Test to create volume after a device removal and with new device added. """ - volume_size = self.heketi_volume['size'] - vol_info = heketi_volume_create(self.heketi_client_node, - self.heketi_server_url, volume_size, - json=True) + self.heketi_server_url, + self.volume_size, json=True) self.assertTrue(vol_info, ("Failed to create heketi volume of size %s" - % str(volume_size))) + % self.volume_size)) self.addCleanup(self.volume_cleanup, vol_info['id']) - self.assertEqual(vol_info['size'], int(volume_size), + self.assertEqual(vol_info['size'], self.volume_size, ("Failed to create volume with default options." "Expected Size: %s, Actual Size: %s" - % (str(volume_size), str(vol_info['size'])))) + % (self.volume_size, vol_info['size']))) # 1. Device addition gluster_srvrs = self.gluster_servers @@ -324,8 +319,8 @@ class TestHeketiVolumeOperations(HeketiBaseClass): # Volume creation after device update vol_info = heketi_volume_create(self.heketi_client_node, - self.heketi_server_url, volume_size, - json=True) + self.heketi_server_url, + self.volume_size, json=True) self.assertTrue(vol_info, ("Failed to create heketi volume of size %s" - % str(volume_size))) + % self.volume_size)) self.addCleanup(self.volume_cleanup, vol_info['id']) |