summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorValerii Ponomarov <vponomar@redhat.com>2018-12-21 09:54:00 +0000
committerGerrit Code Review <gerrit2@gerrit.host.prod.eng.bos.redhat.com>2018-12-21 09:54:00 +0000
commit96da32dd54370734b11e833bcc2a569cdfbaf3d7 (patch)
tree0870a08e8fcfa75df84f0c4769d64146866d4179 /tests
parentd8b97355d98407b7ca84836a76d9d0b3bfe4deb9 (diff)
parent179d08f211a77ed5c6b2754b694f95fc03b1b029 (diff)
Merge "Cleanup heketi config options"
Diffstat (limited to 'tests')
-rw-r--r--tests/cns_tests_sample_config.yml6
-rw-r--r--tests/functional/common/heketi/heketi_tests/test_heketi_create_volume.py8
-rw-r--r--tests/functional/common/heketi/test_heketi_volume_operations.py49
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'])