Search in sources :

Example 1 with Acl

use of com.cloud.agent.api.OvsVpcRoutingPolicyConfigCommand.Acl in project cloudstack by apache.

the class LibvirtComputingResourceTest method testOvsVpcRoutingPolicyConfigCommandFailure.

@SuppressWarnings("unchecked")
@Test(expected = Exception.class)
public void testOvsVpcRoutingPolicyConfigCommandFailure() {
    final String id = null;
    final String cidr = null;
    final Acl[] acls = null;
    final com.cloud.agent.api.OvsVpcRoutingPolicyConfigCommand.Tier[] tiers = null;
    final OvsVpcRoutingPolicyConfigCommand command = new OvsVpcRoutingPolicyConfigCommand(id, cidr, acls, tiers);
    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 : 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) Acl(com.cloud.agent.api.OvsVpcRoutingPolicyConfigCommand.Acl) OvsVpcRoutingPolicyConfigCommand(com.cloud.agent.api.OvsVpcRoutingPolicyConfigCommand) Test(org.junit.Test) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest)

Example 2 with Acl

use of com.cloud.agent.api.OvsVpcRoutingPolicyConfigCommand.Acl in project cloudstack by apache.

the class LibvirtComputingResourceTest method testOvsVpcRoutingPolicyConfigCommand.

@Test
public void testOvsVpcRoutingPolicyConfigCommand() {
    final String id = null;
    final String cidr = null;
    final Acl[] acls = null;
    final com.cloud.agent.api.OvsVpcRoutingPolicyConfigCommand.Tier[] tiers = null;
    final OvsVpcRoutingPolicyConfigCommand command = new OvsVpcRoutingPolicyConfigCommand(id, cidr, acls, tiers);
    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 : 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) Acl(com.cloud.agent.api.OvsVpcRoutingPolicyConfigCommand.Acl) OvsVpcRoutingPolicyConfigCommand(com.cloud.agent.api.OvsVpcRoutingPolicyConfigCommand) 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 Tier (com.cloud.agent.api.OvsVpcPhysicalTopologyConfigCommand.Tier)2 OvsVpcRoutingPolicyConfigCommand (com.cloud.agent.api.OvsVpcRoutingPolicyConfigCommand)2 Acl (com.cloud.agent.api.OvsVpcRoutingPolicyConfigCommand.Acl)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