Skip to content
This repository was archived by the owner on Dec 12, 2025. It is now read-only.

Commit 4b79e74

Browse files
authored
CLOUDP-71332: TLS internal cluster auth tests (#169)
1 parent 2f33578 commit 4b79e74

File tree

12 files changed

+33
-3
lines changed

12 files changed

+33
-3
lines changed

test/e2e/feature_compatibility_version/feature_compatibility_version_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ func TestFeatureCompatibilityVersion(t *testing.T) {
4040

4141
t.Run("Create MongoDB Resource", mongodbtests.CreateMongoDBResource(&mdb, ctx))
4242
t.Run("Basic tests", mongodbtests.BasicFunctionality(&mdb))
43-
43+
t.Run("Ensure Authentication", tester.EnsureAuthenticationIsConfigured(3))
4444
t.Run("Test FeatureCompatibilityVersion is 4.0", tester.HasFCV("4.0", 3))
4545

4646
// Upgrade version to 4.2.6 while keeping the FCV set to 4.0

test/e2e/feature_compatibility_version_upgrade/feature_compatibility_version_upgrade_test.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,21 @@ func TestFeatureCompatibilityVersionUpgrade(t *testing.T) {
3535
t.Fatal(err)
3636
}
3737

38+
_, err = setup.GeneratePasswordForUser(user, ctx)
39+
if err != nil {
40+
t.Fatal(err)
41+
}
42+
3843
tester, err := mongotester.FromResource(t, mdb)
3944
if err != nil {
4045
t.Fatal(err)
4146
}
4247

4348
t.Run("Create MongoDB Resource", mongodbtests.CreateMongoDBResource(&mdb, ctx))
4449
t.Run("Basic tests", mongodbtests.BasicFunctionality(&mdb))
45-
50+
t.Run("Ensure Authentication", tester.EnsureAuthenticationIsConfigured(3))
4651
t.Run("Test FeatureCompatibilityVersion is 4.0", tester.HasFCV("4.0", 3))
52+
4753
// Upgrade version to 4.2.6 while keeping the FCV set to 4.0
4854
t.Run("MongoDB is reachable", func(t *testing.T) {
4955
defer tester.StartBackgroundConnectivityTest(t, time.Second*10)()

test/e2e/replica_set/replica_set_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,6 @@ func TestReplicaSet(t *testing.T) {
3737
t.Run("Basic tests", mongodbtests.BasicFunctionality(&mdb))
3838
t.Run("Keyfile authentication is configured", tester.HasKeyfileAuth(3))
3939
t.Run("Test Basic Connectivity", tester.ConnectivitySucceeds())
40+
t.Run("Ensure Authentication", tester.EnsureAuthenticationIsConfigured(3))
4041
t.Run("AutomationConfig has the correct version", mongodbtests.AutomationConfigVersionHasTheExpectedVersion(&mdb, 1))
4142
}

test/e2e/replica_set_change_version/replica_set_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ func TestReplicaSetUpgradeVersion(t *testing.T) {
4444
t.Run("Basic tests", mongodbtests.BasicFunctionality(&mdb))
4545
t.Run("Test Basic Connectivity", tester.ConnectivitySucceeds())
4646
t.Run("AutomationConfig has the correct version", mongodbtests.AutomationConfigVersionHasTheExpectedVersion(&mdb, 1))
47+
t.Run("Ensure Authentication", tester.EnsureAuthenticationIsConfigured(3))
4748

4849
// Upgrade version to 4.4.0
4950
t.Run("MongoDB is reachable while version is upgraded", func(t *testing.T) {

test/e2e/replica_set_mongod_config/replica_set_mongod_config_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ func TestReplicaSet(t *testing.T) {
4343

4444
t.Run("Create MongoDB Resource", mongodbtests.CreateMongoDBResource(&mdb, ctx))
4545
t.Run("Basic tests", mongodbtests.BasicFunctionality(&mdb))
46+
t.Run("Ensure Authentication", tester.EnsureAuthenticationIsConfigured(3))
4647
t.Run("Test Basic Connectivity", tester.ConnectivitySucceeds())
4748
t.Run("AutomationConfig has the correct version", mongodbtests.AutomationConfigVersionHasTheExpectedVersion(&mdb, 1))
4849
t.Run("Mongod config has been set", tester.EnsureMongodConfig(setting, value))

test/e2e/replica_set_multiple/replica_set_multiple_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ func TestReplicaSet(t *testing.T) {
6161
t.Run("mdb0: AutomationConfig has the correct version", mongodbtests.AutomationConfigVersionHasTheExpectedVersion(&mdb0, 1))
6262
t.Run("mdb1: AutomationConfig has the correct version", mongodbtests.AutomationConfigVersionHasTheExpectedVersion(&mdb1, 1))
6363

64+
t.Run("mdb0: Ensure Authentication", tester0.EnsureAuthenticationIsConfigured(3))
65+
t.Run("mdb1: Ensure Authentication", tester1.EnsureAuthenticationIsConfigured(3))
66+
6467
t.Run("MongoDB is reachable while being scaled up", func(t *testing.T) {
6568
defer tester0.StartBackgroundConnectivityTest(t, time.Second*10)()
6669
t.Run("Scale MongoDB Resource Up", mongodbtests.Scale(&mdb0, 5))

test/e2e/replica_set_readiness_probe/replica_set_readiness_probe_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ func TestReplicaSetReadinessProbeScaling(t *testing.T) {
4343
t.Run("Basic tests", mongodbtests.BasicFunctionality(&mdb))
4444
t.Run("Test Basic Connectivity", tester.ConnectivitySucceeds())
4545
t.Run("AutomationConfig has the correct version", mongodbtests.AutomationConfigVersionHasTheExpectedVersion(&mdb, 1))
46+
t.Run("Ensure Authentication", tester.EnsureAuthenticationIsConfigured(3))
47+
4648
t.Run("MongoDB is reachable", func(t *testing.T) {
4749
defer tester.StartBackgroundConnectivityTest(t, time.Second*10)()
4850
t.Run("Delete Random Pod", mongodbtests.DeletePod(&mdb, rand.Intn(mdb.Spec.Members)))

test/e2e/replica_set_scale/replica_set_scaling_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ func TestReplicaSetScale(t *testing.T) {
4040
t.Run("Create MongoDB Resource", mongodbtests.CreateMongoDBResource(&mdb, ctx))
4141
t.Run("Basic tests", mongodbtests.BasicFunctionality(&mdb))
4242
t.Run("Test Basic Connectivity", tester.ConnectivitySucceeds())
43+
t.Run("Ensure Authentication", tester.EnsureAuthenticationIsConfigured(3))
4344
t.Run("AutomationConfig has the correct version", mongodbtests.AutomationConfigVersionHasTheExpectedVersion(&mdb, 1))
4445
t.Run("MongoDB is reachable", func(t *testing.T) {
4546
defer tester.StartBackgroundConnectivityTest(t, time.Second*10)()

test/e2e/replica_set_tls/replica_set_tls_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,5 @@ func TestReplicaSetTLS(t *testing.T) {
4343
t.Run("Wait for TLS to be enabled", tester.HasTlsMode("requireSSL", 60))
4444
t.Run("Test Basic TLS Connectivity", tester.ConnectivitySucceeds(WithTls()))
4545
t.Run("Test TLS required", tester.ConnectivityFails(WithoutTls()))
46+
t.Run("Ensure Authentication", tester.EnsureAuthenticationIsConfigured(3, WithTls()))
4647
}

test/e2e/replica_set_tls_rotate/replica_set_tls_rotate_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ func TestReplicaSetTLSRotate(t *testing.T) {
4444
t.Run("Basic tests", mongodbtests.BasicFunctionality(&mdb))
4545
t.Run("Wait for TLS to be enabled", tester.HasTlsMode("requireSSL", 60, WithTls()))
4646
t.Run("Test Basic TLS Connectivity", tester.ConnectivitySucceeds(WithTls()))
47+
t.Run("Ensure Authentication", tester.EnsureAuthenticationIsConfigured(3, WithTls()))
4748
t.Run("Test TLS required", tester.ConnectivityFails(WithoutTls()))
4849

4950
t.Run("MongoDB is reachable while certificate is rotated", func(t *testing.T) {

0 commit comments

Comments
 (0)