summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorValerii Ponomarov <vponomar@redhat.com>2019-12-11 18:44:00 +0530
committervponomar <vponomar@redhat.com>2019-12-11 13:43:14 +0000
commit67b253ea6361b10f11ae79b53c53dca67c4908d3 (patch)
treec4a5005d4713eda648c377f1e99640b274441358
parent0cd073fdd42ed19186719862ed78006738d89f3e (diff)
Fix usage of cls ins attributes in 'test_gluster_block_stability.py'
Make test cases use local var 'prefix' not depending on the 'self.prefix'. We get 'AttributeError' error when 'self.prefix' is not set. And it can be set only when one of test cases gets run. Change-Id: I767e037e70e019ecb3a719d898dfe2b020dddff0
-rw-r--r--tests/functional/gluster_stability/test_gluster_block_stability.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/functional/gluster_stability/test_gluster_block_stability.py b/tests/functional/gluster_stability/test_gluster_block_stability.py
index 15393bf4..d380374b 100644
--- a/tests/functional/gluster_stability/test_gluster_block_stability.py
+++ b/tests/functional/gluster_stability/test_gluster_block_stability.py
@@ -118,7 +118,7 @@ class TestGlusterBlockStability(GlusterBlockBaseClass):
pvc_name, dc_name)
h_blockvol_list = heketi_blockvolume_list_by_name_prefix(
- self.heketi_client_node, self.heketi_server_url, self.prefix)
+ self.heketi_client_node, self.heketi_server_url, prefix)
# validate block volumes listed by heketi and pvs
heketi_blockvolume_ids = sorted([bv[0] for bv in h_blockvol_list])
@@ -928,11 +928,11 @@ class TestGlusterBlockStability(GlusterBlockBaseClass):
def test_tcmu_runner_failure_while_creating_and_deleting_pvc(self):
"""Kill the tcmu-runner service while creating and deleting PVC's"""
- self.prefix = "auto-block-test-%s" % utils.get_random_str()
+ prefix = "auto-block-test-%s" % utils.get_random_str()
# Create DC and pod with created PVC.
sc_name = self.create_storage_class(
- hacount=len(self.gluster_servers), vol_name_prefix=self.prefix)
+ hacount=len(self.gluster_servers), vol_name_prefix=prefix)
pvc_name = self.create_and_wait_for_pvc(sc_name=sc_name)
dc_name, pod_name = self.create_dc_with_pvc(pvc_name)
@@ -986,7 +986,7 @@ class TestGlusterBlockStability(GlusterBlockBaseClass):
# Validate volumes in heketi blockvolume list
heketi_volumes = heketi_blockvolume_list(
self.heketi_client_node, self.heketi_server_url)
- volume_count = heketi_volumes.count(self.prefix)
+ volume_count = heketi_volumes.count(prefix)
msg = (
'Wrong volume count in heketi blockvolume list %s and expected '
'volume count is 9 ' % volume_count)