summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorArun Kumar <aanand01762@gmail.com>2020-05-07 15:59:34 +0530
committerVaibhav Mahajan <vamahaja@redhat.com>2020-05-12 11:23:03 +0000
commit7a6bf7fc53c563644afb399e98f8b2b7e46d3a60 (patch)
treee9450ea4b3794d5b1e751ca7f00f959c2f54ad48 /tests
parentfdb6321518622e90c56ac54e9ef4feb5bf1847b5 (diff)
[Test] Add TC to validate gluster examine output after node poweroff
Change-Id: I32fcb7be8246e9d7b0900e10bdfb5af0f61f1f44 Signed-off-by: Arun Kumar <aanand01762@gmail.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/functional/heketi/test_server_state_examine_gluster.py24
1 files changed, 24 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
index 401d0ab..9b995cb 100644
--- a/tests/functional/heketi/test_server_state_examine_gluster.py
+++ b/tests/functional/heketi/test_server_state_examine_gluster.py
@@ -2,8 +2,10 @@ import ddt
import pytest
from openshiftstoragelibs.baseclass import BaseClass
+from openshiftstoragelibs import exceptions
from openshiftstoragelibs import heketi_ops
from openshiftstoragelibs import heketi_version
+from openshiftstoragelibs import node_ops
from openshiftstoragelibs import openshift_ops
@@ -151,3 +153,25 @@ class TestHeketiServerStateExamineGluster(BaseClass):
"gluster examine {} are not same".format(
heketi_block_volumes, examine_blockvolumes))
self.assertEqual(heketi_block_volumes, examine_blockvolumes, msg)
+
+ @pytest.mark.tier2
+ def test_validate_report_after_node_poweroff(self):
+ """Validate node report in heketi gluster examine after poweroff"""
+ # Skip test if not able to connect to Cloud Provider
+ try:
+ node_ops.find_vm_name_by_ip_or_hostname(self.node)
+ except (NotImplementedError, exceptions.ConfigError) as err:
+ self.skipTest(err)
+
+ # Power off one of the gluster node
+ g_node = list(self.gluster_servers_info.values())[0]['manage']
+ vm_name = node_ops.find_vm_name_by_ip_or_hostname(g_node)
+ self.power_off_gluster_node_vm(vm_name, g_node)
+
+ # Check the information of offline node in gluster examine output
+ msg = "could not fetch data from node {}".format(g_node)
+ examine_msg = heketi_ops.heketi_examine_gluster(
+ self.heketi_client_node, self.heketi_server_url)['report'][1]
+ self.assertEqual(
+ examine_msg, msg, "Failed to generate error report for node {} in"
+ " gluster examine output".format(g_node))