Added BYOID Metrics

This commit is contained in:
aeitzman
2023-08-28 08:11:33 -07:00
parent a835fc4358
commit 2f8ab1bf0a
13 changed files with 208 additions and 2 deletions

View File

@@ -1442,3 +1442,30 @@ func TestAWSCredential_Validations(t *testing.T) {
})
}
}
func TestAwsCredential_CredentialSourceType(t *testing.T) {
server := createDefaultAwsTestServer()
ts := httptest.NewServer(server)
tsURL, err := neturl.Parse(ts.URL)
if err != nil {
t.Fatalf("couldn't parse httptest servername")
}
oldValidHostnames := validHostnames
defer func() {
validHostnames = oldValidHostnames
}()
validHostnames = []string{tsURL.Hostname()}
tfc := testFileConfig
tfc.CredentialSource = server.getCredentialSource(ts.URL)
base, err := tfc.parse(context.Background())
if err != nil {
t.Fatalf("parse() failed %v", err)
}
if got, want := base.credentialSourceType(), "aws"; got != want {
t.Errorf("got %v but want %v", got, want)
}
}