diff options
author | Bala Konda Reddy M <bmekala@redhat.com> | 2019-08-09 15:48:45 +0530 |
---|---|---|
committer | Bala Konda Reddy M <bmekala@redhat.com> | 2019-09-04 09:46:10 +0000 |
commit | 875ba99936c2fb8947d3f35e08b412e2223a54a2 (patch) | |
tree | c2430e2dadb443d269a7a777c2b9fcaef211efc3 /tests/functional/glusterd/test_enabling_glusterd_debug_mode.py | |
parent | e6bca2db2d21a0a570919a0a52f4c7ab839a6f57 (diff) |
Added a library for daemon reload and fixing testcase
After changing the type of unit file from INFO
to DEBUG. Performing daemon reload. Earlier using
running commands continuosly to generated debug
messages instead of running continuosly, restarted
glusterd in one of the nodes so that while handshake
the logs will be in Debug mode. After validating
reverting back the unit file to INFO and daemon
reload
Change-Id: I8c99407eff2ea98a836f37fc2d89bb99f7eeccb7
Signed-off-by: Bala Konda Reddy M <bmekala@redhat.com>
Diffstat (limited to 'tests/functional/glusterd/test_enabling_glusterd_debug_mode.py')
-rw-r--r-- | tests/functional/glusterd/test_enabling_glusterd_debug_mode.py | 34 |
1 files changed, 26 insertions, 8 deletions
diff --git a/tests/functional/glusterd/test_enabling_glusterd_debug_mode.py b/tests/functional/glusterd/test_enabling_glusterd_debug_mode.py index 7a355f861..8c5bf976a 100644 --- a/tests/functional/glusterd/test_enabling_glusterd_debug_mode.py +++ b/tests/functional/glusterd/test_enabling_glusterd_debug_mode.py @@ -18,12 +18,13 @@ from time import sleep from glusto.core import Glusto as g from glustolibs.gluster.gluster_base_class import GlusterBaseClass from glustolibs.gluster.exceptions import ExecutionError -from glustolibs.gluster.gluster_init import (start_glusterd, stop_glusterd) -from glustolibs.gluster.volume_ops import get_volume_info +from glustolibs.gluster.gluster_init import (start_glusterd, stop_glusterd, + restart_glusterd) from glustolibs.gluster.gluster_init import is_glusterd_running from glustolibs.gluster.glusterfile import (move_file, find_and_replace_in_file, check_if_pattern_in_file) +from glustolibs.misc.misc_libs import daemon_reload class TestVolumeOptionSetWithMaxcharacters(GlusterBaseClass): @@ -72,6 +73,12 @@ class TestVolumeOptionSetWithMaxcharacters(GlusterBaseClass): raise ExecutionError("Reverting glusterd log failed.") g.log.info("Reverting of glusterd log successful.") + # Daemon should be reloaded as unit file is changed + ret = daemon_reload(self.mnode) + if not ret: + raise ExecutionError("Unable to reload the daemon") + g.log.info("Daemon reloaded successfully") + # Restart glusterd ret = start_glusterd(self.mnode) if not ret: @@ -139,13 +146,17 @@ class TestVolumeOptionSetWithMaxcharacters(GlusterBaseClass): self.assertTrue(ret, "Renaming the glusterd log is failed") g.log.info("Successfully renamed glusterd.log file.") + # Daemon reloading as the unit file of the daemon changed + ret = daemon_reload(self.mnode) + self.assertTrue(ret, "Daemon reloaded successfully") + # Start glusterd ret = start_glusterd(self.mnode) self.assertTrue(ret, "Failed to start glusterd on %s" % self.mnode) g.log.info('Successfully to started glusterd.') - # Check if glusterd is runnibg or not. + # Check if glusterd is running or not. count = 0 while count < 60: ret = is_glusterd_running(self.mnode) @@ -156,14 +167,21 @@ class TestVolumeOptionSetWithMaxcharacters(GlusterBaseClass): self.assertEqual(ret, 0, "glusterd is not running on %s" % self.mnode) g.log.info('glusterd is running after changing log_level to debug.') - # Issue some gluster commands + # Instead of executing commands in loop, if glusterd is restarted in + # one of the nodes in the cluster the handshake messages + # will be in debug mode. + ret = restart_glusterd(self.servers[1]) + self.assertTrue(ret, "restarted successfully") + count = 0 - while count < 9: - ret = get_volume_info(self.mnode) - self.assertIsNotNone(ret, "Failed to get volume info") + while count < 60: + ret = is_glusterd_running(self.mnode) + if ret: + break sleep(2) count += 1 - g.log.info("Successfully got volume info 9 times.") + self.assertEqual(ret, 0, "glusterd is not running on %s" % self.mnode) + g.log.info('glusterd is running after changing log_level to debug.') # Check glusterd logs for debug messages glusterd_log_file = "/var/log/glusterfs/glusterd.log" |