forked from hashicorp/packer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
remote_driver_mock.go
52 lines (40 loc) · 1.01 KB
/
remote_driver_mock.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
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
uploadErr error
ReloadVMErr error
}
func (d *RemoteDriverMock) UploadISO(path string, checksum string, checksumType string) (string, error) {
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
}
func (d *RemoteDriverMock) upload(dst, src string) error {
return d.uploadErr
}
func (d *RemoteDriverMock) ReloadVM() error {
return d.ReloadVMErr
}