summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVinayak Papnoi <vpapnoi@redhat.com>2019-08-04 17:09:51 +0530
committerBala Konda Reddy M <bmekala@redhat.com>2019-09-11 07:17:16 +0000
commitea560949078ce0c0e50ade4046781b0ee94c3b7b (patch)
tree722a5526258015f05c8d807701d62ef8bfdca436
parent2cf9b79d59fd4b5a53bc74e5efaae951d7761d7f (diff)
Fix AFR test case tearDown and library import
The test case 'test_client_side_quorum_with_fixed_validate_max_bricks' does not have a tearDown part where the volume options which have been set inside the test case have not been reset to default. The library function 'set_volume_options' was being imported from a wrong library. This fix includes this change along with the tearDown steps. Change-Id: Ic57494e7a7e8a25303b7979f98cc2dfbc9a7d7b6 Signed-off-by: Vinayak Papnoi <vpapnoi@redhat.com>
-rwxr-xr-xtests/functional/afr/test_client_side_quorum_with_fixed_validate_max_bricks.py19
1 files changed, 16 insertions, 3 deletions
diff --git a/tests/functional/afr/test_client_side_quorum_with_fixed_validate_max_bricks.py b/tests/functional/afr/test_client_side_quorum_with_fixed_validate_max_bricks.py
index cf699b7..67929cc 100755
--- a/tests/functional/afr/test_client_side_quorum_with_fixed_validate_max_bricks.py
+++ b/tests/functional/afr/test_client_side_quorum_with_fixed_validate_max_bricks.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2016-2017 Red Hat, Inc. <http://www.redhat.com>
+# Copyright (C) 2016-2019 Red Hat, Inc. <http://www.redhat.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -18,11 +18,13 @@
Test Cases in this module tests the client side quorum.
"""
+from time import sleep
from glusto.core import Glusto as g
from glustolibs.gluster.exceptions import ExecutionError
from glustolibs.gluster.gluster_base_class import GlusterBaseClass, runs_on
-from glustolibs.gluster.volume_libs import (
- set_volume_options, get_subvols)
+from glustolibs.gluster.volume_ops import (set_volume_options,
+ reset_volume_option)
+from glustolibs.gluster.volume_libs import get_subvols
from glustolibs.misc.misc_libs import upload_scripts
@@ -71,6 +73,17 @@ class ClientSideQuorumTests(GlusterBaseClass):
tearDown for every test
"""
+ # Reset the volume options
+ g.log.info("Resetting the volume options")
+ options = ['cluster.quorum-type', 'cluster.quorum-count']
+ for opt in options:
+ ret, _, _ = reset_volume_option(self.mnode, self.volname, opt)
+ if ret != 0:
+ raise ExecutionError("Failed to reset the volume option %s"
+ % opt)
+ sleep(2)
+ g.log.info("Successfully reset the volume options")
+
# stopping the volume
g.log.info("Starting to Unmount Volume and Cleanup Volume")
ret = self.unmount_volume_and_cleanup_volume(mounts=self.mounts)