Skip to content

Commit b49f644

Browse files
committed
test: Add more env variables to control testing
1 parent d0783e3 commit b49f644

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

TESTING.md

+2
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ Other vars have some additional behavior, that can be overridden, set or enabled
4040
* `WINRM_NTLM_USER` Use a different user for NTLM
4141
* `WINRM_NTLM_PASSWORD` Use a different password for NTLM
4242
* `WINRM_SKIP_TLS` If set, don't run checks via a TLS/HTTPS connection
43+
* `WINRM_SKIP_BASIC` If set, don't test basic auth
44+
* `WINRM_SKIP_UNENCRYPTED` If set, don't test HTTP connections
4345
* `WINRM_INSECURE` If set, disable certificate validation
4446
* `WINRM_TLS_CA` Path for a CA certificate to use
4547
* `WINRM_TLS_CERT` Path for a client certificate to use

check_test.go

+16
Original file line numberDiff line numberDiff line change
@@ -62,19 +62,35 @@ func TestConfig_Run_WithError(t *testing.T) {
6262
}
6363

6464
func TestConfig_Run_Basic(t *testing.T) {
65+
if os.Getenv("WINRM_SKIP_BASIC") != "" {
66+
t.Skip("WINRM_SKIP_BASIC has been set")
67+
}
68+
69+
if os.Getenv("WINRM_SKIP_UNENCRYPTED") != "" {
70+
t.Skip("WINRM_SKIP_UNENCRYPTED has been set")
71+
}
72+
6573
c := buildEnvConfig(t, AuthBasic)
6674

6775
runCheck(t, c)
6876
}
6977

7078
func TestConfig_Run_Basic_WithTLS(t *testing.T) {
79+
if os.Getenv("WINRM_SKIP_BASIC") != "" {
80+
t.Skip("WINRM_SKIP_BASIC has been set")
81+
}
82+
7183
c := buildEnvConfig(t, AuthBasic)
7284
setupTlsFromEnv(t, c)
7385

7486
runCheck(t, c)
7587
}
7688

7789
func TestConfig_Run_NTLM(t *testing.T) {
90+
if os.Getenv("WINRM_SKIP_UNENCRYPTED") != "" {
91+
t.Skip("WINRM_SKIP_UNENCRYPTED has been set")
92+
}
93+
7894
c := buildEnvConfig(t, AuthNTLM)
7995

8096
runCheck(t, c)

0 commit comments

Comments
 (0)