2013-12-24 16:39:52 -05:00
|
|
|
package iso
|
|
|
|
|
|
|
|
import (
|
|
|
|
vmwcommon "github.com/mitchellh/packer/builder/vmware/common"
|
|
|
|
)
|
|
|
|
|
|
|
|
type RemoteDriverMock struct {
|
|
|
|
vmwcommon.DriverMock
|
|
|
|
|
|
|
|
UploadISOCalled bool
|
|
|
|
UploadISOPath string
|
|
|
|
UploadISOResult string
|
|
|
|
UploadISOErr error
|
|
|
|
|
|
|
|
RegisterCalled bool
|
|
|
|
RegisterPath string
|
|
|
|
RegisterErr error
|
|
|
|
|
|
|
|
UnregisterCalled bool
|
|
|
|
UnregisterPath string
|
|
|
|
UnregisterErr error
|
2014-11-16 13:31:08 -05:00
|
|
|
|
|
|
|
uploadErr error
|
|
|
|
|
|
|
|
ReloadVMErr error
|
2013-12-24 16:39:52 -05:00
|
|
|
}
|
|
|
|
|
2014-06-12 01:33:34 -04:00
|
|
|
func (d *RemoteDriverMock) UploadISO(path string, checksum string, checksumType string) (string, error) {
|
2013-12-24 16:39:52 -05:00
|
|
|
d.UploadISOCalled = true
|
|
|
|
d.UploadISOPath = path
|
|
|
|
return d.UploadISOResult, d.UploadISOErr
|
|
|
|
}
|
|
|
|
|
|
|
|
func (d *RemoteDriverMock) Register(path string) error {
|
|
|
|
d.RegisterCalled = true
|
|
|
|
d.RegisterPath = path
|
|
|
|
return d.RegisterErr
|
|
|
|
}
|
|
|
|
|
|
|
|
func (d *RemoteDriverMock) Unregister(path string) error {
|
|
|
|
d.UnregisterCalled = true
|
|
|
|
d.UnregisterPath = path
|
|
|
|
return d.UnregisterErr
|
|
|
|
}
|
2014-11-16 13:31:08 -05:00
|
|
|
|
|
|
|
func (d *RemoteDriverMock) upload(dst, src string) error {
|
|
|
|
return d.uploadErr
|
|
|
|
}
|
|
|
|
|
|
|
|
func (d *RemoteDriverMock) ReloadVM() error {
|
|
|
|
return d.ReloadVMErr
|
|
|
|
}
|