From 25a1490088aab73542481d75ef092ed163f3581d Mon Sep 17 00:00:00 2001 From: Yulia Persky Date: Thu, 8 Feb 2024 08:14:39 +0200 Subject: [PATCH] CSI-Addons CR resources should not be editable after creation in 4.15 (#9117) CSI-Addons CR resources should not be editable after creation in 4.15 * This PR implements an automation for verifying that CR resources are not editable after creation in 4.15 Signed-off-by: Yulia Persky --- .../test_cr_resources_validation.py | 22 +++++++++---------- 1 file changed, 10 insertions(+), 12 deletions(-) rename tests/{cross_functional/system_test => functional/pv/pv_services}/test_cr_resources_validation.py (96%) diff --git a/tests/cross_functional/system_test/test_cr_resources_validation.py b/tests/functional/pv/pv_services/test_cr_resources_validation.py similarity index 96% rename from tests/cross_functional/system_test/test_cr_resources_validation.py rename to tests/functional/pv/pv_services/test_cr_resources_validation.py index 0e254800cc6..8ead04c58f1 100644 --- a/tests/cross_functional/system_test/test_cr_resources_validation.py +++ b/tests/functional/pv/pv_services/test_cr_resources_validation.py @@ -4,12 +4,11 @@ import yaml from tempfile import NamedTemporaryFile -from ocs_ci.framework.pytest_customization.marks import bugzilla, magenta_squad +from ocs_ci.framework.pytest_customization.marks import bugzilla, green_squad from ocs_ci.framework.testlib import ( skipif_ocp_version, - skipif_ocs_version, ManageTest, - tier3, + tier2, ) from ocs_ci.helpers import helpers from ocs_ci.helpers.performance_lib import run_oc_command @@ -22,10 +21,9 @@ ERRMSG = "Error in command" -@magenta_squad -@tier3 -@skipif_ocp_version("<4.13") -@skipif_ocs_version("<4.13") +@green_squad +@tier2 +@skipif_ocp_version("<4.15") class TestCRRsourcesValidation(ManageTest): """ Test that check that csi addons resources are not editable after creation @@ -77,10 +75,10 @@ def cr_resource_not_editable( cr_object_kind (str): cr object kind cr_resource_yaml (str): full path of the yaml file from which the object is to be created non_editable_patches (dict, of str: str): patches to be applied by 'oc patch' command. These patches should - have no effect. If such a patch is sucessfully applied, the test should fail + have no effect. If such a patch is applied successfully , the test should fail editable_patches (dict, of str: str): patches to be applied by 'oc patch' command. These patches should - have an effect. If such a patch is not sucessfully applied, the test should fail - namespace (str): namespace in which cr object should be created + have an effect. If such a patch is not applied successfully , the test should fail + namespace (str): namespace in which CR object should be created """ res = run_oc_command(cmd=f"create -f {cr_resource_yaml}", namespace=namespace) @@ -97,7 +95,7 @@ def cr_resource_not_editable( f"get {cr_resource_name} -o yaml", namespace=namespace ) - # test that all non editable properties are really not editable + # test to verify that all the non-editable properties are really not editable non_editable_properties_errors = {} cr_resource_prev_yaml = cr_resource_original_yaml for patch in non_editable_patches: @@ -195,7 +193,7 @@ def cr_resource_not_editable( def test_network_fence_not_editable(self): """ - Test case to check that some properties of network fence object are not editable once object is created + Test case to check that some properties of network fence object are not editable once the object is created """ non_editable_patches = { # dictionary: patch_name --> patch