Search in sources :

Example 6 with OvsSetupBridgeCommand

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

the class NotAValidCommand method testOvsSetupBridgeCommand.

@Test
public void testOvsSetupBridgeCommand() {
    final Connection conn = Mockito.mock(Connection.class);
    final OvsSetupBridgeCommand setupBridge = new OvsSetupBridgeCommand("Test", 1l, 1l);
    final CitrixRequestWrapper wrapper = CitrixRequestWrapper.getInstance();
    assertNotNull(wrapper);
    when(citrixResourceBase.getConnection()).thenReturn(conn);
    final Answer answer = wrapper.execute(setupBridge, citrixResourceBase);
    verify(citrixResourceBase, times(1)).getConnection();
    verify(citrixResourceBase, times(1)).findOrCreateTunnelNetwork(conn, setupBridge.getBridgeName());
    verify(citrixResourceBase, times(1)).configureTunnelNetwork(conn, setupBridge.getNetworkId(), setupBridge.getHostId(), setupBridge.getBridgeName());
    assertTrue(answer.getResult());
}
Also used : RebootAnswer(com.cloud.agent.api.RebootAnswer) CreateAnswer(com.cloud.agent.api.storage.CreateAnswer) AttachAnswer(org.apache.cloudstack.storage.command.AttachAnswer) Answer(com.cloud.agent.api.Answer) Connection(com.xensource.xenapi.Connection) OvsSetupBridgeCommand(com.cloud.agent.api.OvsSetupBridgeCommand) Test(org.junit.Test)

Aggregations

Answer (com.cloud.agent.api.Answer)6 OvsSetupBridgeCommand (com.cloud.agent.api.OvsSetupBridgeCommand)6 AttachAnswer (org.apache.cloudstack.storage.command.AttachAnswer)4 Test (org.junit.Test)4 CheckRouterAnswer (com.cloud.agent.api.CheckRouterAnswer)3 LibvirtRequestWrapper (com.cloud.hypervisor.kvm.resource.wrapper.LibvirtRequestWrapper)3 OvsCreateTunnelAnswer (com.cloud.agent.api.OvsCreateTunnelAnswer)2 OvsCreateTunnelCommand (com.cloud.agent.api.OvsCreateTunnelCommand)2 OvsFetchInterfaceAnswer (com.cloud.agent.api.OvsFetchInterfaceAnswer)2 Commands (com.cloud.agent.manager.Commands)2 AgentUnavailableException (com.cloud.exception.AgentUnavailableException)2 OperationTimedoutException (com.cloud.exception.OperationTimedoutException)2 HostVO (com.cloud.host.HostVO)2 OvsTunnelNetworkVO (com.cloud.network.ovs.dao.OvsTunnelNetworkVO)2 DB (com.cloud.utils.db.DB)2 ArrayList (java.util.ArrayList)2 OvsVpcRoutingPolicyConfigCommand (com.cloud.agent.api.OvsVpcRoutingPolicyConfigCommand)1 RebootAnswer (com.cloud.agent.api.RebootAnswer)1 CreateAnswer (com.cloud.agent.api.storage.CreateAnswer)1 Network (com.cloud.network.Network)1