summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Okstad <pokstad@gitlab.com>2020-11-16 10:00:34 -0800
committerPaul Okstad <pokstad@gitlab.com>2020-11-16 10:02:45 -0800
commit95d4dd92c296cef89cdec1de162754264f8c5b6a (patch)
treeb7c80677f125ab04094459d99b908516cd52fd0c
parenteaf5972a054ea4e73c261e28125f9184640127a2 (diff)
downloadgitlab-shell-pokstad1-tls-client-config.tar.gz
Document and automate new test fixture generationpokstad1-tls-client-config
-rw-r--r--client/httpsclient_test.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/client/httpsclient_test.go b/client/httpsclient_test.go
index c55a71b..dadd095 100644
--- a/client/httpsclient_test.go
+++ b/client/httpsclient_test.go
@@ -13,6 +13,7 @@ import (
"gitlab.com/gitlab-org/gitlab-shell/internal/testhelper"
)
+//go:generate openssl req -newkey rsa:4096 -new -nodes -x509 -days 3650 -out ../internal/testhelper/testdata/testroot/certs/client/server.crt -keyout ../internal/testhelper/testdata/testroot/certs/client/key.pem -subj "/C=US/ST=California/L=San Francisco/O=GitLab/OU=GitLab-Shell/CN=localhost"
func TestSuccessfulRequests(t *testing.T) {
testCases := []struct {
desc string
@@ -38,8 +39,10 @@ func TestSuccessfulRequests(t *testing.T) {
selfSigned: true,
},
{
- desc: "Client certs with CA",
- caFile: path.Join(testhelper.TestRoot, "certs/valid/server.crt"),
+ desc: "Client certs with CA",
+ caFile: path.Join(testhelper.TestRoot, "certs/valid/server.crt"),
+ // Run the command "go generate httpsclient_test.go" to
+ // regenerate the following test fixtures:
clientCAPath: path.Join(testhelper.TestRoot, "certs/client/server.crt"),
clientCertPath: path.Join(testhelper.TestRoot, "certs/client/server.crt"),
clientKeyPath: path.Join(testhelper.TestRoot, "certs/client/key.pem"),