From 5edd22c8b140fda065c6efd8026219ac416b03f4 Mon Sep 17 00:00:00 2001 From: "Luis (LT) Carbonell" Date: Tue, 2 May 2023 09:35:04 -0500 Subject: [PATCH] add testing defaults --- builtin/credential/ldap/backend_test.go | 5 ++++- helper/testhelpers/ldap/ldaphelper.go | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/builtin/credential/ldap/backend_test.go b/builtin/credential/ldap/backend_test.go index beda248e4b09..7c59ece7b607 100644 --- a/builtin/credential/ldap/backend_test.go +++ b/builtin/credential/ldap/backend_test.go @@ -1219,6 +1219,9 @@ func TestLdapAuthBackend_ConfigUpgrade(t *testing.T) { falseBool := new(bool) *falseBool = false + maxPageInt := new(int) + *maxPageInt = 1000 + exp := &ldapConfigEntry{ TokenParams: tokenutil.TokenParams{ TokenPeriod: 5 * time.Minute, @@ -1243,7 +1246,7 @@ func TestLdapAuthBackend_ConfigUpgrade(t *testing.T) { ConnectionTimeout: cfg.ConnectionTimeout, UsernameAsAlias: false, DerefAliases: "never", - MaximumPageSize: 1000, + MaximumPageSize: maxPageInt, }, } diff --git a/helper/testhelpers/ldap/ldaphelper.go b/helper/testhelpers/ldap/ldaphelper.go index 4f89f429cf28..9d5a8d4940d4 100644 --- a/helper/testhelpers/ldap/ldaphelper.go +++ b/helper/testhelpers/ldap/ldaphelper.go @@ -36,7 +36,9 @@ func PrepareTestContainer(t *testing.T, version string) (cleanup func(), cfg *ld cfg.GroupDN = "ou=people,dc=planetexpress,dc=com" cfg.GroupAttr = "cn" cfg.RequestTimeout = 60 - *cfg.MaximumPageSize = 1000 + + maxPageSize := 1000 + cfg.MaximumPageSize = &maxPageSize svc, err := runner.StartService(context.Background(), func(ctx context.Context, host string, port int) (docker.ServiceConfig, error) { connURL := fmt.Sprintf("ldap://%s:%d", host, port)