use of com.cloud.agent.api.OvsVpcPhysicalTopologyConfigCommand.Tier in project cloudstack by apache.
the class LibvirtComputingResourceTest method testOvsVpcPhysicalTopologyConfigCommandFailure.
@SuppressWarnings("unchecked")
@Test
public void testOvsVpcPhysicalTopologyConfigCommandFailure() {
final Host[] hosts = null;
final Tier[] tiers = null;
final Vm[] vms = null;
final String cidr = null;
final OvsVpcPhysicalTopologyConfigCommand command = new OvsVpcPhysicalTopologyConfigCommand(hosts, tiers, vms, cidr);
when(libvirtComputingResource.getOvsTunnelPath()).thenThrow(Exception.class);
final LibvirtRequestWrapper wrapper = LibvirtRequestWrapper.getInstance();
assertNotNull(wrapper);
final Answer answer = wrapper.execute(command, libvirtComputingResource);
assertFalse(answer.getResult());
verify(libvirtComputingResource, times(1)).getOvsTunnelPath();
}
use of com.cloud.agent.api.OvsVpcPhysicalTopologyConfigCommand.Tier in project cloudstack by apache.
the class LibvirtComputingResourceTest method testOvsVpcPhysicalTopologyConfigCommand.
@Test
public void testOvsVpcPhysicalTopologyConfigCommand() {
final Host[] hosts = null;
final Tier[] tiers = null;
final Vm[] vms = null;
final String cidr = null;
final OvsVpcPhysicalTopologyConfigCommand command = new OvsVpcPhysicalTopologyConfigCommand(hosts, tiers, vms, cidr);
when(libvirtComputingResource.getOvsTunnelPath()).thenReturn("/path");
when(libvirtComputingResource.getTimeout()).thenReturn(Duration.ZERO);
final LibvirtRequestWrapper wrapper = LibvirtRequestWrapper.getInstance();
assertNotNull(wrapper);
final Answer answer = wrapper.execute(command, libvirtComputingResource);
assertFalse(answer.getResult());
verify(libvirtComputingResource, times(1)).getOvsTunnelPath();
verify(libvirtComputingResource, times(1)).getTimeout();
}
Aggregations