summaryrefslogtreecommitdiffstats
path: root/tests/functional/metrics
diff options
context:
space:
mode:
authorArun <arukumar@redhat.com>2019-11-20 11:42:21 +0530
committerArun Kumar <arukumar@redhat.com>2020-01-27 06:41:13 +0000
commit8c61b840b499f994fba3422a72aa41133c5ef0ad (patch)
treeb8d2843f20bcf70d90408bb60aa407f0387eb210 /tests/functional/metrics
parente776f73d118ccc6d2731f87ba93f8c7a045661d0 (diff)
[Test] Add tc to utilize all available free space of cassandra pod PVC
Change-Id: I7645a8aecad7fd0a94b7f769018be0b4ac9070d9
Diffstat (limited to 'tests/functional/metrics')
-rw-r--r--tests/functional/metrics/test_metrics_validation.py28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/functional/metrics/test_metrics_validation.py b/tests/functional/metrics/test_metrics_validation.py
index 26f4d761..2e584829 100644
--- a/tests/functional/metrics/test_metrics_validation.py
+++ b/tests/functional/metrics/test_metrics_validation.py
@@ -11,6 +11,7 @@ from openshiftstoragelibs.openshift_ops import (
get_pod_name_from_rc,
oc_delete,
oc_get_custom_resource,
+ oc_rsh,
switch_oc_project,
verify_pvc_status_is_bound,
wait_for_pod_be_ready,
@@ -217,3 +218,30 @@ class TestMetricsAndGlusterRegistryValidation(GlusterBlockBaseClass):
pvc_name, self.metrics_rc_hawkular_cassandra,
rtype='rc', heketi_server_url=self.registry_heketi_server_url,
is_registry_gluster=True)
+
+ def test_metrics_cassandra_pod_pvc_all_freespace_utilization(self):
+ """Validate metrics by utilizing all the free space of block PVC bound
+ to cassandra pod"""
+
+ # Validate iscsi and multipath
+ hawkular_cassandra, _, _, _, _ = (
+ self.verify_cassandra_pod_multipath_and_iscsi())
+
+ # Get the available free space
+ mount_point = '/cassandra_data'
+ cmd_free_space = (
+ "df -kh {} | awk '{{print $4}}' | tail -1".format(mount_point))
+ old_available_space = oc_rsh(
+ self.master, hawkular_cassandra, 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):
+ oc_rsh(self.master, hawkular_cassandra, cmd_fill_space)
+
+ # Cleanup the filled space
+ cmd_remove_file = 'rm {}'.format(file_name)
+ self.addCleanup(
+ oc_rsh, self.master, hawkular_cassandra, cmd_remove_file)