github.com/angdraug/packer@v1.3.2/provisioner/ansible-local/communicator_mock.go (about) 1 package ansiblelocal 2 3 import ( 4 "github.com/hashicorp/packer/packer" 5 "io" 6 "os" 7 ) 8 9 type communicatorMock struct { 10 startCommand []string 11 uploadDestination []string 12 } 13 14 func (c *communicatorMock) Start(cmd *packer.RemoteCmd) error { 15 c.startCommand = append(c.startCommand, cmd.Command) 16 cmd.SetExited(0) 17 return nil 18 } 19 20 func (c *communicatorMock) Upload(dst string, _ io.Reader, _ *os.FileInfo) error { 21 c.uploadDestination = append(c.uploadDestination, dst) 22 return nil 23 } 24 25 func (c *communicatorMock) UploadDir(dst, src string, exclude []string) error { 26 return nil 27 } 28 29 func (c *communicatorMock) Download(src string, dst io.Writer) error { 30 return nil 31 } 32 33 func (c *communicatorMock) DownloadDir(src, dst string, exclude []string) error { 34 return nil 35 } 36 37 func (c *communicatorMock) verify() { 38 }