Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Packer
Commits
918c88ac
Commit
918c88ac
authored
9 years ago
by
Ilias Bertsimas
Browse files
Options
Download
Email Patches
Plain Diff
Add 4 testing scenarios for WinRM helper communicator config.
parent
883e4bca
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
helper/communicator/config_test.go
+64
-0
helper/communicator/config_test.go
with
64 additions
and
0 deletions
+64
-0
helper/communicator/config_test.go
+
64
-
0
View file @
918c88ac
...
...
@@ -37,6 +37,70 @@ func TestConfig_badtype(t *testing.T) {
}
}
func
TestConfig_winrm_noport
(
t
*
testing
.
T
)
{
c
:=
&
Config
{
Type
:
"winrm"
,
WinRMUser
:
"admin"
,
}
if
err
:=
c
.
Prepare
(
testContext
(
t
));
len
(
err
)
>
0
{
t
.
Fatalf
(
"bad: %#v"
,
err
)
}
if
c
.
WinRMPort
!=
5985
{
t
.
Fatalf
(
"WinRMPort doesn't match default port 5985 when SSL is not enabled and no port is specified."
)
}
}
func
TestConfig_winrm_noport_ssl
(
t
*
testing
.
T
)
{
c
:=
&
Config
{
Type
:
"winrm"
,
WinRMUser
:
"admin"
,
WinRMUseSSL
:
true
,
}
if
err
:=
c
.
Prepare
(
testContext
(
t
));
len
(
err
)
>
0
{
t
.
Fatalf
(
"bad: %#v"
,
err
)
}
if
c
.
WinRMPort
!=
5986
{
t
.
Fatalf
(
"WinRMPort doesn't match default port 5986 when SSL is enabled and no port is specified."
)
}
}
func
TestConfig_winrm_port
(
t
*
testing
.
T
)
{
c
:=
&
Config
{
Type
:
"winrm"
,
WinRMUser
:
"admin"
,
WinRMPort
:
5509
,
}
if
err
:=
c
.
Prepare
(
testContext
(
t
));
len
(
err
)
>
0
{
t
.
Fatalf
(
"bad: %#v"
,
err
)
}
if
c
.
WinRMPort
!=
5509
{
t
.
Fatalf
(
"WinRMPort doesn't match custom port 5509 when SSL is not enabled."
)
}
}
func
TestConfig_winrm_port_ssl
(
t
*
testing
.
T
)
{
c
:=
&
Config
{
Type
:
"winrm"
,
WinRMUser
:
"admin"
,
WinRMPort
:
5510
,
WinRMUseSSL
:
true
,
}
if
err
:=
c
.
Prepare
(
testContext
(
t
));
len
(
err
)
>
0
{
t
.
Fatalf
(
"bad: %#v"
,
err
)
}
if
c
.
WinRMPort
!=
5510
{
t
.
Fatalf
(
"WinRMPort doesn't match custom port 5510 when SSL is enabled."
)
}
}
func
TestConfig_winrm
(
t
*
testing
.
T
)
{
c
:=
&
Config
{
Type
:
"winrm"
,
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help