summaryrefslogtreecommitdiffstats
path: root/tests/functional/logging/test_logging_validations.py
diff options
context:
space:
mode:
authorArun Kumar <arukumar@redhat.com>2020-08-03 13:21:11 +0530
committerArun Kumar <arukumar@redhat.com>2020-08-07 12:58:41 +0530
commitf55f457dd8b2b811fe18a60f934269f379e9b885 (patch)
treead102f5ea55a43120c85d219840a270e48ce3a75 /tests/functional/logging/test_logging_validations.py
parent037c15e168ae8d107369fb62d674e3cdf1a2669e (diff)
[Test] Add TC to utilize full space of PVC bount to ES pod
Change-Id: I0cbcc8c9c125d2925c85e08fd6b8690cc8ee0342 Signed-off-by: Arun Kumar <arukumar@redhat.com>
Diffstat (limited to 'tests/functional/logging/test_logging_validations.py')
-rw-r--r--tests/functional/logging/test_logging_validations.py37
1 files changed, 37 insertions, 0 deletions
diff --git a/tests/functional/logging/test_logging_validations.py b/tests/functional/logging/test_logging_validations.py
index 6fdad900..b864ed3c 100644
--- a/tests/functional/logging/test_logging_validations.py
+++ b/tests/functional/logging/test_logging_validations.py
@@ -87,3 +87,40 @@ class TestLoggingAndGlusterRegistryValidation(GlusterBlockBaseClass):
pvc_name, self._logging_es_dc,
heketi_server_url=self._registry_heketi_server_url,
is_registry_gluster=True)
+
+ @pytest.mark.tier2
+ def test_logging_es_pod_pvc_all_freespace_utilization(self):
+ """Validate logging by utilizing all the free space of block PVC bound
+ to elsaticsearch pod"""
+
+ # Get the elasticsearch pod name nad PVC name
+ es_pod = openshift_ops.get_pod_name_from_dc(
+ self._master, self._logging_es_dc)
+ pvc_custom = ":.spec.volumes[*].persistentVolumeClaim.claimName"
+ pvc_name = openshift_ops.oc_get_custom_resource(
+ self._master, "pod", pvc_custom, es_pod)[0]
+
+ # Validate iscsi and multipath
+ self.verify_iscsi_sessions_and_multipath(
+ pvc_name, self._logging_es_dc,
+ heketi_server_url=self._registry_heketi_server_url,
+ is_registry_gluster=True)
+
+ # Get the available free space
+ mount_point = '/elasticsearch/persistent'
+ cmd_free_space = (
+ "df -kh {} | awk '{{print $4}}' | tail -1".format(mount_point))
+ old_available_space = openshift_ops.oc_rsh(
+ self._master, es_pod, cmd_free_space)[1]
+
+ # Fill the all the available space
+ file_name = '{}/file'.format(mount_point)
+ cmd_fill_space = (
+ "fallocate -l {} {}".format(old_available_space, file_name))
+ with self.assertRaises(AssertionError):
+ openshift_ops.oc_rsh(self._master, es_pod, cmd_fill_space)
+
+ # Cleanup the filled space
+ cmd_remove_file = 'rm {}'.format(file_name)
+ self.addCleanup(
+ openshift_ops.oc_rsh, self._master, es_pod, cmd_remove_file)