From e4885e87255ef567d61aae8765b13110767115c9 Mon Sep 17 00:00:00 2001 From: Tom Proctor Date: Thu, 25 Aug 2022 15:14:37 +0000 Subject: [PATCH] backport of commit 247a019be0ace89bfa3cdc54c0294829bf390ef0 --- builtin/logical/database/rotation_test.go | 2 +- builtin/logical/mongodb/backend_test.go | 6 +++--- plugins/database/mongodb/mongodb_test.go | 12 ++++++------ 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/builtin/logical/database/rotation_test.go b/builtin/logical/database/rotation_test.go index 37751587b56b4..96ea6a37b521b 100644 --- a/builtin/logical/database/rotation_test.go +++ b/builtin/logical/database/rotation_test.go @@ -713,7 +713,7 @@ func TestBackend_StaticRole_Rotations_PostgreSQL(t *testing.T) { } func TestBackend_StaticRole_Rotations_MongoDB(t *testing.T) { - cleanup, connURL := mongodb.PrepareTestContainerWithDatabase(t, "latest", "vaulttestdb") + cleanup, connURL := mongodb.PrepareTestContainerWithDatabase(t, "5.0.10", "vaulttestdb") defer cleanup() uc := userCreator(func(t *testing.T, username, password string) { diff --git a/builtin/logical/mongodb/backend_test.go b/builtin/logical/mongodb/backend_test.go index 1b85fef03c454..43cee7de981ca 100644 --- a/builtin/logical/mongodb/backend_test.go +++ b/builtin/logical/mongodb/backend_test.go @@ -57,7 +57,7 @@ func TestBackend_basic(t *testing.T) { t.Fatal(err) } - cleanup, connURI := mongodb.PrepareTestContainer(t, "latest") + cleanup, connURI := mongodb.PrepareTestContainer(t, "5.0.10") defer cleanup() connData := map[string]interface{}{ "uri": connURI, @@ -81,7 +81,7 @@ func TestBackend_roleCrud(t *testing.T) { t.Fatal(err) } - cleanup, connURI := mongodb.PrepareTestContainer(t, "latest") + cleanup, connURI := mongodb.PrepareTestContainer(t, "5.0.10") defer cleanup() connData := map[string]interface{}{ "uri": connURI, @@ -107,7 +107,7 @@ func TestBackend_leaseWriteRead(t *testing.T) { t.Fatal(err) } - cleanup, connURI := mongodb.PrepareTestContainer(t, "latest") + cleanup, connURI := mongodb.PrepareTestContainer(t, "5.0.10") defer cleanup() connData := map[string]interface{}{ "uri": connURI, diff --git a/plugins/database/mongodb/mongodb_test.go b/plugins/database/mongodb/mongodb_test.go index 250f3083bbce9..d647a264f184a 100644 --- a/plugins/database/mongodb/mongodb_test.go +++ b/plugins/database/mongodb/mongodb_test.go @@ -27,7 +27,7 @@ import ( const mongoAdminRole = `{ "db": "admin", "roles": [ { "role": "readWrite" } ] }` func TestMongoDB_Initialize(t *testing.T) { - cleanup, connURL := mongodb.PrepareTestContainer(t, "latest") + cleanup, connURL := mongodb.PrepareTestContainer(t, "5.0.10") defer cleanup() db := new() @@ -120,7 +120,7 @@ func TestNewUser_usernameTemplate(t *testing.T) { for name, test := range tests { t.Run(name, func(t *testing.T) { - cleanup, connURL := mongodb.PrepareTestContainer(t, "latest") + cleanup, connURL := mongodb.PrepareTestContainer(t, "5.0.10") defer cleanup() db := new() @@ -146,7 +146,7 @@ func TestNewUser_usernameTemplate(t *testing.T) { } func TestMongoDB_CreateUser(t *testing.T) { - cleanup, connURL := mongodb.PrepareTestContainer(t, "latest") + cleanup, connURL := mongodb.PrepareTestContainer(t, "5.0.10") defer cleanup() db := new() @@ -178,7 +178,7 @@ func TestMongoDB_CreateUser(t *testing.T) { } func TestMongoDB_CreateUser_writeConcern(t *testing.T) { - cleanup, connURL := mongodb.PrepareTestContainer(t, "latest") + cleanup, connURL := mongodb.PrepareTestContainer(t, "5.0.10") defer cleanup() initReq := dbplugin.InitializeRequest{ @@ -212,7 +212,7 @@ func TestMongoDB_CreateUser_writeConcern(t *testing.T) { } func TestMongoDB_DeleteUser(t *testing.T) { - cleanup, connURL := mongodb.PrepareTestContainer(t, "latest") + cleanup, connURL := mongodb.PrepareTestContainer(t, "5.0.10") defer cleanup() db := new() @@ -252,7 +252,7 @@ func TestMongoDB_DeleteUser(t *testing.T) { } func TestMongoDB_UpdateUser_Password(t *testing.T) { - cleanup, connURL := mongodb.PrepareTestContainer(t, "latest") + cleanup, connURL := mongodb.PrepareTestContainer(t, "5.0.10") defer cleanup() // The docker test method PrepareTestContainer defaults to a database "test"