Skip to content

Commit

Permalink
test: Add more env variables to control testing
Browse files Browse the repository at this point in the history
  • Loading branch information
lazyfrosch committed Sep 2, 2020
1 parent d0783e3 commit b49f644
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
2 changes: 2 additions & 0 deletions TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ Other vars have some additional behavior, that can be overridden, set or enabled
* `WINRM_NTLM_USER` Use a different user for NTLM
* `WINRM_NTLM_PASSWORD` Use a different password for NTLM
* `WINRM_SKIP_TLS` If set, don't run checks via a TLS/HTTPS connection
* `WINRM_SKIP_BASIC` If set, don't test basic auth
* `WINRM_SKIP_UNENCRYPTED` If set, don't test HTTP connections
* `WINRM_INSECURE` If set, disable certificate validation
* `WINRM_TLS_CA` Path for a CA certificate to use
* `WINRM_TLS_CERT` Path for a client certificate to use
Expand Down
16 changes: 16 additions & 0 deletions check_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,19 +62,35 @@ func TestConfig_Run_WithError(t *testing.T) {
}

func TestConfig_Run_Basic(t *testing.T) {
if os.Getenv("WINRM_SKIP_BASIC") != "" {
t.Skip("WINRM_SKIP_BASIC has been set")
}

if os.Getenv("WINRM_SKIP_UNENCRYPTED") != "" {
t.Skip("WINRM_SKIP_UNENCRYPTED has been set")
}

c := buildEnvConfig(t, AuthBasic)

runCheck(t, c)
}

func TestConfig_Run_Basic_WithTLS(t *testing.T) {
if os.Getenv("WINRM_SKIP_BASIC") != "" {
t.Skip("WINRM_SKIP_BASIC has been set")
}

c := buildEnvConfig(t, AuthBasic)
setupTlsFromEnv(t, c)

runCheck(t, c)
}

func TestConfig_Run_NTLM(t *testing.T) {
if os.Getenv("WINRM_SKIP_UNENCRYPTED") != "" {
t.Skip("WINRM_SKIP_UNENCRYPTED has been set")
}

c := buildEnvConfig(t, AuthNTLM)

runCheck(t, c)
Expand Down

0 comments on commit b49f644

Please sign in to comment.