Search in sources :

Example 1 with InstallServer42Flow

use of org.openkilda.messaging.command.flow.InstallServer42Flow in project open-kilda by telstra.

the class RecordHandlerTest method shouldInstallServer42IslRttInputRule.

@Test
public void shouldInstallServer42IslRttInputRule() throws SwitchOperationException {
    int islPort = 123;
    PortColourCookie cookie = PortColourCookie.builder().portNumber(islPort).type(SERVER_42_ISL_RTT_INPUT).build();
    expect(switchManager.installServer42IslRttInputFlow(DATAPATH_ID, SERVER42_PORT, islPort)).andReturn(cookie.getValue()).once();
    replay(switchManager);
    InstallServer42Flow request = InstallServer42Flow.builder().id("test").switchId(SWITCH_ID).cookie(cookie.getValue()).inputPort(SERVER42_PORT).outputPort(0).server42MacAddress(SERVER42_MAC_ADDRESS).server42Vlan(SERVER42_VLAN).build();
    recordHandler.handleCommand(new CommandMessage(new InstallFlowForSwitchManagerRequest(request), 0, CORRELATION_ID));
    verify(switchManager);
}
Also used : InstallFlowForSwitchManagerRequest(org.openkilda.messaging.command.flow.InstallFlowForSwitchManagerRequest) PortColourCookie(org.openkilda.model.cookie.PortColourCookie) InstallServer42Flow(org.openkilda.messaging.command.flow.InstallServer42Flow) CommandMessage(org.openkilda.messaging.command.CommandMessage) Test(org.junit.Test)

Example 2 with InstallServer42Flow

use of org.openkilda.messaging.command.flow.InstallServer42Flow in project open-kilda by telstra.

the class RecordHandlerTest method installServer42SharedTest.

@Test
public void installServer42SharedTest() throws SwitchOperationException {
    FlowSharedSegmentCookie cookie = FlowSharedSegmentCookie.builder(SharedSegmentType.SERVER42_QINQ_OUTER_VLAN).portNumber(SERVER42_PORT).vlanId(VLAN_1).build();
    switchManager.installServer42OuterVlanMatchSharedFlow(DATAPATH_ID, cookie);
    expectLastCall().once();
    replay(switchManager);
    InstallServer42Flow request = InstallServer42Flow.builder().id("shared").switchId(SWITCH_ID).cookie(cookie.getValue()).inputPort(SERVER42_PORT).outputPort(0).build();
    recordHandler.handleCommand(new CommandMessage(new InstallFlowForSwitchManagerRequest(request), 0, CORRELATION_ID));
    verify(switchManager);
}
Also used : FlowSharedSegmentCookie(org.openkilda.model.cookie.FlowSharedSegmentCookie) InstallFlowForSwitchManagerRequest(org.openkilda.messaging.command.flow.InstallFlowForSwitchManagerRequest) InstallServer42Flow(org.openkilda.messaging.command.flow.InstallServer42Flow) CommandMessage(org.openkilda.messaging.command.CommandMessage) Test(org.junit.Test)

Example 3 with InstallServer42Flow

use of org.openkilda.messaging.command.flow.InstallServer42Flow in project open-kilda by telstra.

the class RecordHandlerTest method shouldInstallServer42IslRttOutputRule.

@Test
public void shouldInstallServer42IslRttOutputRule() throws SwitchOperationException {
    long cookie = SERVER_42_ISL_RTT_OUTPUT_COOKIE;
    expect(switchManager.installServer42IslRttOutputFlow(DATAPATH_ID, SERVER42_PORT, SERVER42_VLAN, SERVER42_MAC_ADDRESS)).andReturn(cookie).once();
    replay(switchManager);
    InstallServer42Flow request = InstallServer42Flow.builder().id("test").switchId(SWITCH_ID).cookie(cookie).inputPort(0).outputPort(SERVER42_PORT).server42MacAddress(SERVER42_MAC_ADDRESS).server42Vlan(SERVER42_VLAN).build();
    recordHandler.handleCommand(new CommandMessage(new InstallFlowForSwitchManagerRequest(request), 0, CORRELATION_ID));
    verify(switchManager);
}
Also used : InstallFlowForSwitchManagerRequest(org.openkilda.messaging.command.flow.InstallFlowForSwitchManagerRequest) InstallServer42Flow(org.openkilda.messaging.command.flow.InstallServer42Flow) CommandMessage(org.openkilda.messaging.command.CommandMessage) Test(org.junit.Test)

Example 4 with InstallServer42Flow

use of org.openkilda.messaging.command.flow.InstallServer42Flow in project open-kilda by telstra.

the class RecordHandlerTest method installServer42InputTest.

@Test
public void installServer42InputTest() throws SwitchOperationException {
    PortColourCookie cookie = PortColourCookie.builder().portNumber(CUSTOMER_PORT).type(SERVER_42_FLOW_RTT_INPUT).build();
    expect(switchManager.installServer42FlowRttInputFlow(DATAPATH_ID, SERVER42_PORT, CUSTOMER_PORT, SERVER42_MAC_ADDRESS)).andReturn(cookie.getValue()).once();
    replay(switchManager);
    InstallServer42Flow request = InstallServer42Flow.builder().id("input").switchId(SWITCH_ID).cookie(cookie.getValue()).inputPort(SERVER42_PORT).outputPort(0).server42MacAddress(SERVER42_MAC_ADDRESS).server42Vlan(SERVER42_VLAN).build();
    recordHandler.handleCommand(new CommandMessage(new InstallFlowForSwitchManagerRequest(request), 0, CORRELATION_ID));
    verify(switchManager);
}
Also used : InstallFlowForSwitchManagerRequest(org.openkilda.messaging.command.flow.InstallFlowForSwitchManagerRequest) PortColourCookie(org.openkilda.model.cookie.PortColourCookie) InstallServer42Flow(org.openkilda.messaging.command.flow.InstallServer42Flow) CommandMessage(org.openkilda.messaging.command.CommandMessage) Test(org.junit.Test)

Example 5 with InstallServer42Flow

use of org.openkilda.messaging.command.flow.InstallServer42Flow in project open-kilda by telstra.

the class RecordHandlerTest method installServer42OutputVlanTest.

@Test
public void installServer42OutputVlanTest() throws SwitchOperationException {
    long cookie = SERVER_42_FLOW_RTT_OUTPUT_VLAN_COOKIE;
    expect(switchManager.installServer42FlowRttOutputVlanFlow(DATAPATH_ID, SERVER42_PORT, SERVER42_VLAN, SERVER42_MAC_ADDRESS)).andReturn(cookie).once();
    replay(switchManager);
    InstallServer42Flow request = InstallServer42Flow.builder().id("output_vlan").switchId(SWITCH_ID).cookie(cookie).inputPort(0).outputPort(SERVER42_PORT).server42MacAddress(SERVER42_MAC_ADDRESS).server42Vlan(SERVER42_VLAN).build();
    recordHandler.handleCommand(new CommandMessage(new InstallFlowForSwitchManagerRequest(request), 0, CORRELATION_ID));
    verify(switchManager);
}
Also used : InstallFlowForSwitchManagerRequest(org.openkilda.messaging.command.flow.InstallFlowForSwitchManagerRequest) InstallServer42Flow(org.openkilda.messaging.command.flow.InstallServer42Flow) CommandMessage(org.openkilda.messaging.command.CommandMessage) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)6 CommandMessage (org.openkilda.messaging.command.CommandMessage)6 InstallFlowForSwitchManagerRequest (org.openkilda.messaging.command.flow.InstallFlowForSwitchManagerRequest)6 InstallServer42Flow (org.openkilda.messaging.command.flow.InstallServer42Flow)6 PortColourCookie (org.openkilda.model.cookie.PortColourCookie)2 FlowSharedSegmentCookie (org.openkilda.model.cookie.FlowSharedSegmentCookie)1