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 /tests | |
parent | 5826be464a45fe89183cd39a2c56b73e886dfafa (diff) |
Cleanup heketi config options
Removing several unused options and replacing couple of them
with built-in values.
Change-Id: I458f0eae6a68ddcb2711d454c81cdcee8142673a
Diffstat (limited to 'tests')
3 files changed, 26 insertions, 37 deletions
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']) |