From 2268f0c598617de878de9fe2bb5c7cb44bcee58a Mon Sep 17 00:00:00 2001 From: Guillaume Tardif Date: Tue, 30 Jun 2020 10:11:06 +0200 Subject: [PATCH] Renamed Login method specific to tests, to make things more explicit --- azure/login/login.go | 5 +++-- tests/aci-e2e/e2e-aci_test.go | 3 +-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/azure/login/login.go b/azure/login/login.go index c072f6eb..2df64823 100644 --- a/azure/login/login.go +++ b/azure/login/login.go @@ -94,8 +94,9 @@ func newAzureLoginServiceFromPath(tokenStorePath string, helper apiHelper) (Azur }, nil } -// LoginFromServicePrincipal login with clientId / clientSecret from a previously created service principal -func (login AzureLoginService) LoginFromServicePrincipal(clientID string, clientSecret string, tenantID string) error { +// TestLoginFromServicePrincipal login with clientId / clientSecret from a previously created service principal. +// The resulting token does not include a refresh token, used for tests only +func (login AzureLoginService) TestLoginFromServicePrincipal(clientID string, clientSecret string, tenantID string) error { // Tried with auth2.NewUsernamePasswordConfig() but could not make this work with username / password, setting this for CI with clientID / clientSecret creds := auth2.NewClientCredentialsConfig(clientID, clientSecret, tenantID) diff --git a/tests/aci-e2e/e2e-aci_test.go b/tests/aci-e2e/e2e-aci_test.go index 2d7292de..54471321 100644 --- a/tests/aci-e2e/e2e-aci_test.go +++ b/tests/aci-e2e/e2e-aci_test.go @@ -71,7 +71,6 @@ func (s *E2eACISuite) TestContextDefault() { } func (s *E2eACISuite) TestACIBackend() { - It("Logs in azure using service principal credentials", func() { login, err := login.NewAzureLoginService() Expect(err).To(BeNil()) @@ -79,7 +78,7 @@ func (s *E2eACISuite) TestACIBackend() { clientID := os.Getenv("AZURE_CLIENT_ID") clientSecret := os.Getenv("AZURE_CLIENT_SECRET") tenantID := os.Getenv("AZURE_TENANT_ID") - err = login.LoginFromServicePrincipal(clientID, clientSecret, tenantID) + err = login.TestLoginFromServicePrincipal(clientID, clientSecret, tenantID) Expect(err).To(BeNil()) })