Added legacy network adapter driver mock up.

This commit is contained in:
Ladar Levison 2018-12-18 06:12:05 -06:00
parent da8b140bca
commit 31d03fb48e
1 changed files with 12 additions and 0 deletions

View File

@ -66,6 +66,11 @@ type DriverMock struct {
GetVirtualMachineNetworkAdapterAddress_Return string GetVirtualMachineNetworkAdapterAddress_Return string
GetVirtualMachineNetworkAdapterAddress_Err error GetVirtualMachineNetworkAdapterAddress_Err error
ReplaceVirtualMachineNetworkAdapter_Called bool
ReplaceVirtualMachineNetworkAdapter_VmName string
ReplaceVirtualMachineNetworkAdapter_Replace bool
ReplaceVirtualMachineNetworkAdapter_Err error
SetNetworkAdapterVlanId_Called bool SetNetworkAdapterVlanId_Called bool
SetNetworkAdapterVlanId_SwitchName string SetNetworkAdapterVlanId_SwitchName string
SetNetworkAdapterVlanId_VlanId string SetNetworkAdapterVlanId_VlanId string
@ -335,6 +340,13 @@ func (d *DriverMock) GetVirtualMachineNetworkAdapterAddress(vmName string) (stri
return d.GetVirtualMachineNetworkAdapterAddress_Return, d.GetVirtualMachineNetworkAdapterAddress_Err return d.GetVirtualMachineNetworkAdapterAddress_Return, d.GetVirtualMachineNetworkAdapterAddress_Err
} }
func (d *DriverMock) ReplaceVirtualMachineNetworkAdapter(vmName string, replace bool) error {
d.ReplaceVirtualMachineNetworkAdapter_Called = true
d.ReplaceVirtualMachineNetworkAdapter_VmName = vmName
d.ReplaceVirtualMachineNetworkAdapter_Replace = vmName
return d.ReplaceVirtualMachineNetworkAdapter_Err
}
func (d *DriverMock) SetNetworkAdapterVlanId(switchName string, vlanId string) error { func (d *DriverMock) SetNetworkAdapterVlanId(switchName string, vlanId string) error {
d.SetNetworkAdapterVlanId_Called = true d.SetNetworkAdapterVlanId_Called = true
d.SetNetworkAdapterVlanId_SwitchName = switchName d.SetNetworkAdapterVlanId_SwitchName = switchName