From 31d03fb48e5ce72f2358da883759a0d6ea13ae3c Mon Sep 17 00:00:00 2001 From: Ladar Levison Date: Tue, 18 Dec 2018 06:12:05 -0600 Subject: [PATCH] Added legacy network adapter driver mock up. --- builder/hyperv/common/driver_mock.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/builder/hyperv/common/driver_mock.go b/builder/hyperv/common/driver_mock.go index 71b7a0750..7a3e6bcab 100644 --- a/builder/hyperv/common/driver_mock.go +++ b/builder/hyperv/common/driver_mock.go @@ -66,6 +66,11 @@ type DriverMock struct { GetVirtualMachineNetworkAdapterAddress_Return string GetVirtualMachineNetworkAdapterAddress_Err error + ReplaceVirtualMachineNetworkAdapter_Called bool + ReplaceVirtualMachineNetworkAdapter_VmName string + ReplaceVirtualMachineNetworkAdapter_Replace bool + ReplaceVirtualMachineNetworkAdapter_Err error + SetNetworkAdapterVlanId_Called bool SetNetworkAdapterVlanId_SwitchName string SetNetworkAdapterVlanId_VlanId string @@ -335,6 +340,13 @@ func (d *DriverMock) GetVirtualMachineNetworkAdapterAddress(vmName string) (stri 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 { d.SetNetworkAdapterVlanId_Called = true d.SetNetworkAdapterVlanId_SwitchName = switchName