summaryrefslogtreecommitdiffstats
path: root/tests/functional/test_gluster_ops_check.py
blob: de20ab005b2811c51e4ba8ecd2a7850ce7939947 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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)