Search in sources :

Example 6 with OvsDestroyTunnelCommand

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

the class LibvirtComputingResourceTest method testOvsDestroyTunnelCommandFailure2.

@SuppressWarnings("unchecked")
@Test
public void testOvsDestroyTunnelCommandFailure2() {
    final String networkName = "Test";
    final Long networkId = 1l;
    final String inPortName = "eth";
    final OvsDestroyTunnelCommand command = new OvsDestroyTunnelCommand(networkId, networkName, inPortName);
    when(libvirtComputingResource.findOrCreateTunnelNetwork(command.getBridgeName())).thenThrow(Exception.class);
    final LibvirtRequestWrapper wrapper = LibvirtRequestWrapper.getInstance();
    assertNotNull(wrapper);
    final Answer answer = wrapper.execute(command, libvirtComputingResource);
    assertFalse(answer.getResult());
    verify(libvirtComputingResource, times(1)).findOrCreateTunnelNetwork(command.getBridgeName());
}
Also used : 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) OvsDestroyTunnelCommand(com.cloud.agent.api.OvsDestroyTunnelCommand) Test(org.junit.Test)

Aggregations

Answer (com.cloud.agent.api.Answer)6 OvsDestroyTunnelCommand (com.cloud.agent.api.OvsDestroyTunnelCommand)6 AttachAnswer (org.apache.cloudstack.storage.command.AttachAnswer)5 Test (org.junit.Test)5 CheckRouterAnswer (com.cloud.agent.api.CheckRouterAnswer)3 LibvirtRequestWrapper (com.cloud.hypervisor.kvm.resource.wrapper.LibvirtRequestWrapper)3 RebootAnswer (com.cloud.agent.api.RebootAnswer)2 CreateAnswer (com.cloud.agent.api.storage.CreateAnswer)2 XsLocalNetwork (com.cloud.hypervisor.xenserver.resource.XsLocalNetwork)2 Connection (com.xensource.xenapi.Connection)2 Network (com.xensource.xenapi.Network)2 BadServerResponse (com.xensource.xenapi.Types.BadServerResponse)2 XenAPIException (com.xensource.xenapi.Types.XenAPIException)2 XmlRpcException (org.apache.xmlrpc.XmlRpcException)2 Command (com.cloud.agent.api.Command)1 OvsCreateTunnelAnswer (com.cloud.agent.api.OvsCreateTunnelAnswer)1 OvsCreateTunnelCommand (com.cloud.agent.api.OvsCreateTunnelCommand)1 OvsDestroyBridgeCommand (com.cloud.agent.api.OvsDestroyBridgeCommand)1 OvsFetchInterfaceAnswer (com.cloud.agent.api.OvsFetchInterfaceAnswer)1 OvsFetchInterfaceCommand (com.cloud.agent.api.OvsFetchInterfaceCommand)1