From 8c61b840b499f994fba3422a72aa41133c5ef0ad Mon Sep 17 00:00:00 2001 From: Arun Date: Wed, 20 Nov 2019 11:42:21 +0530 Subject: [Test] Add tc to utilize all available free space of cassandra pod PVC Change-Id: I7645a8aecad7fd0a94b7f769018be0b4ac9070d9 --- .../functional/metrics/test_metrics_validation.py | 28 ++++++++++++++++++++++ 1 file changed, 28 insertions(+) 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) -- cgit