1010from pytest import fixture , mark
1111from tests import test_logger
1212from tests .conftest import (
13- LEGACY_DEPLOYMENT_STATE_VERSION ,
1413 LEGACY_MULTI_CLUSTER_OPERATOR_NAME ,
15- LEGACY_OPERATOR_NAME ,
1614 MULTI_CLUSTER_OPERATOR_NAME ,
1715 create_appdb_certs ,
1816 get_central_cluster_name ,
1917 get_custom_appdb_version ,
20- install_official_operator ,
18+ install_legacy_deployment_state_meko ,
2119 log_deployments_info ,
2220)
2321from tests .multicluster .conftest import cluster_spec_list
4240At each step, we verify that the state is correct
4341"""
4442
43+ # TODO CLOUDP-318100: this test should eventually be updated and not pinned to 1.27 anymore
44+
4545
4646def assert_cm_expected_data (
4747 name : str , namespace : str , expected_data : Optional [Dict ], central_cluster_client : kubernetes .client .ApiClient
@@ -168,7 +168,7 @@ def ops_manager(
168168 return resource
169169
170170
171- @mark .e2e_multi_cluster_appdb_state_operator_upgrade_downgrade
171+ @mark .e2e_multi_cluster_appdb_upgrade_downgrade_v1_27_to_mck
172172class TestOpsManagerCreation :
173173 """
174174 Ensure correct deployment and state of AppDB, with operator version 1.27 installed.
@@ -186,23 +186,15 @@ def test_install_legacy_state_official_operator(
186186 member_cluster_clients ,
187187 member_cluster_names ,
188188 ):
189- logger .info (
190- f"Installing the official operator from helm charts, with version { LEGACY_DEPLOYMENT_STATE_VERSION } "
191- )
192- operator = install_official_operator (
193- namespace ,
194- managed_security_context ,
195- operator_installation_config ,
196- central_cluster_name ,
197- central_cluster_client ,
198- member_cluster_clients ,
199- member_cluster_names ,
200- custom_operator_version = LEGACY_DEPLOYMENT_STATE_VERSION ,
201- operator_name = LEGACY_OPERATOR_NAME ,
189+ install_legacy_deployment_state_meko (
190+ namespace = namespace ,
191+ managed_security_context = managed_security_context ,
192+ operator_installation_config = operator_installation_config ,
193+ central_cluster_name = central_cluster_name ,
194+ central_cluster_client = central_cluster_client ,
195+ member_cluster_clients = member_cluster_clients ,
196+ member_cluster_names = member_cluster_names ,
202197 )
203- operator .assert_is_running ()
204- # Dumping deployments in logs ensure we are using the correct operator version
205- log_deployments_info (namespace )
206198
207199 def test_create_appdb_certs_secret (
208200 self ,
@@ -240,15 +232,15 @@ def test_state_correctness(
240232 assert_cm_expected_data (configmap_name , namespace , expected_data , central_cluster_client )
241233
242234
243- @mark .e2e_multi_cluster_appdb_state_operator_upgrade_downgrade
235+ @mark .e2e_multi_cluster_appdb_upgrade_downgrade_v1_27_to_mck
244236class TestOperatorUpgrade :
245237 """
246238 Upgrade the operator to latest dev version, scale AppDB, and ensure state correctness.
247239 """
248240
249241 def test_downscale_latest_official_operator (self , namespace : str ):
250- # Scale down the existing operator deployment to 0. This is needed as long as the
251- # `official_operator` fixture installs the MEKO operator.
242+ # Scale down the existing operator deployment to 0. This is needed as we are initially installing MEKO
243+ # and replacing it with MCK
252244 downscale_operator_deployment (deployment_name = LEGACY_MULTI_CLUSTER_OPERATOR_NAME , namespace = namespace )
253245
254246 def test_install_default_operator (self , namespace : str , multi_cluster_operator : Operator ):
@@ -285,15 +277,13 @@ def test_old_state_still_exists(
285277 )
286278
287279
288- @mark .e2e_multi_cluster_appdb_state_operator_upgrade_downgrade
280+ @mark .e2e_multi_cluster_appdb_upgrade_downgrade_v1_27_to_mck
289281class TestOperatorDowngrade :
290282 """
291283 Downgrade the Operator to 1.27, scale AppDB and ensure state correctness.
292284 """
293285
294286 def test_downscale_default_operator (self , namespace : str ):
295- # Scale down the existing operator deployment to 0. This is needed as long as the
296- # `official_operator` fixture installs the MEKO operator.
297287 downscale_operator_deployment (deployment_name = MULTI_CLUSTER_OPERATOR_NAME , namespace = namespace )
298288
299289 def test_install_legacy_state_official_operator (
@@ -306,21 +296,15 @@ def test_install_legacy_state_official_operator(
306296 member_cluster_clients ,
307297 member_cluster_names ,
308298 ):
309- logger .info (f"Downgrading the operator to version { LEGACY_DEPLOYMENT_STATE_VERSION } , from helm chart release" )
310- operator = install_official_operator (
311- namespace ,
312- managed_security_context ,
313- operator_installation_config ,
314- central_cluster_name ,
315- central_cluster_client ,
316- member_cluster_clients ,
317- member_cluster_names ,
318- custom_operator_version = LEGACY_DEPLOYMENT_STATE_VERSION ,
319- operator_name = LEGACY_OPERATOR_NAME ,
299+ install_legacy_deployment_state_meko (
300+ namespace = namespace ,
301+ managed_security_context = managed_security_context ,
302+ operator_installation_config = operator_installation_config ,
303+ central_cluster_name = central_cluster_name ,
304+ central_cluster_client = central_cluster_client ,
305+ member_cluster_clients = member_cluster_clients ,
306+ member_cluster_names = member_cluster_names ,
320307 )
321- operator .assert_is_running ()
322- # Dumping deployments in logs ensure we are using the correct operator version
323- log_deployments_info (namespace )
324308
325309 def test_om_running_after_downgrade (self , ops_manager : MongoDBOpsManager ):
326310 ops_manager .load ()
0 commit comments