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
bee26600
Commit
bee26600
authored
May 20, 2013
by
Mitchell Hashimoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
communicator/ssh: Ensure valid communicator
parent
6d3e7e99
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
0 deletions
+18
-0
communicator/ssh/communicator.go
communicator/ssh/communicator.go
+9
-0
communicator/ssh/communicator_test.go
communicator/ssh/communicator_test.go
+9
-0
No files found.
communicator/ssh/communicator.go
View file @
bee26600
...
@@ -4,6 +4,7 @@ import (
...
@@ -4,6 +4,7 @@ import (
"bytes"
"bytes"
"code.google.com/p/go.crypto/ssh"
"code.google.com/p/go.crypto/ssh"
"github.com/mitchellh/packer/packer"
"github.com/mitchellh/packer/packer"
"io"
"log"
"log"
"net"
"net"
)
)
...
@@ -70,3 +71,11 @@ func (c *comm) Start(cmd string) (remote *packer.RemoteCommand, err error) {
...
@@ -70,3 +71,11 @@ func (c *comm) Start(cmd string) (remote *packer.RemoteCommand, err error) {
return
return
}
}
func
(
c
*
comm
)
Upload
(
string
,
io
.
Reader
)
error
{
return
nil
}
func
(
c
*
comm
)
Download
(
string
,
io
.
Writer
)
error
{
return
nil
}
communicator/ssh/communicator_test.go
View file @
bee26600
...
@@ -3,6 +3,7 @@ package ssh
...
@@ -3,6 +3,7 @@ package ssh
import
(
import
(
"bytes"
"bytes"
"code.google.com/p/go.crypto/ssh"
"code.google.com/p/go.crypto/ssh"
"github.com/mitchellh/packer/packer"
"fmt"
"fmt"
"net"
"net"
"strings"
"strings"
...
@@ -132,6 +133,14 @@ func newMockLineServer(t *testing.T) string {
...
@@ -132,6 +133,14 @@ func newMockLineServer(t *testing.T) string {
return
l
.
Addr
()
.
String
()
return
l
.
Addr
()
.
String
()
}
}
func
TestCommIsCommunicator
(
t
*
testing
.
T
)
{
var
raw
interface
{}
raw
=
&
comm
{}
if
_
,
ok
:=
raw
.
(
packer
.
Communicator
);
!
ok
{
t
.
Fatalf
(
"comm must be a communicator"
)
}
}
func
TestNew_Invalid
(
t
*
testing
.
T
)
{
func
TestNew_Invalid
(
t
*
testing
.
T
)
{
clientConfig
:=
&
ssh
.
ClientConfig
{
clientConfig
:=
&
ssh
.
ClientConfig
{
User
:
"user"
,
User
:
"user"
,
...
...
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