use of org.openkilda.rulemanager.action.PopVxlanAction in project open-kilda by telstra.
the class UnicastVerificationVxlanRuleGeneratorTest method shouldBuildCorrectRuleWithMeterForOf15.
@Test
public void shouldBuildCorrectRuleWithMeterForOf15() {
sw = buildSwitch("OF_15", Sets.newHashSet(NOVIFLOW_PUSH_POP_VXLAN, METERS, PKTPS_FLAG));
List<SpeakerData> commands = generator.generateCommands(sw);
assertEquals(2, commands.size());
commands.forEach(c -> assertEquals(sw.getSwitchId(), c.getSwitchId()));
commands.forEach(c -> assertEquals(sw.getOfVersion(), c.getOfVersion().toString()));
FlowSpeakerData flowCommandData = getCommand(FlowSpeakerData.class, commands);
MeterSpeakerData meterCommandData = getCommand(MeterSpeakerData.class, commands);
assertEquals(1, flowCommandData.getDependsOn().size());
assertTrue(flowCommandData.getDependsOn().contains(meterCommandData.getUuid()));
// Check flow command
checkFlowCommandBaseProperties(flowCommandData);
checkMatch(flowCommandData.getMatch());
// Check flow command has correct instructions for OF 1.5
Instructions instructions = flowCommandData.getInstructions();
assertEquals(4, instructions.getApplyActions().size());
Action first = instructions.getApplyActions().get(0);
assertTrue(first instanceof PopVxlanAction);
PopVxlanAction popVxlanAction = (PopVxlanAction) first;
assertEquals(ActionType.POP_VXLAN_NOVIFLOW, popVxlanAction.getType());
Action second = instructions.getApplyActions().get(1);
assertTrue(second instanceof PortOutAction);
PortOutAction sendToControllerAction = (PortOutAction) second;
assertEquals(SpecialPortType.CONTROLLER, sendToControllerAction.getPortNumber().getPortType());
Action third = instructions.getApplyActions().get(3);
assertTrue(third instanceof MeterAction);
MeterAction meterAction = (MeterAction) third;
assertEquals(meterCommandData.getMeterId(), meterAction.getMeterId());
assertNull(instructions.getWriteActions());
assertNull(instructions.getGoToMeter());
assertNull(instructions.getGoToTable());
// Check meter command
checkMeterCommand(meterCommandData);
}
use of org.openkilda.rulemanager.action.PopVxlanAction in project open-kilda by telstra.
the class ArpPostIngressVxlanRuleGeneratorTest method checkInstructions.
@Override
protected void checkInstructions(Instructions instructions, MeterId meterId) {
assertEquals(2, instructions.getApplyActions().size());
Action first = instructions.getApplyActions().get(0);
assertTrue(first instanceof PopVxlanAction);
PopVxlanAction popVxlanAction = (PopVxlanAction) first;
assertEquals(ActionType.POP_VXLAN_NOVIFLOW, popVxlanAction.getType());
Action second = instructions.getApplyActions().get(1);
assertTrue(second instanceof PortOutAction);
PortOutAction portOutAction = (PortOutAction) second;
assertEquals(SpecialPortType.CONTROLLER, portOutAction.getPortNumber().getPortType());
assertNull(instructions.getWriteActions());
assertEquals(instructions.getGoToMeter(), meterId);
assertNull(instructions.getGoToTable());
}
use of org.openkilda.rulemanager.action.PopVxlanAction in project open-kilda by telstra.
the class LldpPostIngressVxlanRuleGeneratorTest method checkInstructions.
@Override
protected void checkInstructions(Instructions instructions, MeterId meterId) {
assertEquals(2, instructions.getApplyActions().size());
Action first = instructions.getApplyActions().get(0);
assertTrue(first instanceof PopVxlanAction);
PopVxlanAction popVxlanAction = (PopVxlanAction) first;
assertEquals(ActionType.POP_VXLAN_NOVIFLOW, popVxlanAction.getType());
Action second = instructions.getApplyActions().get(1);
assertTrue(second instanceof PortOutAction);
PortOutAction portOutAction = (PortOutAction) second;
assertEquals(SpecialPortType.CONTROLLER, portOutAction.getPortNumber().getPortType());
assertNull(instructions.getWriteActions());
assertEquals(instructions.getGoToMeter(), meterId);
assertNull(instructions.getGoToTable());
}
use of org.openkilda.rulemanager.action.PopVxlanAction in project open-kilda by telstra.
the class LldpPostIngressVxlanRuleGeneratorTest method checkInstructionsOf15.
@Override
protected void checkInstructionsOf15(Instructions instructions, MeterId meterId) {
assertEquals(3, instructions.getApplyActions().size());
Action first = instructions.getApplyActions().get(0);
assertTrue(first instanceof PopVxlanAction);
PopVxlanAction popVxlanAction = (PopVxlanAction) first;
assertEquals(ActionType.POP_VXLAN_NOVIFLOW, popVxlanAction.getType());
Action second = instructions.getApplyActions().get(1);
assertTrue(second instanceof PortOutAction);
PortOutAction portOutAction = (PortOutAction) second;
assertEquals(SpecialPortType.CONTROLLER, portOutAction.getPortNumber().getPortType());
Action third = instructions.getApplyActions().get(2);
assertTrue(third instanceof MeterAction);
MeterAction meterAction = (MeterAction) third;
assertEquals(meterId, meterAction.getMeterId());
assertNull(instructions.getWriteActions());
assertNull(instructions.getGoToMeter());
assertNull(instructions.getGoToTable());
}
use of org.openkilda.rulemanager.action.PopVxlanAction in project open-kilda by telstra.
the class Server42FlowRttOutputVxlanRuleGeneratorTest method server42FlowRttOutputVxlanRuleGeneratorOvsTest.
@Test
public void server42FlowRttOutputVxlanRuleGeneratorOvsTest() {
Switch sw = buildSwitch("OF_13", Sets.newHashSet(KILDA_OVS_PUSH_POP_MATCH_VXLAN));
testOutputRule(sw, new PopVxlanAction(ActionType.POP_VXLAN_OVS), false);
}
Aggregations