From baabf54807346ae5faa6bc84fe612ae033cb06ba Mon Sep 17 00:00:00 2001 From: Joy John Pinto <86055382+pintojoy@users.noreply.github.com> Date: Wed, 30 Apr 2025 13:01:56 +0530 Subject: [PATCH 1/6] Changing pool name to default block pool from cutom pools Signed-off-by: Joy John Pinto <86055382+pintojoy@users.noreply.github.com> --- .../csi_tests/test_pvc_clone_performance.py | 58 ++++++------------- 1 file changed, 17 insertions(+), 41 deletions(-) diff --git a/tests/cross_functional/performance/csi_tests/test_pvc_clone_performance.py b/tests/cross_functional/performance/csi_tests/test_pvc_clone_performance.py index 7262fbf7305..86e6a24be0e 100644 --- a/tests/cross_functional/performance/csi_tests/test_pvc_clone_performance.py +++ b/tests/cross_functional/performance/csi_tests/test_pvc_clone_performance.py @@ -129,13 +129,6 @@ def teardown(self): Cleanup the test environment """ logger.info("Starting the test environment cleanup") - try: - logger.info(f"Deleting the test StorageClass : {self.sc_obj.name}") - self.sc_obj.delete() - logger.info("Wait until the SC is deleted.") - self.sc_obj.ocp.wait_for_delete(resource_name=self.sc_obj.name) - except Exception as ex: - logger.warning(f"Can not delete the test sc : {ex}") # Delete the test project (namespace) self.delete_test_project() @@ -162,27 +155,12 @@ def teardown(self): super(TestPVCClonePerformance, self).teardown() - def create_new_pool_and_sc(self, secret_factory): - self.pool_name = ( - f"pas-test-pool-{Interfaces_info[self.interface]['name'].lower()}" - ) - secret = secret_factory(interface=self.interface) - self.create_new_pool(self.pool_name) - # Creating new StorageClass (pool) for the test. - self.sc_obj = helpers.create_storage_class( - interface_type=self.interface, - interface_name=self.pool_name, - secret_name=secret.name, - sc_name=self.pool_name, - fs_name=self.pool_name, - ) - logger.info(f"The new SC is : {self.sc_obj.name}") def create_pvc_and_wait_for_bound(self): logger.info("Creating PVC to be cloned") try: self.pvc_obj = helpers.create_pvc( - sc_name=self.sc_obj.name, + sc_name=Interfaces_info[self.interface]["sc"], pvc_name="pvc-pas-test", size=f"{self.pvc_size}Gi", namespace=self.namespace, @@ -343,17 +321,16 @@ def test_clone_create_delete_performance( test_start_time = self.get_time() # Create new pool and sc only for RBD, for CepgFS use thr default + self.sc_obj = ocs.OCS( + kind="StorageCluster", + metadata={ + "namespace": self.namespace, + "name": Interfaces_info[self.interface]["sc"], + }, + ) if self.interface == constants.CEPHBLOCKPOOL: - # Creating new pool to run the test on it - self.create_new_pool_and_sc(secret_factory) + self.pool_name = "ocs-storagecluster-cephblockpool" else: - self.sc_obj = ocs.OCS( - kind="StorageCluster", - metadata={ - "namespace": self.namespace, - "name": Interfaces_info[self.interface]["sc"], - }, - ) self.pool_name = "ocs-storagecluster-cephfilesystem" # Create a PVC self.create_pvc_and_wait_for_bound() @@ -464,17 +441,16 @@ def test_pvc_clone_performance_multiple_files( test_start_time = self.get_time() # Create new pool and sc only for RBD, for CepgFS use thr default + self.sc_obj = ocs.OCS( + kind="StorageCluster", + metadata={ + "namespace": self.namespace, + "name": Interfaces_info[self.interface]["sc"], + }, + ) if self.interface == constants.CEPHBLOCKPOOL: - # Creating new pool to run the test on it - self.create_new_pool_and_sc(secret_factory) + self.pool_name = "ocs-storagecluster-cephblockpool" else: - self.sc_obj = ocs.OCS( - kind="StorageCluster", - metadata={ - "namespace": self.namespace, - "name": Interfaces_info[self.interface]["sc"], - }, - ) self.pool_name = "ocs-storagecluster-cephfilesystem" # Create a PVC self.create_pvc_and_wait_for_bound() From e06c5ee2ff7eebf2fad35c336d19adacdcaac87e Mon Sep 17 00:00:00 2001 From: Joy John Pinto <86055382+pintojoy@users.noreply.github.com> Date: Fri, 2 May 2025 16:33:38 +0530 Subject: [PATCH 2/6] Changing pool name to default block pool from cutom pools Signed-off-by: Joy John Pinto <86055382+pintojoy@users.noreply.github.com> --- ocs_ci/helpers/performance_lib.py | 1 + 1 file changed, 1 insertion(+) diff --git a/ocs_ci/helpers/performance_lib.py b/ocs_ci/helpers/performance_lib.py index 0bd9f64e4c4..601c32de876 100644 --- a/ocs_ci/helpers/performance_lib.py +++ b/ocs_ci/helpers/performance_lib.py @@ -658,6 +658,7 @@ def get_pvc_provision_times(interface, pvc_name, start_time, time_type="all", op if prov_logs: for sublog in prov_logs: for line in sublog: + logger.info(f"sublogg : {line}") for i in range(0, len(pvc_name)): name = pvc_name[i].name pv_name = pvc_name[i].backed_pv From 95da3640dd85148e58399d6d8875a161e07f7fed Mon Sep 17 00:00:00 2001 From: Joy John Pinto <86055382+pintojoy@users.noreply.github.com> Date: Fri, 2 May 2025 17:18:07 +0530 Subject: [PATCH 3/6] Changing pool name to default block pool from cutom pools Signed-off-by: Joy John Pinto <86055382+pintojoy@users.noreply.github.com> --- .../csi_tests/test_pvc_clone_performance.py | 21 ------------------- 1 file changed, 21 deletions(-) diff --git a/tests/cross_functional/performance/csi_tests/test_pvc_clone_performance.py b/tests/cross_functional/performance/csi_tests/test_pvc_clone_performance.py index 86e6a24be0e..d316503c008 100644 --- a/tests/cross_functional/performance/csi_tests/test_pvc_clone_performance.py +++ b/tests/cross_functional/performance/csi_tests/test_pvc_clone_performance.py @@ -132,27 +132,6 @@ def teardown(self): # Delete the test project (namespace) self.delete_test_project() - logger.info(f"Try to delete the Storage pool {self.pool_name}") - try: - self.delete_ceph_pool(self.pool_name) - except Exception: - pass - finally: - # Verify deletion by checking the backend CEPH pools using the toolbox - if self.interface == constants.CEPHBLOCKPOOL: - results = self.ceph_cluster.toolbox.exec_cmd_on_pod("ceph osd pool ls") - logger.debug(f"Existing pools are : {results}") - if self.pool_name in results.split(): - logger.warning( - "The pool did not deleted by CSI, forcing delete it manually" - ) - self.ceph_cluster.toolbox.exec_cmd_on_pod( - f"ceph osd pool delete {self.pool_name} {self.pool_name} " - "--yes-i-really-really-mean-it" - ) - else: - logger.info(f"The pool {self.pool_name} was deleted successfully") - super(TestPVCClonePerformance, self).teardown() From 59fd500f6c98139ee52bc03a7c3d39d87854327f Mon Sep 17 00:00:00 2001 From: Joy John Pinto <86055382+pintojoy@users.noreply.github.com> Date: Thu, 8 May 2025 12:04:58 +0530 Subject: [PATCH 4/6] Fixing script issue Signed-off-by: Joy John Pinto <86055382+pintojoy@users.noreply.github.com> --- ocs_ci/helpers/performance_lib.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ocs_ci/helpers/performance_lib.py b/ocs_ci/helpers/performance_lib.py index 601c32de876..cee1eba8225 100644 --- a/ocs_ci/helpers/performance_lib.py +++ b/ocs_ci/helpers/performance_lib.py @@ -663,12 +663,12 @@ def get_pvc_provision_times(interface, pvc_name, start_time, time_type="all", op name = pvc_name[i].name pv_name = pvc_name[i].backed_pv if op in ["all", "create"]: - if re.search(f"provision.*{name}.*started", line): + if re.search(f'Started.*PVC="[^"]*/{re.escape(name)}"', line): if results[name]["create"]["start"] is None: results[name]["create"]["start"] = ( extruct_timestamp_from_log(line) ) - if re.search(f"provision.*{name}.*succeeded", line): + if re.search(f'Succeeded.*{re.escape(name)}', line, re.IGNORECASE): if results[name]["create"]["end"] is None: results[name]["create"]["end"] = ( extruct_timestamp_from_log(line) @@ -679,13 +679,13 @@ def get_pvc_provision_times(interface, pvc_name, start_time, time_type="all", op ) ) if op in ["all", "delete"]: - if re.search(f'delete "{pv_name}": started', line): + if re.search(f'shouldDelete is true.*PV="{re.escape(pv_name)}"', line): if results[name]["delete"]["start"] is None: results[name]["delete"]["start"] = ( extruct_timestamp_from_log(line) ) if ( - re.search(f'delete "{pv_name}": succeeded', line) + re.search(f'deleted succeeded.*PV="{re.escape(pv_name)}"', line)) and ( version.get_semantic_ocs_version_from_config() <= version.VERSION_4_13 From 1ff85a06fe297479add52a9aa4a9991489505840 Mon Sep 17 00:00:00 2001 From: Joy John Pinto <86055382+pintojoy@users.noreply.github.com> Date: Thu, 8 May 2025 14:50:45 +0530 Subject: [PATCH 5/6] Fixing script issues Signed-off-by: Joy John Pinto <86055382+pintojoy@users.noreply.github.com> --- ocs_ci/helpers/performance_lib.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ocs_ci/helpers/performance_lib.py b/ocs_ci/helpers/performance_lib.py index cee1eba8225..8051213e163 100644 --- a/ocs_ci/helpers/performance_lib.py +++ b/ocs_ci/helpers/performance_lib.py @@ -685,7 +685,7 @@ def get_pvc_provision_times(interface, pvc_name, start_time, time_type="all", op extruct_timestamp_from_log(line) ) if ( - re.search(f'deleted succeeded.*PV="{re.escape(pv_name)}"', line)) + re.search(f'deleted succeeded.*PV="{re.escape(pv_name)}"', line) and ( version.get_semantic_ocs_version_from_config() <= version.VERSION_4_13 @@ -693,7 +693,7 @@ def get_pvc_provision_times(interface, pvc_name, start_time, time_type="all", op ) or re.search( f'delete "{pv_name}": persistentvolume deleted succeeded', line, - ): + )): if results[name]["delete"]["end"] is None: results[name]["delete"]["end"] = ( extruct_timestamp_from_log(line) From 6223523865bd31d7758f065077f3d02642358fa7 Mon Sep 17 00:00:00 2001 From: Joy John Pinto <86055382+pintojoy@users.noreply.github.com> Date: Thu, 8 May 2025 15:29:56 +0530 Subject: [PATCH 6/6] Fixing script issues Signed-off-by: Joy John Pinto <86055382+pintojoy@users.noreply.github.com> --- ocs_ci/helpers/performance_lib.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ocs_ci/helpers/performance_lib.py b/ocs_ci/helpers/performance_lib.py index 8051213e163..7093295f8aa 100644 --- a/ocs_ci/helpers/performance_lib.py +++ b/ocs_ci/helpers/performance_lib.py @@ -693,7 +693,7 @@ def get_pvc_provision_times(interface, pvc_name, start_time, time_type="all", op ) or re.search( f'delete "{pv_name}": persistentvolume deleted succeeded', line, - )): + ): if results[name]["delete"]["end"] is None: results[name]["delete"]["end"] = ( extruct_timestamp_from_log(line)