diff --git a/ocs_ci/helpers/keyrotation_helper.py b/ocs_ci/helpers/keyrotation_helper.py index da22262c2e9..11f080dbb1e 100644 --- a/ocs_ci/helpers/keyrotation_helper.py +++ b/ocs_ci/helpers/keyrotation_helper.py @@ -422,27 +422,6 @@ def wait_till_keyrotation(self, device_handle): return True -def enable_key_rotation(): - """ - Enable Key rotation and verify its status for Noobaa and Storage cluster. - - """ - osd_keyrotation = OSDKeyrotation() - noobaa_keyrotation = NoobaaKeyrotation() - osd_keyrotation.enable_keyrotation() - noobaa_keyrotation.enable_keyrotation() - - assert ( - osd_keyrotation.is_keyrotation_enable() - ), "Encryption Key rotation is not enabled for OSDs" - assert ( - noobaa_keyrotation.is_keyrotation_enable - ), "Keyrotation is not enabled in the storagecluster object." - assert ( - noobaa_keyrotation.is_noobaa_keyrotation_enable - ), "Keyrotation is not enabled in the noobaa object." - - def verify_key_rotation_time(schedule): """ Verify Key rotation schedule changed at storage cluster, rook and Noobaa object. diff --git a/tests/cross_functional/system_test/test_cluster_wide_key_rotation_systemtest.py b/tests/cross_functional/system_test/test_cluster_wide_key_rotation_systemtest.py index 5a7965ab9fb..2fc56e908d4 100644 --- a/tests/cross_functional/system_test/test_cluster_wide_key_rotation_systemtest.py +++ b/tests/cross_functional/system_test/test_cluster_wide_key_rotation_systemtest.py @@ -12,7 +12,6 @@ ) from ocs_ci.helpers.keyrotation_helper import ( verify_key_rotation_time, - enable_key_rotation, verify_new_key_after_rotation, OSDKeyrotation, ) @@ -55,7 +54,6 @@ def test_cluster_wide_encryption_key_rotation_system( teardown_project_factory, pvc_factory, pod_factory, - threading_lock, bucket_factory_session, mcg_obj_session, noobaa_db_backup_and_recovery_locally, @@ -64,9 +62,10 @@ def test_cluster_wide_encryption_key_rotation_system( warps3, ): """ - 1. Set cluster wide keyrotation period to every 5 mins by editing storage cluster and capture the keys details - for OSDs, Noobaa. - 2. Set custom taints to all the worker nodes and make sure #1 and #2 still exists after rebooting the pods. + 1. Function OSDKeyrotation().set_keyrotation_schedule is to set cluster wide keyrotation period to every 5 mins + 2. Using verify_new_key_after_rotation function to Capture the keys details and verify new keys + after the scheduled time. + 3. Set custom taints to all the worker nodes and make sure #1 and #2 still exists after rebooting the pods. a) Apply custom taint to all nodes b) Add toleration in storagecluster CR and odf-operator subscription. c) Verify toleration applied in ODF subscription and Storage Cluster CR are reflecting for other @@ -74,21 +73,18 @@ def test_cluster_wide_encryption_key_rotation_system( d) Verify the pods in all nodes are running as per taints applied. e) Restart all ocs the pods on all nodes. - 3. Fill the cluster till the full ratio limits (85%) by running IO from multiple pods and verify key rotation. - 4. Once the cluster reaches read-only state, resize the OSD and verify key rotation. - 5. Run noobaa_rebuild test and verify key rotation still works as it is. - 6. Run noobaa-db backup and recovery locally. Verify key rotation. + 4. Fill the cluster till the full ratio limits (85%) by running FIO from multiple pods and verify key rotation. + 5. Once the cluster reaches read-only state, resize the OSD using basic_resize_osd and verify key rotation. + 6. Run validate_noobaa_rebuild_system function to verify key rotation still works as it is afetr nobba rebuild. + 7. Run validate_noobaa_db_backup_recovery_locally_system and verify key rotation. """ time_interval_to_rotate_key_in_minutes = str(5) tries = 10 delays = int(time_interval_to_rotate_key_in_minutes) * 60 / tries schedule = f"*/{time_interval_to_rotate_key_in_minutes} * * * *" - log.info("Enabling the key rotation if not done") - enable_key_rotation() log.info("Setting the key rotation time by editing storage cluster") OSDKeyrotation().set_keyrotation_schedule(schedule) - schedule = f"*/{time_interval_to_rotate_key_in_minutes} * * * *" log.info("Verifying the key rotation time set properly or not") verify_key_rotation_time(schedule=schedule) log.info("Verifying the new key generated by comparing it with older key") @@ -116,7 +112,6 @@ def test_cluster_wide_encryption_key_rotation_system( "After OSD resize, verifying the new key generated by comparing it with older key" ) verify_new_key_after_rotation(tries, delays) - run_fio_obj.cleanup() log.info("Triggering noobaa rebuild test") @@ -146,3 +141,4 @@ def test_cluster_wide_encryption_key_rotation_system( "After noobaa db backup and recovery, verifying the new key generated by comparing it with older key" ) verify_new_key_after_rotation(tries, delays) + run_fio_obj.cleanup()