mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-01 11:08:10 +00:00
[VAULT-3379] Add support for contained DBs in MSSQL root rotation and lease revocation (#12839)
This commit is contained in:
@@ -42,6 +42,15 @@ func TestInitialize(t *testing.T) {
|
||||
VerifyConnection: true,
|
||||
},
|
||||
},
|
||||
"contained_db set": {
|
||||
dbplugin.InitializeRequest{
|
||||
Config: map[string]interface{}{
|
||||
"connection_url": connURL,
|
||||
"contained_db": "true",
|
||||
},
|
||||
VerifyConnection: true,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
for name, test := range tests {
|
||||
@@ -265,6 +274,26 @@ func TestUpdateUser_password(t *testing.T) {
|
||||
}
|
||||
|
||||
assertCredsExist(t, connURL, dbUser, test.expectedPassword)
|
||||
|
||||
// Delete user at the end of each test
|
||||
deleteReq := dbplugin.DeleteUserRequest{
|
||||
Username: dbUser,
|
||||
}
|
||||
|
||||
ctx, cancel = context.WithTimeout(context.Background(), 5*time.Second)
|
||||
defer cancel()
|
||||
deleteResp, err := db.DeleteUser(ctx, deleteReq)
|
||||
if err != nil {
|
||||
t.Fatalf("Failed to delete user: %s", err)
|
||||
}
|
||||
|
||||
// Protect against future fields that aren't specified
|
||||
expectedDeleteResp := dbplugin.DeleteUserResponse{}
|
||||
if !reflect.DeepEqual(deleteResp, expectedDeleteResp) {
|
||||
t.Fatalf("Fields missing from expected response: Actual: %#v", deleteResp)
|
||||
}
|
||||
|
||||
assertCredsDoNotExist(t, connURL, dbUser, initPassword)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user