summaryrefslogtreecommitdiffstats
path: root/tests/functional/heketi/test_server_state_examine_gluster.py
diff options
context:
space:
mode:
authorValerii Ponomarov <vponomar@redhat.com>2019-03-06 16:15:25 +0530
committerValerii Ponomarov <vponomar@redhat.com>2019-03-06 16:28:52 +0530
commit3de9a4ea9623cd3a928ce30cbae3364beeac5edb (patch)
tree1746204da26e4648d20b656b2421ef42c78044a4 /tests/functional/heketi/test_server_state_examine_gluster.py
parent3d4ab96edfa54ec7f2dd9682d1ee3e3077dfa79c (diff)
Reorder test files removing redundant dirs
Move all the files of 'tests/functional/common/' dir to the 'tests/functional/', because 'common' is the only dir there, which doesn't really makes sense. Do the same about 'tests/functional/common/heketi/heketi_tests' and 'tests/functional/common/heketi/'. Change-Id: I1fa55e2e7bf09e9b9115629b06e1fd160e291a36
Diffstat (limited to 'tests/functional/heketi/test_server_state_examine_gluster.py')
-rw-r--r--tests/functional/heketi/test_server_state_examine_gluster.py45
1 files changed, 45 insertions, 0 deletions
diff --git a/tests/functional/heketi/test_server_state_examine_gluster.py b/tests/functional/heketi/test_server_state_examine_gluster.py
new file mode 100644
index 00000000..f74366ed
--- /dev/null
+++ b/tests/functional/heketi/test_server_state_examine_gluster.py
@@ -0,0 +1,45 @@
+from cnslibs.common.baseclass import BaseClass
+from cnslibs.common import heketi_ops
+from cnslibs.common import heketi_version
+from cnslibs.common import openshift_ops
+
+
+class TestHeketiServerStateExamineGluster(BaseClass):
+
+ def setUp(self):
+ self.node = self.ocp_master_node[0]
+ version = heketi_version.get_heketi_version(self.heketi_client_node)
+ if version < '8.0.0-7':
+ self.skipTest("heketi-client package %s does not support server "
+ "state examine gluster" % version.v_str)
+
+ def test_volume_inconsistencies(self):
+ # Examine Gluster cluster and Heketi that there is no inconsistencies
+ out = heketi_ops.heketi_examine_gluster(
+ self.heketi_client_node, self.heketi_server_url)
+ if ("heketi volume list matches with volume list of all nodes"
+ not in out['report']):
+ self.skipTest(
+ "heketi and Gluster are inconsistent to each other")
+
+ # create volume
+ vol = heketi_ops.heketi_volume_create(
+ self.heketi_client_node, self.heketi_server_url, 1, json=True)
+ self.addCleanup(
+ heketi_ops.heketi_volume_delete, self.heketi_client_node,
+ self.heketi_server_url, vol['id'])
+
+ # delete volume from gluster cluster directly
+ openshift_ops.cmd_run_on_gluster_pod_or_node(
+ self.node,
+ "gluster vol stop %s force --mode=script" % vol['name'])
+ openshift_ops.cmd_run_on_gluster_pod_or_node(
+ self.node,
+ "gluster vol delete %s --mode=script" % vol['name'])
+
+ # verify that heketi is reporting inconsistencies
+ out = heketi_ops.heketi_examine_gluster(
+ self.heketi_client_node, self.heketi_server_url)
+ self.assertNotIn(
+ "heketi volume list matches with volume list of all nodes",
+ out['report'])