Search in sources :

Example 1 with Host

use of com.cloud.agent.api.OvsVpcPhysicalTopologyConfigCommand.Host in project cloudstack by apache.

the class LibvirtComputingResourceTest method testOvsVpcPhysicalTopologyConfigCommandFailure.

@SuppressWarnings("unchecked")
@Test(expected = Exception.class)
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();
}
Also used : OvsVpcPhysicalTopologyConfigCommand(com.cloud.agent.api.OvsVpcPhysicalTopologyConfigCommand) UnsupportedAnswer(com.cloud.agent.api.UnsupportedAnswer) AttachAnswer(org.apache.cloudstack.storage.command.AttachAnswer) Answer(com.cloud.agent.api.Answer) CheckRouterAnswer(com.cloud.agent.api.CheckRouterAnswer) LibvirtRequestWrapper(com.cloud.hypervisor.kvm.resource.wrapper.LibvirtRequestWrapper) Tier(com.cloud.agent.api.OvsVpcPhysicalTopologyConfigCommand.Tier) Vm(com.cloud.agent.api.OvsVpcPhysicalTopologyConfigCommand.Vm) Host(com.cloud.agent.api.OvsVpcPhysicalTopologyConfigCommand.Host) Test(org.junit.Test) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest)

Example 2 with Host

use of com.cloud.agent.api.OvsVpcPhysicalTopologyConfigCommand.Host 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();
}
Also used : OvsVpcPhysicalTopologyConfigCommand(com.cloud.agent.api.OvsVpcPhysicalTopologyConfigCommand) UnsupportedAnswer(com.cloud.agent.api.UnsupportedAnswer) AttachAnswer(org.apache.cloudstack.storage.command.AttachAnswer) Answer(com.cloud.agent.api.Answer) CheckRouterAnswer(com.cloud.agent.api.CheckRouterAnswer) LibvirtRequestWrapper(com.cloud.hypervisor.kvm.resource.wrapper.LibvirtRequestWrapper) Tier(com.cloud.agent.api.OvsVpcPhysicalTopologyConfigCommand.Tier) Vm(com.cloud.agent.api.OvsVpcPhysicalTopologyConfigCommand.Vm) Host(com.cloud.agent.api.OvsVpcPhysicalTopologyConfigCommand.Host) Test(org.junit.Test) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest)

Aggregations

Answer (com.cloud.agent.api.Answer)2 CheckRouterAnswer (com.cloud.agent.api.CheckRouterAnswer)2 OvsVpcPhysicalTopologyConfigCommand (com.cloud.agent.api.OvsVpcPhysicalTopologyConfigCommand)2 Host (com.cloud.agent.api.OvsVpcPhysicalTopologyConfigCommand.Host)2 Tier (com.cloud.agent.api.OvsVpcPhysicalTopologyConfigCommand.Tier)2 Vm (com.cloud.agent.api.OvsVpcPhysicalTopologyConfigCommand.Vm)2 UnsupportedAnswer (com.cloud.agent.api.UnsupportedAnswer)2 LibvirtRequestWrapper (com.cloud.hypervisor.kvm.resource.wrapper.LibvirtRequestWrapper)2 AttachAnswer (org.apache.cloudstack.storage.command.AttachAnswer)2 Test (org.junit.Test)2 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)2