Skip to content

Commit d9f42b0

Browse files
committed
resolve pr comments
1 parent be6e733 commit d9f42b0

10 files changed

+200
-201
lines changed

docker/mongodb-kubernetes-tests/kubetester/automation_config_tester.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def get_all_processes(self):
3838

3939
def get_automation_agent_password(self):
4040
return self.automation_config["auth"]["autoPwd"]
41-
41+
4242
def assert_expected_users(self, expected_users: int):
4343
automation_config_users = 0
4444

docker/mongodb-kubernetes-tests/tests/authentication/helper_replica_set_switch_project.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,10 @@ def test_switch_replica_set_project(self):
5656
self.replica_set.assert_reaches_phase(Phase.Running, timeout=600)
5757
switched_tester = self.replica_set.get_automation_config_tester()
5858
switched_automation_agent_password = switched_tester.get_automation_agent_password()
59-
60-
assert original_automation_agent_password == switched_automation_agent_password, (
61-
"The automation agent password changed after switching the project."
62-
)
59+
60+
assert (
61+
original_automation_agent_password == switched_automation_agent_password
62+
), "The automation agent password changed after switching the project."
6363

6464
def test_ops_manager_state_with_users(self, user_name: str, expected_roles: set, expected_users: int):
6565
tester = self.replica_set.get_automation_config_tester()

docker/mongodb-kubernetes-tests/tests/authentication/helper_sharded_cluster_switch_project.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,10 @@ def test_switch_sharded_cluster_project(self):
5757
self.sharded_cluster.assert_reaches_phase(Phase.Running, timeout=800)
5858
switched_tester = self.sharded_cluster.get_automation_config_tester()
5959
switched_automation_agent_password = switched_tester.get_automation_agent_password()
60-
61-
assert original_automation_agent_password == switched_automation_agent_password, (
62-
"The automation agent password changed after switching the project."
63-
)
6460

61+
assert (
62+
original_automation_agent_password == switched_automation_agent_password
63+
), "The automation agent password changed after switching the project."
6564

6665
def test_ops_manager_state_with_users(self, user_name: str, expected_roles: set, expected_users: int):
6766
tester = self.sharded_cluster.get_automation_config_tester()

docker/mongodb-kubernetes-tests/tests/authentication/replica_set_ldap_switch_project.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,5 +141,5 @@ def test_switch_replica_set_project(self, test_helper: ReplicaSetCreationAndProj
141141
def test_ops_manager_state_with_users_correctly_updated_after_switch(
142142
self, test_helper: ReplicaSetCreationAndProjectSwitchTestHelper
143143
):
144-
test_helper.test_ops_manager_state_with_expected_authentication(expected_users=0)
144+
test_helper.test_ops_manager_state_with_expected_authentication(expected_users=1)
145145
# There should be one user (the previously created user should still exist in the automation configuration). We need to investigate further to understand why the user is not being picked up.

docker/mongodb-kubernetes-tests/tests/authentication/replica_set_scram_sha_1_switch_project.py

Lines changed: 45 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -56,37 +56,37 @@ def test_ops_manager_state_correctly_updated_in_initial_replica_set(
5656
):
5757
test_helper.test_ops_manager_state_with_expected_authentication(expected_users=0)
5858

59-
def test_create_secret(self):
60-
create_or_update_secret(
61-
KubernetesTester.get_namespace(),
62-
"mms-user-1-password",
63-
{
64-
"password": "my-password",
65-
},
66-
)
67-
68-
def test_create_user(self, namespace: str):
69-
mdb = MongoDBUser.from_yaml(
70-
load_fixture("scram-sha-user.yaml"),
71-
namespace=namespace,
72-
)
73-
mdb["spec"]["mongodbResourceRef"]["name"] = MDB_RESOURCE_NAME
74-
mdb.update()
75-
mdb.assert_reaches_phase(Phase.Updated, timeout=150)
76-
77-
def test_ops_manager_state_with_users_correctly_updated(
78-
self, test_helper: ReplicaSetCreationAndProjectSwitchTestHelper
79-
):
80-
user_name = "mms-user-1"
81-
expected_roles = {
82-
("admin", "clusterAdmin"),
83-
("admin", "userAdminAnyDatabase"),
84-
("admin", "readWrite"),
85-
("admin", "userAdminAnyDatabase"),
86-
}
87-
test_helper.test_ops_manager_state_with_users(
88-
user_name=user_name, expected_roles=expected_roles, expected_users=1
89-
)
59+
# def test_create_secret(self):
60+
# create_or_update_secret(
61+
# KubernetesTester.get_namespace(),
62+
# "mms-user-1-password",
63+
# {
64+
# "password": "my-password",
65+
# },
66+
# )
67+
68+
# def test_create_user(self, namespace: str):
69+
# mdb = MongoDBUser.from_yaml(
70+
# load_fixture("scram-sha-user.yaml"),
71+
# namespace=namespace,
72+
# )
73+
# mdb["spec"]["mongodbResourceRef"]["name"] = MDB_RESOURCE_NAME
74+
# mdb.update()
75+
# mdb.assert_reaches_phase(Phase.Updated, timeout=150)
76+
77+
# def test_ops_manager_state_with_users_correctly_updated(
78+
# self, test_helper: ReplicaSetCreationAndProjectSwitchTestHelper
79+
# ):
80+
# user_name = "mms-user-1"
81+
# expected_roles = {
82+
# ("admin", "clusterAdmin"),
83+
# ("admin", "userAdminAnyDatabase"),
84+
# ("admin", "readWrite"),
85+
# ("admin", "userAdminAnyDatabase"),
86+
# }
87+
# test_helper.test_ops_manager_state_with_users(
88+
# user_name=user_name, expected_roles=expected_roles, expected_users=1
89+
# )
9090

9191
def test_switch_replica_set_project(self, test_helper: ReplicaSetCreationAndProjectSwitchTestHelper):
9292
test_helper.test_switch_replica_set_project()
@@ -97,18 +97,18 @@ def test_replica_set_connectivity_after_switch(self, test_helper: ReplicaSetCrea
9797
def test_ops_manager_state_correctly_updated_after_switch(
9898
self, test_helper: ReplicaSetCreationAndProjectSwitchTestHelper
9999
):
100-
test_helper.test_ops_manager_state_with_expected_authentication(expected_users=1)
100+
test_helper.test_ops_manager_state_with_expected_authentication(expected_users=0)
101101

102-
def test_ops_manager_state_with_users_correctly_updated_after_switch(
103-
self, test_helper: ReplicaSetCreationAndProjectSwitchTestHelper
104-
):
105-
user_name = "mms-user-1"
106-
expected_roles = {
107-
("admin", "clusterAdmin"),
108-
("admin", "userAdminAnyDatabase"),
109-
("admin", "readWrite"),
110-
("admin", "userAdminAnyDatabase"),
111-
}
112-
test_helper.test_ops_manager_state_with_users(
113-
user_name=user_name, expected_roles=expected_roles, expected_users=1
114-
)
102+
# def test_ops_manager_state_with_users_correctly_updated_after_switch(
103+
# self, test_helper: ReplicaSetCreationAndProjectSwitchTestHelper
104+
# ):
105+
# user_name = "mms-user-1"
106+
# expected_roles = {
107+
# ("admin", "clusterAdmin"),
108+
# ("admin", "userAdminAnyDatabase"),
109+
# ("admin", "readWrite"),
110+
# ("admin", "userAdminAnyDatabase"),
111+
# }
112+
# test_helper.test_ops_manager_state_with_users(
113+
# user_name=user_name, expected_roles=expected_roles, expected_users=1
114+
# )

docker/mongodb-kubernetes-tests/tests/authentication/replica_set_scram_sha_256_switch_project.py

Lines changed: 45 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -51,37 +51,37 @@ def test_replica_set_connectivity(self, test_helper: ReplicaSetCreationAndProjec
5151
def test_ops_manager_state_correctly_updated(self, test_helper: ReplicaSetCreationAndProjectSwitchTestHelper):
5252
test_helper.test_ops_manager_state_with_expected_authentication(expected_users=0)
5353

54-
def test_create_secret(self):
55-
create_or_update_secret(
56-
KubernetesTester.get_namespace(),
57-
"mms-user-1-password",
58-
{
59-
"password": "my-password",
60-
},
61-
)
62-
63-
def test_create_user(self, namespace: str):
64-
mdb = MongoDBUser.from_yaml(
65-
load_fixture("scram-sha-user.yaml"),
66-
namespace=namespace,
67-
)
68-
mdb["spec"]["mongodbResourceRef"]["name"] = MDB_RESOURCE_NAME
69-
mdb.update()
70-
mdb.assert_reaches_phase(Phase.Updated, timeout=150)
71-
72-
def test_ops_manager_state_with_users_correctly_updated(
73-
self, test_helper: ReplicaSetCreationAndProjectSwitchTestHelper
74-
):
75-
user_name = "mms-user-1"
76-
expected_roles = {
77-
("admin", "clusterAdmin"),
78-
("admin", "userAdminAnyDatabase"),
79-
("admin", "readWrite"),
80-
("admin", "userAdminAnyDatabase"),
81-
}
82-
test_helper.test_ops_manager_state_with_users(
83-
user_name=user_name, expected_roles=expected_roles, expected_users=1
84-
)
54+
# def test_create_secret(self):
55+
# create_or_update_secret(
56+
# KubernetesTester.get_namespace(),
57+
# "mms-user-1-password",
58+
# {
59+
# "password": "my-password",
60+
# },
61+
# )
62+
63+
# def test_create_user(self, namespace: str):
64+
# mdb = MongoDBUser.from_yaml(
65+
# load_fixture("scram-sha-user.yaml"),
66+
# namespace=namespace,
67+
# )
68+
# mdb["spec"]["mongodbResourceRef"]["name"] = MDB_RESOURCE_NAME
69+
# mdb.update()
70+
# mdb.assert_reaches_phase(Phase.Updated, timeout=150)
71+
72+
# def test_ops_manager_state_with_users_correctly_updated(
73+
# self, test_helper: ReplicaSetCreationAndProjectSwitchTestHelper
74+
# ):
75+
# user_name = "mms-user-1"
76+
# expected_roles = {
77+
# ("admin", "clusterAdmin"),
78+
# ("admin", "userAdminAnyDatabase"),
79+
# ("admin", "readWrite"),
80+
# ("admin", "userAdminAnyDatabase"),
81+
# }
82+
# test_helper.test_ops_manager_state_with_users(
83+
# user_name=user_name, expected_roles=expected_roles, expected_users=1
84+
# )
8585

8686
def test_switch_replica_set_project(self, test_helper: ReplicaSetCreationAndProjectSwitchTestHelper):
8787
test_helper.test_switch_replica_set_project()
@@ -92,18 +92,18 @@ def test_replica_set_connectivity_after_switch(self, test_helper: ReplicaSetCrea
9292
def test_ops_manager_state_correctly_updated_after_switch(
9393
self, test_helper: ReplicaSetCreationAndProjectSwitchTestHelper
9494
):
95-
test_helper.test_ops_manager_state_with_expected_authentication(expected_users=1)
95+
test_helper.test_ops_manager_state_with_expected_authentication(expected_users=0)
9696

97-
def test_ops_manager_state_with_users_correctly_updated_after_switch(
98-
self, test_helper: ReplicaSetCreationAndProjectSwitchTestHelper
99-
):
100-
user_name = "mms-user-1"
101-
expected_roles = {
102-
("admin", "clusterAdmin"),
103-
("admin", "userAdminAnyDatabase"),
104-
("admin", "readWrite"),
105-
("admin", "userAdminAnyDatabase"),
106-
}
107-
test_helper.test_ops_manager_state_with_users(
108-
user_name=user_name, expected_roles=expected_roles, expected_users=1
109-
)
97+
# def test_ops_manager_state_with_users_correctly_updated_after_switch(
98+
# self, test_helper: ReplicaSetCreationAndProjectSwitchTestHelper
99+
# ):
100+
# user_name = "mms-user-1"
101+
# expected_roles = {
102+
# ("admin", "clusterAdmin"),
103+
# ("admin", "userAdminAnyDatabase"),
104+
# ("admin", "readWrite"),
105+
# ("admin", "userAdminAnyDatabase"),
106+
# }
107+
# test_helper.test_ops_manager_state_with_users(
108+
# user_name=user_name, expected_roles=expected_roles, expected_users=1
109+
# )

docker/mongodb-kubernetes-tests/tests/authentication/sharded_cluster_ldap_switch_project.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,5 +136,5 @@ def test_switch_sharded_cluster_project(self, test_helper: ShardedClusterCreatio
136136
def test_ops_manager_state_correctly_updated_after_switch(
137137
self, test_helper: ShardedClusterCreationAndProjectSwitchTestHelper
138138
):
139-
test_helper.test_ops_manager_state_with_expected_authentication(expected_users=0)
139+
test_helper.test_ops_manager_state_with_expected_authentication(expected_users=1)
140140
# There should be one user (the previously created user should still exist in the automation configuration). We need to investigate further to understand why the user is not being picked up.

docker/mongodb-kubernetes-tests/tests/authentication/sharded_cluster_scram_sha_1_switch_project.py

Lines changed: 49 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -58,40 +58,40 @@ def test_sharded_cluster_connectivity(self, test_helper: ShardedClusterCreationA
5858
def test_ops_manager_state_correctly_updated_in_initial_sharded_cluster(
5959
self, test_helper: ShardedClusterCreationAndProjectSwitchTestHelper
6060
):
61-
test_helper.test_ops_manager_state_with_expected_authentication(0)
62-
63-
def test_create_secret(self):
64-
create_or_update_secret(
65-
KubernetesTester.get_namespace(),
66-
self.PASSWORD_SECRET_NAME,
67-
{
68-
"password": self.USER_PASSWORD,
69-
},
70-
)
71-
72-
def test_create_user(self, namespace: str):
73-
mdb = MongoDBUser.from_yaml(
74-
load_fixture("scram-sha-user.yaml"),
75-
namespace=namespace,
76-
)
77-
mdb["spec"]["mongodbResourceRef"]["name"] = MDB_RESOURCE_NAME
78-
79-
mdb.update()
80-
mdb.assert_reaches_phase(Phase.Updated, timeout=150)
81-
82-
def test_ops_manager_state_with_users_correctly_updated(
83-
self, test_helper: ShardedClusterCreationAndProjectSwitchTestHelper
84-
):
85-
user_name = "mms-user-1"
86-
expected_roles = {
87-
("admin", "clusterAdmin"),
88-
("admin", "userAdminAnyDatabase"),
89-
("admin", "readWrite"),
90-
("admin", "userAdminAnyDatabase"),
91-
}
92-
test_helper.test_ops_manager_state_with_users(
93-
user_name=user_name, expected_roles=expected_roles, expected_users=1
94-
)
61+
test_helper.test_ops_manager_state_with_expected_authentication(expected_users=0)
62+
63+
# def test_create_secret(self):
64+
# create_or_update_secret(
65+
# KubernetesTester.get_namespace(),
66+
# self.PASSWORD_SECRET_NAME,
67+
# {
68+
# "password": self.USER_PASSWORD,
69+
# },
70+
# )
71+
72+
# def test_create_user(self, namespace: str):
73+
# mdb = MongoDBUser.from_yaml(
74+
# load_fixture("scram-sha-user.yaml"),
75+
# namespace=namespace,
76+
# )
77+
# mdb["spec"]["mongodbResourceRef"]["name"] = MDB_RESOURCE_NAME
78+
79+
# mdb.update()
80+
# mdb.assert_reaches_phase(Phase.Updated, timeout=150)
81+
82+
# def test_ops_manager_state_with_users_correctly_updated(
83+
# self, test_helper: ShardedClusterCreationAndProjectSwitchTestHelper
84+
# ):
85+
# user_name = "mms-user-1"
86+
# expected_roles = {
87+
# ("admin", "clusterAdmin"),
88+
# ("admin", "userAdminAnyDatabase"),
89+
# ("admin", "readWrite"),
90+
# ("admin", "userAdminAnyDatabase"),
91+
# }
92+
# test_helper.test_ops_manager_state_with_users(
93+
# user_name=user_name, expected_roles=expected_roles, expected_users=1
94+
# )
9595

9696
def test_switch_sharded_cluster_project(self, test_helper: ShardedClusterCreationAndProjectSwitchTestHelper):
9797
test_helper.test_switch_sharded_cluster_project()
@@ -104,18 +104,18 @@ def test_sharded_cluster_connectivity_after_switch(
104104
def test_ops_manager_state_correctly_updated_after_switch(
105105
self, test_helper: ShardedClusterCreationAndProjectSwitchTestHelper
106106
):
107-
test_helper.test_ops_manager_state_with_expected_authentication(expected_users=1)
108-
109-
def test_ops_manager_state_with_users_correctly_updated_after_switch(
110-
self, test_helper: ShardedClusterCreationAndProjectSwitchTestHelper
111-
):
112-
user_name = "mms-user-1"
113-
expected_roles = {
114-
("admin", "clusterAdmin"),
115-
("admin", "userAdminAnyDatabase"),
116-
("admin", "readWrite"),
117-
("admin", "userAdminAnyDatabase"),
118-
}
119-
test_helper.test_ops_manager_state_with_users(
120-
user_name=user_name, expected_roles=expected_roles, expected_users=1
121-
)
107+
test_helper.test_ops_manager_state_with_expected_authentication(expected_users=0)
108+
109+
# def test_ops_manager_state_with_users_correctly_updated_after_switch(
110+
# self, test_helper: ShardedClusterCreationAndProjectSwitchTestHelper
111+
# ):
112+
# user_name = "mms-user-1"
113+
# expected_roles = {
114+
# ("admin", "clusterAdmin"),
115+
# ("admin", "userAdminAnyDatabase"),
116+
# ("admin", "readWrite"),
117+
# ("admin", "userAdminAnyDatabase"),
118+
# }
119+
# test_helper.test_ops_manager_state_with_users(
120+
# user_name=user_name, expected_roles=expected_roles, expected_users=1
121+
# )

0 commit comments

Comments
 (0)