Skip to content

Commit b757513

Browse files
committed
fix(ci): Fix CA cert path on oauth tests
1 parent af20ce2 commit b757513

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

auth_providers/auth_oauth_test.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@ func TestCommandConfigOauth_Authenticate(t *testing.T) {
107107
t.FailNow()
108108
}
109109

110+
caCertPath := "../lib/certs/int-oidc-lab.eastus2.cloudapp.azure.com.pem"
111+
110112
//Delete the config file
111113
t.Logf("Deleting config file: %s", configFilePath)
112114
os.Remove(configFilePath)
@@ -121,7 +123,7 @@ func TestCommandConfigOauth_Authenticate(t *testing.T) {
121123
//os.Setenv(auth_providers.EnvKeyfactorConfigFile, configFilePath)
122124
//os.Setenv(auth_providers.EnvKeyfactorAuthProfile, "oauth")
123125
os.Setenv(auth_providers.EnvKeyfactorSkipVerify, "true")
124-
os.Setenv(auth_providers.EnvKeyfactorCACert, "lib/certs/int-oidc-lab.eastus2.cloudapp.azure.com.pem")
126+
os.Setenv(auth_providers.EnvKeyfactorCACert, caCertPath)
125127

126128
//current working directory
127129
cwd, _ := os.Getwd()
@@ -149,7 +151,7 @@ func TestCommandConfigOauth_Authenticate(t *testing.T) {
149151
)
150152
t.Log(fmt.Sprintf("Testing %s", noParamsTestName))
151153
t.Logf("Setting environment variable %s", auth_providers.EnvKeyfactorCACert)
152-
os.Setenv(auth_providers.EnvKeyfactorCACert, "lib/certs/int-oidc-lab.eastus2.cloudapp.azure.com.pem")
154+
os.Setenv(auth_providers.EnvKeyfactorCACert, caCertPath)
153155
noParamsConfig = &auth_providers.CommandConfigOauth{}
154156
authOauthTest(t, noParamsTestName, false, noParamsConfig)
155157
t.Logf("Unsetting environment variable %s", auth_providers.EnvKeyfactorCACert)
@@ -266,7 +268,7 @@ func TestCommandConfigOauth_Authenticate(t *testing.T) {
266268
wCaCertConfigFile := &auth_providers.CommandConfigOauth{}
267269
wCaCertConfigFile.
268270
WithConfigProfile("oauth").
269-
WithCommandCACert("lib/certs/int-oidc-lab.eastus2.cloudapp.azure.com.pem").
271+
WithCommandCACert(caCertPath).
270272
WithSkipVerify(true)
271273
authOauthTest(
272274
t, "oAuth with valid implicit config file profile param, caCert, and skiptls", false,

0 commit comments

Comments
 (0)