use of com.cloud.legacymodel.communication.command.CheckNetworkCommand in project cosmic by MissionCriticalCloud.
the class LibvirtComputingResourceTest method testCheckNetworkCommandFail3.
@Test
public void testCheckNetworkCommandFail3() {
final List<PhysicalNetworkSetupInfo> networkInfoList = new ArrayList<>();
final PhysicalNetworkSetupInfo networkSetupInfo = Mockito.mock(PhysicalNetworkSetupInfo.class);
networkInfoList.add(networkSetupInfo);
final CheckNetworkCommand command = new CheckNetworkCommand(networkInfoList);
when(this.libvirtComputingResource.checkNetwork(networkSetupInfo.getGuestNetworkName())).thenReturn(true);
when(this.libvirtComputingResource.checkNetwork(networkSetupInfo.getPrivateNetworkName())).thenReturn(true);
when(this.libvirtComputingResource.checkNetwork(networkSetupInfo.getPublicNetworkName())).thenReturn(false);
final LibvirtRequestWrapper wrapper = LibvirtRequestWrapper.getInstance();
assertNotNull(wrapper);
final Answer answer = wrapper.execute(command, this.libvirtComputingResource);
assertFalse(answer.getResult());
verify(this.libvirtComputingResource, times(1)).checkNetwork(networkSetupInfo.getGuestNetworkName());
verify(this.libvirtComputingResource, times(1)).checkNetwork(networkSetupInfo.getPrivateNetworkName());
}
use of com.cloud.legacymodel.communication.command.CheckNetworkCommand in project cosmic by MissionCriticalCloud.
the class XenServer610WrapperTest method testCheckNetworkCommandFailure.
@Test
public void testCheckNetworkCommandFailure() {
final XenServer610Resource xenServer610Resource = new XenServer610Resource();
final PhysicalNetworkSetupInfo info = new PhysicalNetworkSetupInfo();
final List<PhysicalNetworkSetupInfo> setupInfos = new ArrayList<>();
setupInfos.add(info);
final CheckNetworkCommand checkNet = new CheckNetworkCommand(setupInfos);
final Answer answer = xenServer610Resource.executeRequest(checkNet);
assertTrue(answer.getResult());
}
use of com.cloud.legacymodel.communication.command.CheckNetworkCommand in project cosmic by MissionCriticalCloud.
the class XenServer620WrapperTest method testCheckNetworkCommandFailure.
@Test
public void testCheckNetworkCommandFailure() {
final XenServer620Resource xenServer620Resource = new XenServer620Resource();
final PhysicalNetworkSetupInfo info = new PhysicalNetworkSetupInfo();
final List<PhysicalNetworkSetupInfo> setupInfos = new ArrayList<>();
setupInfos.add(info);
final CheckNetworkCommand checkNet = new CheckNetworkCommand(setupInfos);
final Answer answer = xenServer620Resource.executeRequest(checkNet);
assertTrue(answer.getResult());
}
use of com.cloud.legacymodel.communication.command.CheckNetworkCommand in project cosmic by MissionCriticalCloud.
the class NotAValidCommand method testCheckNetworkCommandFailure.
@Test
public void testCheckNetworkCommandFailure() {
final PhysicalNetworkSetupInfo info = new PhysicalNetworkSetupInfo();
final List<PhysicalNetworkSetupInfo> setupInfos = new ArrayList<>();
setupInfos.add(info);
final CheckNetworkCommand checkNet = new CheckNetworkCommand(setupInfos);
final CitrixRequestWrapper wrapper = CitrixRequestWrapper.getInstance();
assertNotNull(wrapper);
final Answer answer = wrapper.execute(checkNet, this.citrixResourceBase);
assertFalse(answer.getResult());
}
Aggregations