This check implements testing via go test, which can be easily run like:
go test -v ./...
Some testing requires a real WinRM host to test against, this can be enabled by using environment variables.
On a Unix/Linux shell:
export WINRM_HOST=win10
export WINRM_USER=administrator
export WINRM_PASSWORD=secret
On PowerShell:
$Env:WINRM_HOST = "win10"
$Env:WINRM_USER = "administrator"
$Env:WINRM_PASSWORD = "secret"
With the vars set, just run the normal test command, and no tests should be skipped.
go test -v ./...
Other vars have some additional behavior, that can be overridden, set or enabled:
WINRM_BASIC_USER
Use a different user for Basic AuthWINRM_BASIC_PASSWORD
Use a different password for Basic AuthWINRM_NTLM_USER
Use a different user for NTLMWINRM_NTLM_PASSWORD
Use a different password for NTLMWINRM_SKIP_TLS
If set, don't run checks via a TLS/HTTPS connectionWINRM_SKIP_BASIC
If set, don't test basic authWINRM_SKIP_UNENCRYPTED
If set, don't test HTTP connectionsWINRM_INSECURE
If set, disable certificate validationWINRM_TLS_CA
Path for a CA certificate to useWINRM_TLS_CERT
Path for a client certificate to useWINRM_TLS_KEY
Path for a client certificate key to use