[VAULT-3379] Add support for contained DBs in MSSQL root rotation and lease revocation (#12839)

This commit is contained in:
vinay-gopalan
2021-10-19 14:11:47 -07:00
committed by GitHub
parent 2bcd1c25c7
commit 81fb7750b0
5 changed files with 75 additions and 6 deletions

View File

@@ -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)
})
}
}