communicator/ssh: Ensure valid communicator
This commit is contained in:
parent
6d3e7e9964
commit
bee266008e
|
@ -4,6 +4,7 @@ import (
|
|||
"bytes"
|
||||
"code.google.com/p/go.crypto/ssh"
|
||||
"github.com/mitchellh/packer/packer"
|
||||
"io"
|
||||
"log"
|
||||
"net"
|
||||
)
|
||||
|
@ -70,3 +71,11 @@ func (c *comm) Start(cmd string) (remote *packer.RemoteCommand, err error) {
|
|||
|
||||
return
|
||||
}
|
||||
|
||||
func (c *comm) Upload(string, io.Reader) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (c *comm) Download(string, io.Writer) error {
|
||||
return nil
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ package ssh
|
|||
import (
|
||||
"bytes"
|
||||
"code.google.com/p/go.crypto/ssh"
|
||||
"github.com/mitchellh/packer/packer"
|
||||
"fmt"
|
||||
"net"
|
||||
"strings"
|
||||
|
@ -132,6 +133,14 @@ func newMockLineServer(t *testing.T) 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) {
|
||||
clientConfig := &ssh.ClientConfig{
|
||||
User: "user",
|
||||
|
|
Loading…
Reference in New Issue