From 2f3159e2aa448ce840c9d1e8b7f6c85bd5c84998 Mon Sep 17 00:00:00 2001 From: feistel <6742251-feistel@users.noreply.gitlab.com> Date: Tue, 4 May 2021 14:16:58 +0200 Subject: this can be a private function --- test/acceptance/acme_test.go | 4 +- test/acceptance/artifacts_test.go | 4 +- test/acceptance/auth_test.go | 24 ++++++------ test/acceptance/encodings_test.go | 4 +- test/acceptance/helpers_test.go | 2 +- test/acceptance/metrics_test.go | 2 +- test/acceptance/proxyv2_test.go | 2 +- test/acceptance/redirects_test.go | 6 +-- test/acceptance/serving_test.go | 58 ++++++++++++++--------------- test/acceptance/status_test.go | 10 ++--- test/acceptance/tls_test.go | 8 ++-- test/acceptance/unknown_http_method_test.go | 2 +- test/acceptance/zip_test.go | 6 +-- 13 files changed, 66 insertions(+), 66 deletions(-) (limited to 'test') diff --git a/test/acceptance/acme_test.go b/test/acceptance/acme_test.go index df4227b0..eb8f2160 100644 --- a/test/acceptance/acme_test.go +++ b/test/acceptance/acme_test.go @@ -12,7 +12,7 @@ import ( func TestAcmeChallengesWhenItIsNotConfigured(t *testing.T) { skipUnlessEnabled(t) - teardown := RunPagesProcess(t, *pagesBinary, SupportedListeners(), "", "") + teardown := RunPagesProcess(t, *pagesBinary, supportedListeners(), "", "") defer teardown() t.Run("When domain folder contains requested acme challenge it responds with it", func(t *testing.T) { @@ -41,7 +41,7 @@ func TestAcmeChallengesWhenItIsNotConfigured(t *testing.T) { func TestAcmeChallengesWhenItIsConfigured(t *testing.T) { skipUnlessEnabled(t) - teardown := RunPagesProcess(t, *pagesBinary, SupportedListeners(), "", "-gitlab-server=https://gitlab-acme.com") + teardown := RunPagesProcess(t, *pagesBinary, supportedListeners(), "", "-gitlab-server=https://gitlab-acme.com") defer teardown() t.Run("When domain folder contains requested acme challenge it responds with it", func(t *testing.T) { diff --git a/test/acceptance/artifacts_test.go b/test/acceptance/artifacts_test.go index ff44d4d2..ccb58106 100644 --- a/test/acceptance/artifacts_test.go +++ b/test/acceptance/artifacts_test.go @@ -134,7 +134,7 @@ func TestArtifactProxyRequest(t *testing.T) { teardown := RunPagesProcessWithSSLCertFile( t, *pagesBinary, - SupportedListeners(), + supportedListeners(), "", certFile, "-artifacts-server="+artifactServerURL, @@ -238,7 +238,7 @@ func TestPrivateArtifactProxyRequest(t *testing.T) { teardown := RunPagesProcessWithSSLCertFile( t, *pagesBinary, - SupportedListeners(), + supportedListeners(), "", certFile, "-config="+configFile, diff --git a/test/acceptance/auth_test.go b/test/acceptance/auth_test.go index 7c444221..e59144b9 100644 --- a/test/acceptance/auth_test.go +++ b/test/acceptance/auth_test.go @@ -16,7 +16,7 @@ import ( func TestWhenAuthIsDisabledPrivateIsNotAccessible(t *testing.T) { skipUnlessEnabled(t) - teardown := RunPagesProcess(t, *pagesBinary, SupportedListeners(), "", "") + teardown := RunPagesProcess(t, *pagesBinary, supportedListeners(), "", "") defer teardown() rsp, err := GetPageFromListener(t, httpListener, "group.auth.gitlab-example.com", "private.project/") @@ -28,7 +28,7 @@ func TestWhenAuthIsDisabledPrivateIsNotAccessible(t *testing.T) { func TestWhenAuthIsEnabledPrivateWillRedirectToAuthorize(t *testing.T) { skipUnlessEnabled(t) - teardown := RunPagesProcessWithAuth(t, *pagesBinary, SupportedListeners(), "") + teardown := RunPagesProcessWithAuth(t, *pagesBinary, supportedListeners(), "") defer teardown() rsp, err := GetRedirectPage(t, httpsListener, "group.auth.gitlab-example.com", "private.project/") @@ -60,7 +60,7 @@ func TestWhenAuthIsEnabledPrivateWillRedirectToAuthorize(t *testing.T) { func TestWhenAuthDeniedWillCauseUnauthorized(t *testing.T) { skipUnlessEnabled(t) - teardown := RunPagesProcessWithAuth(t, *pagesBinary, SupportedListeners(), "") + teardown := RunPagesProcessWithAuth(t, *pagesBinary, supportedListeners(), "") defer teardown() rsp, err := GetPageFromListener(t, httpsListener, "projects.gitlab-example.com", "/auth?error=access_denied") @@ -72,7 +72,7 @@ func TestWhenAuthDeniedWillCauseUnauthorized(t *testing.T) { } func TestWhenLoginCallbackWithWrongStateShouldFail(t *testing.T) { skipUnlessEnabled(t) - teardown := RunPagesProcessWithAuth(t, *pagesBinary, SupportedListeners(), "") + teardown := RunPagesProcessWithAuth(t, *pagesBinary, supportedListeners(), "") defer teardown() rsp, err := GetRedirectPage(t, httpsListener, "group.auth.gitlab-example.com", "private.project/") @@ -91,7 +91,7 @@ func TestWhenLoginCallbackWithWrongStateShouldFail(t *testing.T) { func TestWhenLoginCallbackWithUnencryptedCode(t *testing.T) { skipUnlessEnabled(t) - teardown := RunPagesProcessWithAuth(t, *pagesBinary, SupportedListeners(), "") + teardown := RunPagesProcessWithAuth(t, *pagesBinary, supportedListeners(), "") defer teardown() rsp, err := GetRedirectPage(t, httpsListener, "group.auth.gitlab-example.com", "private.project/") @@ -187,7 +187,7 @@ func TestAccessControlUnderCustomDomain(t *testing.T) { testServer.Start() defer testServer.Close() - teardown := RunPagesProcessWithAuthServer(t, *pagesBinary, SupportedListeners(), "", testServer.URL) + teardown := RunPagesProcessWithAuthServer(t, *pagesBinary, supportedListeners(), "", testServer.URL) defer teardown() tests := map[string]struct { @@ -268,7 +268,7 @@ func TestCustomErrorPageWithAuth(t *testing.T) { testServer.Start() defer testServer.Close() - teardown := RunPagesProcessWithAuthServer(t, *pagesBinary, SupportedListeners(), "", testServer.URL) + teardown := RunPagesProcessWithAuthServer(t, *pagesBinary, supportedListeners(), "", testServer.URL) defer teardown() tests := []struct { @@ -378,7 +378,7 @@ func TestAccessControlUnderCustomDomainWithHTTPSProxy(t *testing.T) { testServer.Start() defer testServer.Close() - teardown := RunPagesProcessWithAuthServer(t, *pagesBinary, SupportedListeners(), "", testServer.URL) + teardown := RunPagesProcessWithAuthServer(t, *pagesBinary, supportedListeners(), "", testServer.URL) defer teardown() rsp, err := GetProxyRedirectPageWithCookie(t, proxyListener, "private.domain.com", "/", "", true) @@ -441,7 +441,7 @@ func TestAccessControlUnderCustomDomainWithHTTPSProxy(t *testing.T) { func TestAccessControlGroupDomain404RedirectsAuth(t *testing.T) { skipUnlessEnabled(t) - teardown := RunPagesProcessWithAuth(t, *pagesBinary, SupportedListeners(), "") + teardown := RunPagesProcessWithAuth(t, *pagesBinary, supportedListeners(), "") defer teardown() rsp, err := GetRedirectPage(t, httpListener, "group.gitlab-example.com", "/nonexistent/") @@ -456,7 +456,7 @@ func TestAccessControlGroupDomain404RedirectsAuth(t *testing.T) { } func TestAccessControlProject404DoesNotRedirect(t *testing.T) { skipUnlessEnabled(t) - teardown := RunPagesProcessWithAuth(t, *pagesBinary, SupportedListeners(), "") + teardown := RunPagesProcessWithAuth(t, *pagesBinary, supportedListeners(), "") defer teardown() rsp, err := GetRedirectPage(t, httpListener, "group.gitlab-example.com", "/project/nonexistent/") @@ -572,7 +572,7 @@ func testAccessControl(t *testing.T, runPages runPagesFunc) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - teardown := runPages(t, *pagesBinary, SupportedListeners(), "", certFile, testServer.URL) + teardown := runPages(t, *pagesBinary, supportedListeners(), "", certFile, testServer.URL) defer teardown() rsp, err := GetRedirectPage(t, httpsListener, tt.host, tt.path) @@ -656,7 +656,7 @@ func TestHijackedCode(t *testing.T) { testServer.Start() defer testServer.Close() - teardown := RunPagesProcessWithAuthServer(t, *pagesBinary, SupportedListeners(), "", testServer.URL) + teardown := RunPagesProcessWithAuthServer(t, *pagesBinary, supportedListeners(), "", testServer.URL) defer teardown() /****ATTACKER******/ diff --git a/test/acceptance/encodings_test.go b/test/acceptance/encodings_test.go index af7046ba..e58afd4f 100644 --- a/test/acceptance/encodings_test.go +++ b/test/acceptance/encodings_test.go @@ -10,7 +10,7 @@ import ( func TestMIMETypes(t *testing.T) { skipUnlessEnabled(t) - teardown := RunPagesProcessWithoutWait(t, *pagesBinary, SupportedListeners(), "") + teardown := RunPagesProcessWithoutWait(t, *pagesBinary, supportedListeners(), "") defer teardown() require.NoError(t, httpListener.WaitUntilRequestSucceeds(nil)) @@ -62,7 +62,7 @@ func TestCompressedEncoding(t *testing.T) { }, } - teardown := RunPagesProcess(t, *pagesBinary, SupportedListeners(), "") + teardown := RunPagesProcess(t, *pagesBinary, supportedListeners(), "") defer teardown() for _, tt := range tests { diff --git a/test/acceptance/helpers_test.go b/test/acceptance/helpers_test.go index 8bfd81bc..79bf6d16 100644 --- a/test/acceptance/helpers_test.go +++ b/test/acceptance/helpers_test.go @@ -143,7 +143,7 @@ type ListenSpec struct { Port string } -func SupportedListeners() []ListenSpec { +func supportedListeners() []ListenSpec { if !nettest.SupportsIPv6() { return ipv4Listeners } diff --git a/test/acceptance/metrics_test.go b/test/acceptance/metrics_test.go index f2e30d06..5f20b8f7 100644 --- a/test/acceptance/metrics_test.go +++ b/test/acceptance/metrics_test.go @@ -14,7 +14,7 @@ func TestPrometheusMetricsCanBeScraped(t *testing.T) { _, cleanup := newZipFileServerURL(t, "../../shared/pages/group/zip.gitlab.io/public.zip") defer cleanup() - teardown := RunPagesProcessWithStubGitLabServer(t, true, *pagesBinary, SupportedListeners(), ":42345", []string{}, "-max-conns=10") + teardown := RunPagesProcessWithStubGitLabServer(t, true, *pagesBinary, supportedListeners(), ":42345", []string{}, "-max-conns=10") defer teardown() // need to call an actual resource to populate certain metrics e.g. gitlab_pages_domains_source_api_requests_total diff --git a/test/acceptance/proxyv2_test.go b/test/acceptance/proxyv2_test.go index 5c010684..670f711c 100644 --- a/test/acceptance/proxyv2_test.go +++ b/test/acceptance/proxyv2_test.go @@ -12,7 +12,7 @@ import ( func TestProxyv2(t *testing.T) { skipUnlessEnabled(t) - logBuf, teardown := RunPagesProcessWithOutput(t, *pagesBinary, SupportedListeners(), "") + logBuf, teardown := RunPagesProcessWithOutput(t, *pagesBinary, supportedListeners(), "") defer teardown() // the dummy client IP 10.1.1.1 is set by TestProxyv2Client diff --git a/test/acceptance/redirects_test.go b/test/acceptance/redirects_test.go index 425b017b..ed6ce153 100644 --- a/test/acceptance/redirects_test.go +++ b/test/acceptance/redirects_test.go @@ -12,7 +12,7 @@ import ( func TestDisabledRedirects(t *testing.T) { skipUnlessEnabled(t) - teardown := RunPagesProcessWithEnvs(t, true, *pagesBinary, SupportedListeners(), "", []string{"FF_ENABLE_REDIRECTS=false"}) + teardown := RunPagesProcessWithEnvs(t, true, *pagesBinary, supportedListeners(), "", []string{"FF_ENABLE_REDIRECTS=false"}) defer teardown() // Test that redirects status page is forbidden @@ -33,7 +33,7 @@ func TestDisabledRedirects(t *testing.T) { func TestRedirectStatusPage(t *testing.T) { skipUnlessEnabled(t) - teardown := RunPagesProcess(t, *pagesBinary, SupportedListeners(), "") + teardown := RunPagesProcess(t, *pagesBinary, supportedListeners(), "") defer teardown() rsp, err := GetPageFromListener(t, httpListener, "group.redirects.gitlab-example.com", "/project-redirects/_redirects") @@ -50,7 +50,7 @@ func TestRedirectStatusPage(t *testing.T) { func TestRedirect(t *testing.T) { skipUnlessEnabled(t) - teardown := RunPagesProcess(t, *pagesBinary, SupportedListeners(), "") + teardown := RunPagesProcess(t, *pagesBinary, supportedListeners(), "") defer teardown() // Test that serving a file still works with redirects enabled diff --git a/test/acceptance/serving_test.go b/test/acceptance/serving_test.go index af1f9bef..2bff4531 100644 --- a/test/acceptance/serving_test.go +++ b/test/acceptance/serving_test.go @@ -16,10 +16,10 @@ import ( func TestUnknownHostReturnsNotFound(t *testing.T) { skipUnlessEnabled(t) - teardown := RunPagesProcess(t, *pagesBinary, SupportedListeners(), "") + teardown := RunPagesProcess(t, *pagesBinary, supportedListeners(), "") defer teardown() - for _, spec := range SupportedListeners() { + for _, spec := range supportedListeners() { rsp, err := GetPageFromListener(t, spec, "invalid.invalid", "") require.NoError(t, err) @@ -30,7 +30,7 @@ func TestUnknownHostReturnsNotFound(t *testing.T) { func TestUnknownProjectReturnsNotFound(t *testing.T) { skipUnlessEnabled(t) - teardown := RunPagesProcess(t, *pagesBinary, SupportedListeners(), "") + teardown := RunPagesProcess(t, *pagesBinary, supportedListeners(), "") defer teardown() rsp, err := GetPageFromListener(t, httpListener, "group.gitlab-example.com", "/nonexistent/") @@ -41,7 +41,7 @@ func TestUnknownProjectReturnsNotFound(t *testing.T) { func TestGroupDomainReturns200(t *testing.T) { skipUnlessEnabled(t) - teardown := RunPagesProcess(t, *pagesBinary, SupportedListeners(), "") + teardown := RunPagesProcess(t, *pagesBinary, supportedListeners(), "") defer teardown() rsp, err := GetPageFromListener(t, httpListener, "group.gitlab-example.com", "/") @@ -52,7 +52,7 @@ func TestGroupDomainReturns200(t *testing.T) { func TestKnownHostReturns200(t *testing.T) { skipUnlessEnabled(t) - teardown := RunPagesProcess(t, *pagesBinary, SupportedListeners(), "") + teardown := RunPagesProcess(t, *pagesBinary, supportedListeners(), "") defer teardown() tests := []struct { @@ -89,7 +89,7 @@ func TestKnownHostReturns200(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - for _, spec := range SupportedListeners() { + for _, spec := range supportedListeners() { rsp, err := GetPageFromListener(t, spec, tt.host, tt.path) require.NoError(t, err) @@ -126,12 +126,12 @@ func TestNestedSubgroups(t *testing.T) { makeProjectIndex(subGroupPath) } - teardown := RunPagesProcess(t, *pagesBinary, SupportedListeners(), "", "-pages-root", pagesRoot) + teardown := RunPagesProcess(t, *pagesBinary, supportedListeners(), "", "-pages-root", pagesRoot) defer teardown() for nestingLevel, path := range paths { t.Run(fmt.Sprintf("nested level %d", nestingLevel), func(t *testing.T) { - for _, spec := range SupportedListeners() { + for _, spec := range supportedListeners() { rsp, err := GetPageFromListener(t, spec, "nested.gitlab-example.com", path+"project/") require.NoError(t, err) @@ -148,7 +148,7 @@ func TestNestedSubgroups(t *testing.T) { func TestCustom404(t *testing.T) { skipUnlessEnabled(t) - teardown := RunPagesProcess(t, *pagesBinary, SupportedListeners(), "") + teardown := RunPagesProcess(t, *pagesBinary, supportedListeners(), "") defer teardown() tests := []struct { @@ -193,7 +193,7 @@ func TestCustom404(t *testing.T) { for _, test := range tests { t.Run(fmt.Sprintf("%s/%s", test.host, test.path), func(t *testing.T) { - for _, spec := range SupportedListeners() { + for _, spec := range supportedListeners() { rsp, err := GetPageFromListener(t, spec, test.host, test.path) require.NoError(t, err) @@ -210,10 +210,10 @@ func TestCustom404(t *testing.T) { func TestCORSWhenDisabled(t *testing.T) { skipUnlessEnabled(t) - teardown := RunPagesProcess(t, *pagesBinary, SupportedListeners(), "", "-disable-cross-origin-requests") + teardown := RunPagesProcess(t, *pagesBinary, supportedListeners(), "", "-disable-cross-origin-requests") defer teardown() - for _, spec := range SupportedListeners() { + for _, spec := range supportedListeners() { for _, method := range []string{"GET", "OPTIONS"} { rsp := doCrossOriginRequest(t, spec, method, method, spec.URL("project/")) @@ -226,10 +226,10 @@ func TestCORSWhenDisabled(t *testing.T) { func TestCORSAllowsGET(t *testing.T) { skipUnlessEnabled(t) - teardown := RunPagesProcess(t, *pagesBinary, SupportedListeners(), "") + teardown := RunPagesProcess(t, *pagesBinary, supportedListeners(), "") defer teardown() - for _, spec := range SupportedListeners() { + for _, spec := range supportedListeners() { for _, method := range []string{"GET", "OPTIONS"} { rsp := doCrossOriginRequest(t, spec, method, method, spec.URL("project/")) @@ -243,10 +243,10 @@ func TestCORSAllowsGET(t *testing.T) { func TestCORSForbidsPOST(t *testing.T) { skipUnlessEnabled(t) - teardown := RunPagesProcess(t, *pagesBinary, SupportedListeners(), "") + teardown := RunPagesProcess(t, *pagesBinary, supportedListeners(), "") defer teardown() - for _, spec := range SupportedListeners() { + for _, spec := range supportedListeners() { rsp := doCrossOriginRequest(t, spec, "OPTIONS", "POST", spec.URL("project/")) require.Equal(t, http.StatusOK, rsp.StatusCode) @@ -258,10 +258,10 @@ func TestCORSForbidsPOST(t *testing.T) { func TestCustomHeaders(t *testing.T) { skipUnlessEnabled(t) - teardown := RunPagesProcess(t, *pagesBinary, SupportedListeners(), "", "-header", "X-Test1:Testing1", "-header", "X-Test2:Testing2") + teardown := RunPagesProcess(t, *pagesBinary, supportedListeners(), "", "-header", "X-Test1:Testing1", "-header", "X-Test2:Testing2") defer teardown() - for _, spec := range SupportedListeners() { + for _, spec := range supportedListeners() { rsp, err := GetPageFromListener(t, spec, "group.gitlab-example.com:", "project/") require.NoError(t, err) require.Equal(t, http.StatusOK, rsp.StatusCode) @@ -273,10 +273,10 @@ func TestCustomHeaders(t *testing.T) { func TestKnownHostWithPortReturns200(t *testing.T) { skipUnlessEnabled(t) - teardown := RunPagesProcess(t, *pagesBinary, SupportedListeners(), "") + teardown := RunPagesProcess(t, *pagesBinary, supportedListeners(), "") defer teardown() - for _, spec := range SupportedListeners() { + for _, spec := range supportedListeners() { rsp, err := GetPageFromListener(t, spec, "group.gitlab-example.com:"+spec.Port, "project/") require.NoError(t, err) @@ -287,7 +287,7 @@ func TestKnownHostWithPortReturns200(t *testing.T) { func TestHttpToHttpsRedirectDisabled(t *testing.T) { skipUnlessEnabled(t) - teardown := RunPagesProcess(t, *pagesBinary, SupportedListeners(), "") + teardown := RunPagesProcess(t, *pagesBinary, supportedListeners(), "") defer teardown() rsp, err := GetRedirectPage(t, httpListener, "group.gitlab-example.com", "project/") @@ -303,7 +303,7 @@ func TestHttpToHttpsRedirectDisabled(t *testing.T) { func TestHttpToHttpsRedirectEnabled(t *testing.T) { skipUnlessEnabled(t) - teardown := RunPagesProcess(t, *pagesBinary, SupportedListeners(), "", "-redirect-http=true") + teardown := RunPagesProcess(t, *pagesBinary, supportedListeners(), "", "-redirect-http=true") defer teardown() rsp, err := GetRedirectPage(t, httpListener, "group.gitlab-example.com", "project/") @@ -321,7 +321,7 @@ func TestHttpToHttpsRedirectEnabled(t *testing.T) { func TestHttpsOnlyGroupEnabled(t *testing.T) { skipUnlessEnabled(t) - teardown := RunPagesProcess(t, *pagesBinary, SupportedListeners(), "") + teardown := RunPagesProcess(t, *pagesBinary, supportedListeners(), "") defer teardown() rsp, err := GetRedirectPage(t, httpListener, "group.https-only.gitlab-example.com", "project1/") @@ -332,7 +332,7 @@ func TestHttpsOnlyGroupEnabled(t *testing.T) { func TestHttpsOnlyGroupDisabled(t *testing.T) { skipUnlessEnabled(t) - teardown := RunPagesProcess(t, *pagesBinary, SupportedListeners(), "") + teardown := RunPagesProcess(t, *pagesBinary, supportedListeners(), "") defer teardown() rsp, err := GetPageFromListener(t, httpListener, "group.https-only.gitlab-example.com", "project2/") @@ -343,7 +343,7 @@ func TestHttpsOnlyGroupDisabled(t *testing.T) { func TestHttpsOnlyProjectEnabled(t *testing.T) { skipUnlessEnabled(t) - teardown := RunPagesProcess(t, *pagesBinary, SupportedListeners(), "") + teardown := RunPagesProcess(t, *pagesBinary, supportedListeners(), "") defer teardown() rsp, err := GetRedirectPage(t, httpListener, "test.my-domain.com", "/index.html") @@ -354,7 +354,7 @@ func TestHttpsOnlyProjectEnabled(t *testing.T) { func TestHttpsOnlyProjectDisabled(t *testing.T) { skipUnlessEnabled(t) - teardown := RunPagesProcess(t, *pagesBinary, SupportedListeners(), "") + teardown := RunPagesProcess(t, *pagesBinary, supportedListeners(), "") defer teardown() rsp, err := GetPageFromListener(t, httpListener, "test2.my-domain.com", "/") @@ -365,7 +365,7 @@ func TestHttpsOnlyProjectDisabled(t *testing.T) { func TestHttpsOnlyDomainDisabled(t *testing.T) { skipUnlessEnabled(t) - teardown := RunPagesProcess(t, *pagesBinary, SupportedListeners(), "") + teardown := RunPagesProcess(t, *pagesBinary, supportedListeners(), "") defer teardown() rsp, err := GetPageFromListener(t, httpListener, "no.cert.com", "/") @@ -641,7 +641,7 @@ func TestDomainResolverError(t *testing.T) { "-gitlab-retrieval-timeout", "200ms", "-gitlab-retrieval-interval", "200ms", "-gitlab-retrieval-retries", "1") } - teardown := RunPagesProcessWithEnvs(t, true, *pagesBinary, SupportedListeners(), "", []string{}, pagesArgs...) + teardown := RunPagesProcessWithEnvs(t, true, *pagesBinary, supportedListeners(), "", []string{}, pagesArgs...) defer teardown() response, err := GetPageFromListener(t, httpListener, domainName, "/my/pages/project/") @@ -685,7 +685,7 @@ func doCrossOriginRequest(t *testing.T, spec ListenSpec, method, reqMethod, url func TestQueryStringPersistedInSlashRewrite(t *testing.T) { skipUnlessEnabled(t) - teardown := RunPagesProcess(t, *pagesBinary, SupportedListeners(), "") + teardown := RunPagesProcess(t, *pagesBinary, supportedListeners(), "") defer teardown() rsp, err := GetRedirectPage(t, httpsListener, "group.gitlab-example.com", "project?q=test") diff --git a/test/acceptance/status_test.go b/test/acceptance/status_test.go index d6a0b23c..84bdf476 100644 --- a/test/acceptance/status_test.go +++ b/test/acceptance/status_test.go @@ -10,7 +10,7 @@ import ( func TestStatusPage(t *testing.T) { skipUnlessEnabled(t) - teardown := RunPagesProcess(t, *pagesBinary, SupportedListeners(), "", "-pages-status=/@statuscheck") + teardown := RunPagesProcess(t, *pagesBinary, supportedListeners(), "", "-pages-status=/@statuscheck") defer teardown() rsp, err := GetPageFromListener(t, httpListener, "group.gitlab-example.com", "@statuscheck") @@ -21,10 +21,10 @@ func TestStatusPage(t *testing.T) { func TestStatusNotYetReady(t *testing.T) { skipUnlessEnabled(t) - teardown := RunPagesProcessWithoutWait(t, *pagesBinary, SupportedListeners(), "", "-pages-status=/@statuscheck", "-pages-root=../../shared/invalid-pages") + teardown := RunPagesProcessWithoutWait(t, *pagesBinary, supportedListeners(), "", "-pages-status=/@statuscheck", "-pages-root=../../shared/invalid-pages") defer teardown() - waitForRoundtrips(t, SupportedListeners(), 5*time.Second) + waitForRoundtrips(t, supportedListeners(), 5*time.Second) rsp, err := GetPageFromListener(t, httpListener, "group.gitlab-example.com", "@statuscheck") require.NoError(t, err) defer rsp.Body.Close() @@ -33,9 +33,9 @@ func TestStatusNotYetReady(t *testing.T) { func TestPageNotAvailableIfNotLoaded(t *testing.T) { skipUnlessEnabled(t) - teardown := RunPagesProcessWithoutWait(t, *pagesBinary, SupportedListeners(), "", "-pages-root=../../shared/invalid-pages") + teardown := RunPagesProcessWithoutWait(t, *pagesBinary, supportedListeners(), "", "-pages-root=../../shared/invalid-pages") defer teardown() - waitForRoundtrips(t, SupportedListeners(), 5*time.Second) + waitForRoundtrips(t, supportedListeners(), 5*time.Second) rsp, err := GetPageFromListener(t, httpListener, "group.gitlab-example.com", "index.html") require.NoError(t, err) diff --git a/test/acceptance/tls_test.go b/test/acceptance/tls_test.go index 64b6189b..0ecccc3d 100644 --- a/test/acceptance/tls_test.go +++ b/test/acceptance/tls_test.go @@ -9,7 +9,7 @@ import ( func TestAcceptsSupportedCiphers(t *testing.T) { skipUnlessEnabled(t) - teardown := RunPagesProcess(t, *pagesBinary, SupportedListeners(), "") + teardown := RunPagesProcess(t, *pagesBinary, supportedListeners(), "") defer teardown() tlsConfig := &tls.Config{ @@ -46,7 +46,7 @@ func tlsConfigWithInsecureCiphersOnly() *tls.Config { func TestRejectsUnsupportedCiphers(t *testing.T) { skipUnlessEnabled(t) - teardown := RunPagesProcess(t, *pagesBinary, SupportedListeners(), "") + teardown := RunPagesProcess(t, *pagesBinary, supportedListeners(), "") defer teardown() client, cleanup := ClientWithConfig(tlsConfigWithInsecureCiphersOnly()) @@ -64,7 +64,7 @@ func TestRejectsUnsupportedCiphers(t *testing.T) { func TestEnableInsecureCiphers(t *testing.T) { skipUnlessEnabled(t) - teardown := RunPagesProcess(t, *pagesBinary, SupportedListeners(), "", "-insecure-ciphers") + teardown := RunPagesProcess(t, *pagesBinary, supportedListeners(), "", "-insecure-ciphers") defer teardown() client, cleanup := ClientWithConfig(tlsConfigWithInsecureCiphersOnly()) @@ -103,7 +103,7 @@ func TestTLSVersions(t *testing.T) { args = append(args, "-tls-max-version", tc.tlsMax) } - teardown := RunPagesProcess(t, *pagesBinary, SupportedListeners(), "", args...) + teardown := RunPagesProcess(t, *pagesBinary, supportedListeners(), "", args...) defer teardown() tlsConfig := &tls.Config{} diff --git a/test/acceptance/unknown_http_method_test.go b/test/acceptance/unknown_http_method_test.go index 51c366a2..3aabf800 100644 --- a/test/acceptance/unknown_http_method_test.go +++ b/test/acceptance/unknown_http_method_test.go @@ -9,7 +9,7 @@ import ( func TestUnknownHTTPMethod(t *testing.T) { skipUnlessEnabled(t) - teardown := RunPagesProcess(t, *pagesBinary, SupportedListeners(), "") + teardown := RunPagesProcess(t, *pagesBinary, supportedListeners(), "") defer teardown() req, err := http.NewRequest("UNKNOWN", httpListener.URL(""), nil) diff --git a/test/acceptance/zip_test.go b/test/acceptance/zip_test.go index fa9c87dd..212435e8 100644 --- a/test/acceptance/zip_test.go +++ b/test/acceptance/zip_test.go @@ -25,7 +25,7 @@ func TestZipServing(t *testing.T) { gitLabAPISecretKey := CreateGitLabAPISecretKeyFixtureFile(t) pagesArgs := []string{"-gitlab-server", source.URL, "-api-secret-key", gitLabAPISecretKey, "-domain-config-source", "gitlab"} - teardown := RunPagesProcessWithEnvs(t, true, *pagesBinary, SupportedListeners(), "", []string{}, pagesArgs...) + teardown := RunPagesProcessWithEnvs(t, true, *pagesBinary, supportedListeners(), "", []string{}, pagesArgs...) defer teardown() tests := map[string]struct { @@ -125,7 +125,7 @@ func TestZipServingFromDisk(t *testing.T) { gitLabAPISecretKey := CreateGitLabAPISecretKeyFixtureFile(t) pagesArgs := []string{"-gitlab-server", source.URL, "-api-secret-key", gitLabAPISecretKey, "-domain-config-source", "gitlab", "-pages-root", wd} - teardown := RunPagesProcessWithEnvs(t, true, *pagesBinary, SupportedListeners(), "", []string{}, pagesArgs...) + teardown := RunPagesProcessWithEnvs(t, true, *pagesBinary, supportedListeners(), "", []string{}, pagesArgs...) defer teardown() tests := map[string]struct { @@ -217,7 +217,7 @@ func TestZipServingConfigShortTimeout(t *testing.T) { pagesArgs := []string{"-gitlab-server", source.URL, "-api-secret-key", gitLabAPISecretKey, "-domain-config-source", "gitlab", "-zip-open-timeout=1ns"} // <- test purpose - teardown := RunPagesProcessWithEnvs(t, true, *pagesBinary, SupportedListeners(), "", []string{}, pagesArgs...) + teardown := RunPagesProcessWithEnvs(t, true, *pagesBinary, supportedListeners(), "", []string{}, pagesArgs...) defer teardown() _, cleanup := newZipFileServerURL(t, "../../shared/pages/group/zip.gitlab.io/public.zip") -- cgit v1.2.3