From 5f6d8efbe62758ad76bab4a9421d5bcfed220b0c Mon Sep 17 00:00:00 2001 From: adityaramteke Date: Wed, 27 Mar 2019 17:24:15 +0530 Subject: add test gluster ops check Change-Id: I1d9c7e14525ad8de35bfa7be8fffc533c010248b --- tests/functional/test_gluster_ops_check.py | 34 ++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 tests/functional/test_gluster_ops_check.py diff --git a/tests/functional/test_gluster_ops_check.py b/tests/functional/test_gluster_ops_check.py new file mode 100644 index 00000000..de20ab00 --- /dev/null +++ b/tests/functional/test_gluster_ops_check.py @@ -0,0 +1,34 @@ +from glustolibs.gluster.brickmux_ops import is_brick_mux_enabled + +from openshiftstoragelibs.baseclass import BaseClass +from openshiftstoragelibs.openshift_ops import cmd_run_on_gluster_pod_or_node +from openshiftstoragelibs import podcmd + + +class TestOpsCheck(BaseClass): + + @podcmd.GlustoPod() + def test_check_bmux_enabled(self): + """Check if the brickmultiplexing is enalbed""" + + bmux_status = is_brick_mux_enabled('auto_get_gluster_endpoint') + + # Validate the result + err_msg = ("Brick multiplex is not enabled") + self.assertTrue(bmux_status, err_msg) + + def test_check_max_brick_per_process(self): + """Check if the max-brick process is set to 250""" + + cmd = ("gluster v get all all | grep cluster.max-bricks-per-process |" + "awk '{print $2}'") + + # Get brick per process value + bprocess_status = cmd_run_on_gluster_pod_or_node( + self.ocp_master_node[0], cmd) + + # Validate the result + err_msg = ("Got unexepeted max-brick process - '%s' " + "Expected max brick process is : 250") % ( + bprocess_status) + self.assertIn(bprocess_status, '250', err_msg) -- cgit