summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorSanju Rakonde <srakonde@redhat.com>2018-06-12 16:15:12 +0530
committerJonathan Holloway <jholloway@redhat.com>2018-06-19 22:37:37 +0000
commit0743409330625b935de37c3210c4052c2e6653a9 (patch)
treec0f1340de0deedcf65153b4554c9eb582b0831b7 /tests
parent61552eff1ff3ce69acce9a78db90ff6403b2e3bf (diff)
glusto-tests/glusterd: setting auth.allow with more than 4096 characters
In this test case we will set auth.allow option with more than 4096 characters and restart the glusterd. glusterd should restart successfully. Steps followed: 1. Create and start a volume 2. Set auth.allow with <4096 characters 3. Restart glusterd, it should succeed 4. Set auth.allow with >4096 characters 5. Restart glusterd, it should succeed 6. Confirm that glusterd is running on the stopped node Change-Id: I7a5a8e49a798238bd88e5da54a8f4857c039ca07 Signed-off-by: Sanju Rakonde <srakonde@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/functional/glusterd/test_setting_volume_option_with_more_than_4096_characters.py102
1 files changed, 102 insertions, 0 deletions
diff --git a/tests/functional/glusterd/test_setting_volume_option_with_more_than_4096_characters.py b/tests/functional/glusterd/test_setting_volume_option_with_more_than_4096_characters.py
new file mode 100644
index 0000000..d6c5179
--- /dev/null
+++ b/tests/functional/glusterd/test_setting_volume_option_with_more_than_4096_characters.py
@@ -0,0 +1,102 @@
+# Copyright (C) 2017-2018 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
+# the Free Software Foundation; either version 2 of the License, or
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+from time import sleep
+from glusto.core import Glusto as g
+from glustolibs.gluster.gluster_base_class import runs_on, GlusterBaseClass
+from glustolibs.gluster.exceptions import ExecutionError
+from glustolibs.gluster.volume_libs import setup_volume
+from glustolibs.gluster.volume_ops import set_volume_options
+from glustolibs.gluster.gluster_init import (restart_glusterd,
+ is_glusterd_running)
+
+
+@runs_on([['distributed'], ['glusterfs']])
+class TestVolumeOptionSetWithMaxcharacters(GlusterBaseClass):
+
+ def setUp(self):
+
+ GlusterBaseClass.setUp.im_func(self)
+
+ # check whether peers are in connected state
+ ret = self.validate_peers_are_connected()
+ if not ret:
+ raise ExecutionError("Peers are not in connected state")
+
+ def tearDown(self):
+
+ count = 0
+ while count < 60:
+ ret = self.validate_peers_are_connected()
+ if ret:
+ break
+ sleep(2)
+ count += 1
+
+ if not ret:
+ raise ExecutionError("Peers are not in connected state")
+
+ # stopping the volume and Cleaning up the volume
+ ret = self.cleanup_volume()
+ if not ret:
+ raise ExecutionError("Failed to Cleanup the Volume %s"
+ % self.volname)
+ g.log.info("Volume deleted successfully : %s", self.volname)
+
+ GlusterBaseClass.tearDown.im_func(self)
+
+ def test_setting_vol_option_with_max_characters(self):
+
+ ret = setup_volume(self.mnode, self.all_servers_info, self.volume)
+ self.assertTrue(ret, ("Failed to create "
+ "and start volume %s" % self.volname))
+ auth_list = []
+ for ip_addr in range(256):
+ auth_list.append('192.168.122.%d' % ip_addr)
+ for ip_addr in range(7):
+ auth_list.append('192.168.123.%d' % ip_addr)
+ ip_list = ','.join(auth_list)
+
+ # set auth.allow with <4096 characters and restart the glusterd
+ g.log.info("Setting auth.allow with string of length %d for %s",
+ len(ip_list), self.volname)
+ self.options = {"auth.allow": ip_list}
+ ret = set_volume_options(self.mnode, self.volname, self.options)
+ self.assertTrue(ret, ("Failed to set auth.allow with string of length"
+ " %d for %s" % (len(ip_list), self.volname)))
+ ret = restart_glusterd(self.mnode)
+ self.assertTrue(ret, "Failed to restart the glusterd on %s"
+ % self.mnode)
+
+ # set auth.allow with >4096 characters and restart the glusterd
+ ip_list = ip_list + ",192.168.123.7"
+ self.options = {"auth.allow": ip_list}
+ g.log.info("Setting auth.allow with string of length %d for %s",
+ len(ip_list), self.volname)
+ ret = set_volume_options(self.mnode, self.volname, self.options)
+ self.assertTrue(ret, ("Failed to set auth.allow with string of length"
+ " %d for %s" % (len(ip_list), self.volname)))
+ ret = restart_glusterd(self.mnode)
+ self.assertTrue(ret, "Failed to restart the glusterd on %s"
+ % self.mnode)
+ count = 0
+ while count < 60:
+ ret = is_glusterd_running(self.mnode)
+ if not ret:
+ break
+ sleep(2)
+ count += 1
+ self.assertEqual(ret, 0, "glusterd is not running on %s" % self.mnode)