summaryrefslogtreecommitdiffstats
path: root/tests/functional/afr/heal/test_server_side_healing_happens_only_when_glustershd_running.py
diff options
context:
space:
mode:
authorkshithijiyer <kshithij.ki@gmail.com>2020-06-05 18:26:29 +0530
committerArthy Loganathan <aloganat@redhat.com>2020-06-08 05:36:23 +0000
commit95a240d570e622c0f7018ca82f1c602a53653042 (patch)
tree44a16a3e2a2c0a8957505b9b9061433ccaca027d /tests/functional/afr/heal/test_server_side_healing_happens_only_when_glustershd_running.py
parentbe7397195d3a4772b69f1afe2f831b3008219ac4 (diff)
[Testfix] Move teardownclass to teardown
Problem: A pattern was observed where testcases which were passing were throwing error in teadownclass this was becuase docleanup was running before teadownclass and when teardownclass was executed it failed as the setup was already cleaned. Solution: Change code to teardown from teardownclass and move setup volume code to setup from setupclass. Change-Id: I37c6fde1f592224c114148f0ed7215b2494b4502 Signed-off-by: kshithijiyer <kshithij.ki@gmail.com>
Diffstat (limited to 'tests/functional/afr/heal/test_server_side_healing_happens_only_when_glustershd_running.py')
-rw-r--r--tests/functional/afr/heal/test_server_side_healing_happens_only_when_glustershd_running.py36
1 files changed, 15 insertions, 21 deletions
diff --git a/tests/functional/afr/heal/test_server_side_healing_happens_only_when_glustershd_running.py b/tests/functional/afr/heal/test_server_side_healing_happens_only_when_glustershd_running.py
index be1a6fc0f..43b4f4edf 100644
--- a/tests/functional/afr/heal/test_server_side_healing_happens_only_when_glustershd_running.py
+++ b/tests/functional/afr/heal/test_server_side_healing_happens_only_when_glustershd_running.py
@@ -42,49 +42,43 @@ class SelfHealDaemonProcessTestsWithSingleVolume(GlusterBaseClass):
verifies the self-heal daemon process on a single volume
"""
- @classmethod
- def setUpClass(cls):
- """
- setup volume, mount volume and initialize necessary variables
- which is used in tests
- """
+ def setUp(self):
# Calling GlusterBaseClass setUpClass
- cls.get_super_method(cls, 'setUpClass')()
+ self.get_super_method(self, 'setUp')()
+
+ # Upload script
+ self.script_upload_path = ("/usr/share/glustolibs/io/scripts/"
+ "file_dir_ops.py")
+ ret = upload_scripts(self.clients, [self.script_upload_path])
+ if not ret:
+ raise ExecutionError("Failed to upload IO scripts to clients")
# Setup Volume and Mount Volume
- ret = cls.setup_volume_and_mount_volume(mounts=cls.mounts)
+ ret = self.setup_volume_and_mount_volume(mounts=self.mounts)
if not ret:
raise ExecutionError("Failed to Setup_Volume and Mount_Volume")
g.log.info("Successful in Setup Volume and Mount Volume")
# Verify glustershd process releases its parent process
- ret = is_shd_daemonized(cls.servers)
+ ret = is_shd_daemonized(self.servers)
if not ret:
raise ExecutionError("Self Heal Daemon process was still"
" holding parent process.")
g.log.info("Self Heal Daemon processes are online")
- # Upload script
- cls.script_upload_path = ("/usr/share/glustolibs/io/scripts/"
- "file_dir_ops.py")
- ret = upload_scripts(cls.clients, [cls.script_upload_path])
- if not ret:
- raise ExecutionError("Failed to upload IO scripts to clients")
-
- @classmethod
- def tearDownClass(cls):
+ def tearDown(self):
"""
Clean up the volume and umount volume from client
"""
# Stopping the volume
- ret = cls.unmount_volume_and_cleanup_volume(mounts=cls.mounts)
+ ret = self.unmount_volume_and_cleanup_volume(mounts=self.mounts)
if not ret:
raise ExecutionError("Failed to Unmount Volume and Cleanup Volume")
g.log.info("Successful in Unmount Volume and Cleanup Volume")
- # Calling GlusterBaseClass tearDownClass
- cls.get_super_method(cls, 'tearDownClass')()
+ # Calling GlusterBaseClass tearDown
+ self.get_super_method(self, 'tearDown')()
def test_server_side_healing_happens_only_when_glustershd_running(self):
"""