summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorShwetha Panduranga <spandura@redhat.com>2017-02-09 16:08:44 +0530
committerNigel Babu <nigelb@redhat.com>2017-02-27 00:50:08 -0500
commitbc30c6a7eebc20416e6c7fe5c7b080f4e96b5f57 (patch)
tree31190ba4f740ec1b1cfcea5d6e659a545588ea67 /tests
parentadb4a198788a8b5d096503ccd35497f28455e50b (diff)
Adding Gluster Basic tests like:
1) Tests glusterd start, stop, restart services Change-Id: Ib424e24be49a7100808449e3e82706564088dcf6 Signed-off-by: Shwetha Panduranga <spandura@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/functional/bvt/test_basic.py79
1 files changed, 79 insertions, 0 deletions
diff --git a/tests/functional/bvt/test_basic.py b/tests/functional/bvt/test_basic.py
new file mode 100644
index 000000000..83cac0e2c
--- /dev/null
+++ b/tests/functional/bvt/test_basic.py
@@ -0,0 +1,79 @@
+# Copyright (C) 2015-2016 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.
+
+""" Description: BVT-Basic Tests """
+
+import pytest
+from glusto.core import Glusto as g
+from glustolibs.gluster.gluster_base_class import GlusterBaseClass
+from glustolibs.gluster.gluster_init import (
+ is_glusterd_running, restart_glusterd, start_glusterd, stop_glusterd)
+
+
+class TestGlusterdSanity(GlusterBaseClass):
+ @pytest.mark.bvt_basic
+ def test_glusterd_restart_stop_start(self):
+ """Tests glusterd stop, start, restart
+ """
+ # restart glusterd on all servers
+ g.log.info("Restart glusterd on all servers")
+ ret = restart_glusterd(self.servers)
+ self.assertTrue(ret, "Failed to restart glusterd on all servers")
+ g.log.info("Successfully restarted glusterd on all servers")
+
+ # Check if glusterd is running on all servers(expected: active)
+ g.log.info("Check if glusterd is running on all servers"
+ "(expected: active)")
+ ret = is_glusterd_running(self.servers)
+ self.assertEqual(ret, 0, "Glusterd is not running on all servers")
+ g.log.info("Glusterd is running on all the servers")
+
+ # Stop glusterd on all servers
+ g.log.info("Stop glusterd on all servers")
+ ret = stop_glusterd(self.servers)
+ self.assertTrue(ret, "Failed to stop glusterd on all servers")
+ g.log.info("Successfully stopped glusterd on all servers")
+
+ # Check if glusterd is running on all servers(expected: not running)
+ g.log.info("Check if glusterd is running on all servers"
+ "(expected: not running)")
+ ret = is_glusterd_running(self.servers)
+ self.assertNotEqual(ret, 0, "Glusterd is still running on some "
+ "servers")
+ g.log.info("Glusterd not running on any servers as expected.")
+
+ # Start glusterd on all servers
+ g.log.info("Start glusterd on all servers")
+ ret = start_glusterd(self.servers)
+ self.assertTrue(ret, "Failed to start glusterd on all servers")
+ g.log.info("Successfully started glusterd on all servers")
+
+ # Check if glusterd is running on all servers(expected: active)
+ g.log.info("Check if glusterd is running on all servers"
+ "(expected: active)")
+ ret = is_glusterd_running(self.servers)
+ self.assertEqual(ret, 0, "Glusterd is not running on all servers")
+ g.log.info("Glusterd is running on all the servers")
+
+ def tearDown(self):
+ """In case of any failure restart glusterd on all servers
+ """
+ # restart glusterd on all servers
+ g.log.info("Restart glusterd on all servers")
+ ret = restart_glusterd(self.servers)
+ self.assertTrue(ret, "Failed to restart glusterd on all servers")
+ g.log.info("Successfully restarted glusterd on all servers")
+ GlusterBaseClass.tearDown.im_func(self)
erfs.git/log/?h=release-8'>release-8geo-rep: Fix string comparisonKotresh HR6 years round-robin2io-threads: distribute work fairly among clientsJeff Darcy10 years testing-regression-job[DO NOT MERGE]Deepshikha khandelwal7 years  TagDownloadAuthorAge v7.8commit b4f19c7b1c...Rinku Kothiya6 years v8.2commit 895183d5a2...Rinku Kothiya6 years v8.1commit f9b8462ba2...Rinku Kothiya6 years v6.10commit 48fc076676...Rinku Kothiya6 years v7.7commit 95f167483e...Rinku Kothiya6 years v8.0commit 2e1e4168ab...Rinku Kothiya6 years v8.0rc0commit 18bd1bdaa6...Rinku Kothiya6 years v7.6commit bef7c8e54e...Rinku Kothiya6 years v6.9commit 57b48f2802...Hari Gowtham