From d556c13d430f291b615d538c35ebdaf9b53aa15d Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Fri, 29 Oct 2021 07:50:36 +0300 Subject: Dont use relaxed SSH Auth mode anymore for integration tests --- internal/config/env.go | 9 --------- internal/config/initializer.go | 7 +++---- 2 files changed, 3 insertions(+), 13 deletions(-) (limited to 'internal/config') diff --git a/internal/config/env.go b/internal/config/env.go index 804a10a..1ccac9c 100644 --- a/internal/config/env.go +++ b/internal/config/env.go @@ -16,12 +16,3 @@ func Hostname() (string, error) { } return os.Hostname() } - -// SSHKnownHostsFile returns the known hosts file path (useful for integration tests) -func SSHKnownHostsFile() string { - if len(os.Getenv("DTAIL_SSH_KNOWN_HOSTS_FILE")) > 0 { - return os.Getenv("DTAIL_SSH_KNOWN_HOSTS_FILE") - } else { - return os.Getenv("HOME") + "/.ssh/known_hosts" - } -} diff --git a/internal/config/initializer.go b/internal/config/initializer.go index 024464e..137b831 100644 --- a/internal/config/initializer.go +++ b/internal/config/initializer.go @@ -65,7 +65,7 @@ func (in *initializer) parseSpecificConfig(configFile string) error { func (in *initializer) transformConfig(sourceProcess source.Source, args *Args, additionalArgs []string) error { - in.readEnvironmentVars() + in.processEnvVars() switch sourceProcess { case source.Server: @@ -81,10 +81,9 @@ func (in *initializer) transformConfig(sourceProcess source.Source, args *Args, } // There are some special options which can be set by environment variable. -func (in *initializer) readEnvironmentVars() { - if Env("DTAIL_RUN_INTEGRATION_TESTS") { +func (in *initializer) processEnvVars() { + if Env("DTAIL_INTEGRATION_TEST_RUN_MODE") { os.Setenv("DTAIL_HOSTNAME_OVERRIDE", "integrationtest") - os.Setenv("DTAIL_SSH_KNOWN_HOSTS_FILE", "./known_hosts") } } -- cgit v1.2.3