|
| 1 | +import kubernetes |
| 2 | +from pytest import fixture, mark |
| 3 | + |
| 4 | +from .multicluster_appdb_disaster_recovery_shared import MultiClusterAppDBDisasterRecovery |
| 5 | + |
| 6 | + |
| 7 | +@mark.usefixtures("multi_cluster_operator") |
| 8 | +@mark.e2e_multi_cluster_appdb_disaster_recovery_force_reconfigure |
| 9 | +class TestMultiClusterAppDBDisasterRecoveryForceReconfig: |
| 10 | + |
| 11 | + @fixture(scope="module") |
| 12 | + def ops_manager( |
| 13 | + self, |
| 14 | + namespace: str, |
| 15 | + custom_version: str, |
| 16 | + custom_appdb_version: str, |
| 17 | + multi_cluster_issuer_ca_configmap: str, |
| 18 | + central_cluster_client: kubernetes.client.ApiClient, |
| 19 | + ): |
| 20 | + return MultiClusterAppDBDisasterRecovery.create_ops_manager( |
| 21 | + namespace, custom_version, custom_appdb_version, multi_cluster_issuer_ca_configmap, central_cluster_client, [2, 3] |
| 22 | + ) |
| 23 | + |
| 24 | + @fixture(scope="module") |
| 25 | + def appdb_certs_secret(self, namespace: str, multi_cluster_issuer: str, ops_manager): |
| 26 | + return MultiClusterAppDBDisasterRecovery.create_appdb_certs_secret(namespace, multi_cluster_issuer, ops_manager) |
| 27 | + |
| 28 | + @fixture(scope="module") |
| 29 | + def config_version(self): |
| 30 | + return MultiClusterAppDBDisasterRecovery.create_config_version() |
| 31 | + |
| 32 | + def test_patch_central_namespace(self, namespace: str, central_cluster_client: kubernetes.client.ApiClient): |
| 33 | + MultiClusterAppDBDisasterRecovery.test_patch_central_namespace(namespace, central_cluster_client) |
| 34 | + |
| 35 | + def test_create_om_majority_down(self, ops_manager, appdb_certs_secret, config_version): |
| 36 | + MultiClusterAppDBDisasterRecovery.test_create_om_majority_down(ops_manager, appdb_certs_secret, config_version) |
| 37 | + |
| 38 | + def test_remove_cluster_from_operator_member_list_to_simulate_it_is_unhealthy( |
| 39 | + self, namespace, central_cluster_client: kubernetes.client.ApiClient |
| 40 | + ): |
| 41 | + MultiClusterAppDBDisasterRecovery.test_remove_cluster_from_operator_member_list_to_simulate_it_is_unhealthy(namespace, central_cluster_client) |
| 42 | + |
| 43 | + def test_delete_om_and_appdb_statefulset_in_failed_cluster_majority_down( |
| 44 | + self, ops_manager, central_cluster_client: kubernetes.client.ApiClient |
| 45 | + ): |
| 46 | + MultiClusterAppDBDisasterRecovery.test_delete_om_and_appdb_statefulset_in_failed_cluster_majority_down(ops_manager, central_cluster_client) |
| 47 | + |
| 48 | + def test_appdb_is_stable_and_om_is_recreated_majority_down(self, ops_manager, config_version): |
| 49 | + MultiClusterAppDBDisasterRecovery.test_appdb_is_stable_and_om_is_recreated_majority_down(ops_manager, config_version) |
| 50 | + |
| 51 | + def test_add_appdb_member_to_om_cluster_force_reconfig(self, ops_manager, config_version): |
| 52 | + MultiClusterAppDBDisasterRecovery.test_add_appdb_member_to_om_cluster_force_reconfig(ops_manager, config_version) |
| 53 | + |
| 54 | + def test_remove_failed_member_cluster_has_been_scaled_down_majority_down(self, ops_manager, config_version): |
| 55 | + MultiClusterAppDBDisasterRecovery.test_remove_failed_member_cluster_has_been_scaled_down_majority_down(ops_manager, config_version) |
0 commit comments