Skip to content

Commit a918fde

Browse files
committed
add monitoring ee2e test
1 parent 76a2dcb commit a918fde

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

docker/mongodb-kubernetes-tests/tests/opsmanager/withMonitoredAppDB/om_ops_manager_appdb_monitoring_tls.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,3 +101,33 @@ def test_new_database_is_monitored_after_restart(ops_manager: MongoDBOpsManager)
101101
# We want to retrieve measurements from "new_database" which will indicate
102102
# that the monitoring agents are working with the new credentials.
103103
ops_manager.assert_monitoring_data_exists(database_name=database_name, timeout=1200, all_hosts=False)
104+
105+
106+
@mark.e2e_om_appdb_monitoring_tls
107+
def test_monitoring_works_after_tls_disable(ops_manager: MongoDBOpsManager):
108+
"""
109+
CLOUDP-351614: Verify monitoring continues to work after disabling TLS.
110+
When TLS is disabled, the monitoring config should not contain stale TLS params.
111+
"""
112+
ops_manager.load()
113+
114+
# Transition to allowTLS mode first (required before disabling TLS)
115+
ops_manager["spec"]["applicationDatabase"]["additionalMongodConfig"] = {
116+
"net": {"tls": {"mode": "allowTLS"}}
117+
}
118+
ops_manager.update()
119+
ops_manager.appdb_status().assert_reaches_phase(Phase.Running, timeout=1200)
120+
121+
# Disable TLS on AppDB
122+
ops_manager["spec"]["applicationDatabase"]["security"]["certsSecretPrefix"] = None
123+
ops_manager["spec"]["applicationDatabase"]["security"]["tls"]["enabled"] = False
124+
ops_manager.update()
125+
ops_manager.appdb_status().assert_reaches_phase(Phase.Running, timeout=1200)
126+
127+
# Verify monitoring agents are still healthy after TLS disable
128+
tester = ops_manager.get_om_tester(ops_manager.app_db_name())
129+
agents_after = tester.api_read_monitoring_agents()
130+
appdb_hostnames = ops_manager.get_appdb_hostnames_for_monitoring()
131+
appdb_agents_after = [a for a in agents_after if a["hostname"] in appdb_hostnames]
132+
assert all(a["stateName"] in ["ACTIVE", "STANDBY"] for a in appdb_agents_after), \
133+
f"Monitoring agents should be healthy after TLS disable: {appdb_agents_after}"

0 commit comments

Comments
 (0)