summaryrefslogtreecommitdiff
path: root/internal/config/config_test.go
diff options
context:
space:
mode:
authorNick Thomas <nick@gitlab.com>2021-04-30 14:15:30 +0100
committerNick Thomas <nick@gitlab.com>2021-04-30 14:32:06 +0100
commit4545fc56e23b476ca2b54cc23ec72a0aa0d7dae1 (patch)
tree8175967320e2fa8e022e5629d6f39b2ddcfe16bb /internal/config/config_test.go
parent584643e0e10e0cbeee4f8366b5e50656dfee9ea4 (diff)
downloadgitlab-shell-4545fc56e23b476ca2b54cc23ec72a0aa0d7dae1.tar.gz
gitlab-sshd: Respect the ssl_cert_dir config516-handle-ssl-cert-dir-correctly
Changelog: fixed
Diffstat (limited to 'internal/config/config_test.go')
-rw-r--r--internal/config/config_test.go24
1 files changed, 24 insertions, 0 deletions
diff --git a/internal/config/config_test.go b/internal/config/config_test.go
new file mode 100644
index 0000000..1a79320
--- /dev/null
+++ b/internal/config/config_test.go
@@ -0,0 +1,24 @@
+package config
+
+import (
+ "os"
+ "testing"
+
+ "github.com/stretchr/testify/require"
+
+ "gitlab.com/gitlab-org/gitlab-shell/internal/testhelper"
+)
+
+func TestConfigApplyGlobalState(t *testing.T) {
+ t.Cleanup(testhelper.TempEnv(map[string]string{"SSL_CERT_DIR": "unmodified"}))
+
+ config := &Config{SslCertDir: ""}
+ config.ApplyGlobalState()
+
+ require.Equal(t, "unmodified", os.Getenv("SSL_CERT_DIR"))
+
+ config.SslCertDir = "foo"
+ config.ApplyGlobalState()
+
+ require.Equal(t, "foo", os.Getenv("SSL_CERT_DIR"))
+}