Commit bee26600 authored by Mitchell Hashimoto's avatar Mitchell Hashimoto

communicator/ssh: Ensure valid communicator

parent 6d3e7e99
...@@ -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
}
...@@ -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",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment