2017-07-03 17:44:10 -04:00
|
|
|
package ansiblelocal
|
|
|
|
|
|
|
|
import (
|
|
|
|
"io"
|
|
|
|
"os"
|
2019-03-19 13:11:19 -04:00
|
|
|
|
|
|
|
"github.com/hashicorp/packer/packer"
|
2017-07-03 17:44:10 -04:00
|
|
|
)
|
|
|
|
|
|
|
|
type communicatorMock struct {
|
|
|
|
startCommand []string
|
|
|
|
uploadDestination []string
|
|
|
|
}
|
|
|
|
|
|
|
|
func (c *communicatorMock) Start(cmd *packer.RemoteCmd) error {
|
|
|
|
c.startCommand = append(c.startCommand, cmd.Command)
|
|
|
|
cmd.SetExited(0)
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (c *communicatorMock) Upload(dst string, _ io.Reader, _ *os.FileInfo) error {
|
|
|
|
c.uploadDestination = append(c.uploadDestination, dst)
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (c *communicatorMock) UploadDir(dst, src string, exclude []string) error {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (c *communicatorMock) Download(src string, dst io.Writer) error {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (c *communicatorMock) DownloadDir(src, dst string, exclude []string) error {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (c *communicatorMock) verify() {
|
|
|
|
}
|