Merge pull request #1306 from vmware-tanzu/ci-updates-for-external-idps

Update TestLDAPSearch_Parallel to notice different var for external ldap server
This commit is contained in:
Ben Petersen 2022-09-29 12:35:50 -04:00 committed by GitHub
commit 4951cbe5d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 5 deletions

View File

@ -35,8 +35,8 @@ func TestLDAPSearch_Parallel(t *testing.T) {
// Note that these tests depend on the values hard-coded in the LDIF file in test/deploy/tools/ldap.yaml. // Note that these tests depend on the values hard-coded in the LDIF file in test/deploy/tools/ldap.yaml.
// It requires the test LDAP server from the tools deployment. // It requires the test LDAP server from the tools deployment.
if len(env.ToolsNamespace) == 0 { if len(env.ToolsNamespace) == 0 || !strings.Contains(env.SupervisorUpstreamLDAP.Host, "tools.svc.cluster.local") {
t.Skip("Skipping test because it requires the test LDAP server in the tools namespace.") t.Skip("Skipping test because it requires the test OpenLDAP server in the tools namespace of the target cluster.")
} }
ctx, cancelFunc := context.WithCancel(context.Background()) ctx, cancelFunc := context.WithCancel(context.Background())
@ -681,8 +681,8 @@ func TestSimultaneousLDAPRequestsOnSingleProvider(t *testing.T) {
// Note that these tests depend on the values hard-coded in the LDIF file in test/deploy/tools/ldap.yaml. // Note that these tests depend on the values hard-coded in the LDIF file in test/deploy/tools/ldap.yaml.
// It requires the test LDAP server from the tools deployment. // It requires the test LDAP server from the tools deployment.
if len(env.ToolsNamespace) == 0 { if len(env.ToolsNamespace) == 0 || !strings.Contains(env.SupervisorUpstreamLDAP.Host, "tools.svc.cluster.local") {
t.Skip("Skipping test because it requires the test LDAP server in the tools namespace.") t.Skip("Skipping test because it requires the test OpenLDAP server in the tools namespace of the target cluster.")
} }
ctx, cancelFunc := context.WithCancel(context.Background()) ctx, cancelFunc := context.WithCancel(context.Background())

View File

@ -305,9 +305,11 @@ func TestSupervisorLogin_Browser(t *testing.T) {
createIDP: func(t *testing.T) string { createIDP: func(t *testing.T) string {
var additionalScopes []string var additionalScopes []string
// keep all the scopes except for offline access so we can test the access token based refresh flow. // keep all the scopes except for offline access so we can test the access token based refresh flow.
if len(env.ToolsNamespace) == 0 { if len(env.ToolsNamespace) == 0 || !strings.Contains(env.SupervisorUpstreamLDAP.Host, "tools.svc.cluster.local") {
// Not using Dex.
additionalScopes = env.SupervisorUpstreamOIDC.AdditionalScopes additionalScopes = env.SupervisorUpstreamOIDC.AdditionalScopes
} else { } else {
// Using Dex in the tools namespace.
for _, additionalScope := range env.SupervisorUpstreamOIDC.AdditionalScopes { for _, additionalScope := range env.SupervisorUpstreamOIDC.AdditionalScopes {
if additionalScope != "offline_access" { if additionalScope != "offline_access" {
additionalScopes = append(additionalScopes, additionalScope) additionalScopes = append(additionalScopes, additionalScope)