Commit bee26600 authored by Mitchell Hashimoto's avatar Mitchell Hashimoto

communicator/ssh: Ensure valid communicator

parent 6d3e7e99
......@@ -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",
......
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