From 09b9075abb6701baed72737d92ef39bc00fce592 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Petersen" Date: Wed, 28 Sep 2022 16:02:56 -0400 Subject: [PATCH 1/2] Update TestLDAPSearch_Parallel to notice different var for external ldap server --- test/integration/ldap_client_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/integration/ldap_client_test.go b/test/integration/ldap_client_test.go index 3541dfa0..3bae11e6 100644 --- a/test/integration/ldap_client_test.go +++ b/test/integration/ldap_client_test.go @@ -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. // It requires the test LDAP server from the tools deployment. - if len(env.ToolsNamespace) == 0 { - t.Skip("Skipping test because it requires the test LDAP server in the tools namespace.") + if len(env.ToolsNamespace) == 0 || !strings.Contains(env.SupervisorUpstreamLDAP.Host, "tools.svc.cluster.local") { + 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()) From 66f4ee8a1b49786c12a6894f25f223390b4f1c96 Mon Sep 17 00:00:00 2001 From: Ryan Richard Date: Wed, 28 Sep 2022 14:32:10 -0700 Subject: [PATCH 2/2] Update more tests to notice different var for external ldap server --- test/integration/ldap_client_test.go | 4 ++-- test/integration/supervisor_login_test.go | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/test/integration/ldap_client_test.go b/test/integration/ldap_client_test.go index 3bae11e6..89e25d45 100644 --- a/test/integration/ldap_client_test.go +++ b/test/integration/ldap_client_test.go @@ -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. // It requires the test LDAP server from the tools deployment. - if len(env.ToolsNamespace) == 0 { - t.Skip("Skipping test because it requires the test LDAP server in the tools namespace.") + if len(env.ToolsNamespace) == 0 || !strings.Contains(env.SupervisorUpstreamLDAP.Host, "tools.svc.cluster.local") { + 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()) diff --git a/test/integration/supervisor_login_test.go b/test/integration/supervisor_login_test.go index 63a9e562..41a269cf 100644 --- a/test/integration/supervisor_login_test.go +++ b/test/integration/supervisor_login_test.go @@ -305,9 +305,11 @@ func TestSupervisorLogin_Browser(t *testing.T) { createIDP: func(t *testing.T) string { var additionalScopes []string // 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 } else { + // Using Dex in the tools namespace. for _, additionalScope := range env.SupervisorUpstreamOIDC.AdditionalScopes { if additionalScope != "offline_access" { additionalScopes = append(additionalScopes, additionalScope)