Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
packer
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kristopher Ruzic
packer
Commits
6d3e7e99
Commit
6d3e7e99
authored
May 20, 2013
by
Mitchell Hashimoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
communicator/ssh: Simplify tests
parent
08ac912c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
26 deletions
+1
-26
communicator/ssh/communicator_test.go
communicator/ssh/communicator_test.go
+1
-26
No files found.
communicator/ssh/communicator_test.go
View file @
6d3e7e99
...
...
@@ -58,31 +58,6 @@ func init() {
}
}
func
newMockAuthServer
(
t
*
testing
.
T
)
string
{
l
,
err
:=
ssh
.
Listen
(
"tcp"
,
"127.0.0.1:0"
,
serverConfig
)
if
err
!=
nil
{
t
.
Fatalf
(
"unable to newMockAuthServer: %s"
,
err
)
}
go
func
()
{
defer
l
.
Close
()
c
,
err
:=
l
.
Accept
()
if
err
!=
nil
{
t
.
Errorf
(
"Unable to accept incoming connection: %v"
,
err
)
return
}
if
err
:=
c
.
Handshake
();
err
!=
nil
{
// not Errorf because this is expected to
// fail for some tests.
t
.
Logf
(
"Handshaking error: %v"
,
err
)
return
}
defer
c
.
Close
()
}()
return
l
.
Addr
()
.
String
()
}
func
newMockLineServer
(
t
*
testing
.
T
)
string
{
l
,
err
:=
ssh
.
Listen
(
"tcp"
,
"127.0.0.1:0"
,
serverConfig
)
if
err
!=
nil
{
...
...
@@ -165,7 +140,7 @@ func TestNew_Invalid(t *testing.T) {
},
}
conn
,
err
:=
net
.
Dial
(
"tcp"
,
newMock
Auth
Server
(
t
))
conn
,
err
:=
net
.
Dial
(
"tcp"
,
newMock
Line
Server
(
t
))
if
err
!=
nil
{
t
.
Fatalf
(
"unable to dial to remote side: %s"
,
err
)
}
...
...
Write
Preview
Markdown
is supported
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