Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-pages.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaime Martinez <jmartinez@gitlab.com>2022-07-04 10:29:42 +0300
committerJaime Martinez <jmartinez@gitlab.com>2022-07-04 10:29:42 +0300
commitece2a232bafa09a1f037de514899003cc5b364d2 (patch)
treeffaf26af1b1e50c6bb0ecc62b74f389a04271a81 /test/acceptance/artifacts_test.go
parent62a0ed16b565fbae849ede567eda9d06d22470ea (diff)
parent29fb0c4e98a4a775d9af8e917730e065f7971376 (diff)
Merge branch 'feat/gitlabstub-tls' into 'master'
feat: add tls support to gitlab stub server See merge request gitlab-org/gitlab-pages!809
Diffstat (limited to 'test/acceptance/artifacts_test.go')
-rw-r--r--test/acceptance/artifacts_test.go31
1 files changed, 8 insertions, 23 deletions
diff --git a/test/acceptance/artifacts_test.go b/test/acceptance/artifacts_test.go
index e56a1390..6283d896 100644
--- a/test/acceptance/artifacts_test.go
+++ b/test/acceptance/artifacts_test.go
@@ -150,20 +150,6 @@ func TestArtifactProxyRequest(t *testing.T) {
}
func TestPrivateArtifactProxyRequest(t *testing.T) {
- testServer, err := gitlabstub.NewUnstartedServer()
- require.NoError(t, err)
-
- keyFile, certFile := CreateHTTPSFixtureFiles(t)
- cert, err := tls.LoadX509KeyPair(certFile, keyFile)
- require.NoError(t, err)
-
- testServer.TLS = &tls.Config{Certificates: []tls.Certificate{cert}}
- testServer.StartTLS()
-
- t.Cleanup(func() {
- testServer.Close()
- })
-
tests := []struct {
name string
host string
@@ -202,23 +188,22 @@ func TestPrivateArtifactProxyRequest(t *testing.T) {
},
}
- // Ensure the IP address is used in the URL, as we're relying on IP SANs to
- // validate
- artifactServerURL := testServer.URL + "/api/v4"
- t.Log("Artifact server URL", artifactServerURL)
+ configFile := defaultConfigFileWith(t)
- configFile := defaultConfigFileWith(t,
- "gitlab-server="+testServer.URL,
- "artifacts-server="+artifactServerURL,
- "auth-redirect-uri=https://projects.gitlab-example.com/auth",
- "artifacts-server-timeout=1")
+ keyFile, certFile := CreateHTTPSFixtureFiles(t)
+ cert, err := tls.LoadX509KeyPair(certFile, keyFile)
+ require.NoError(t, err)
RunPagesProcess(t,
withListeners([]ListenSpec{httpsListener}),
withArguments([]string{
"-config=" + configFile,
}),
+ withPublicServer,
+ withExtraArgument("auth-redirect-uri", "https://projects.gitlab-example.com/auth"),
+ withExtraArgument("artifacts-server-timeout", "1"),
withEnv([]string{"SSL_CERT_FILE=" + certFile}),
+ withStubOptions(gitlabstub.WithCertificate(cert)),
)
for _, tt := range tests {