use of org.openkilda.messaging.command.flow.ReinstallServer42FlowForSwitchManagerRequest in project open-kilda by telstra.
the class RecordHandlerTest method reinstallServer42FlowRttInputTest.
@Test
public void reinstallServer42FlowRttInputTest() 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();
expect(switchManager.deleteRulesByCriteria(DATAPATH_ID, false, null, DeleteRulesCriteria.builder().cookie(cookie.getValue()).build())).andReturn(Lists.newArrayList(cookie.getValue())).once();
replay(switchManager);
ReinstallServer42FlowForSwitchManagerRequest request = new ReinstallServer42FlowForSwitchManagerRequest(SWITCH_ID, cookie.getValue(), SERVER42_MAC_ADDRESS, SERVER42_VLAN, SERVER42_PORT);
recordHandler.handleCommand(new CommandMessage(request, 0, null));
verify(switchManager);
}
use of org.openkilda.messaging.command.flow.ReinstallServer42FlowForSwitchManagerRequest in project open-kilda by telstra.
the class RecordHandlerTest method reinstallServer42FlowRttOutputVxlanTest.
@Test
public void reinstallServer42FlowRttOutputVxlanTest() throws SwitchOperationException {
long cookie = SERVER_42_FLOW_RTT_OUTPUT_VXLAN_COOKIE;
expect(switchManager.installServer42FlowRttOutputVxlanFlow(DATAPATH_ID, SERVER42_PORT, SERVER42_VLAN, SERVER42_MAC_ADDRESS)).andReturn(cookie).once();
expect(switchManager.deleteRulesByCriteria(DATAPATH_ID, false, null, DeleteRulesCriteria.builder().cookie(cookie).build())).andReturn(Lists.newArrayList(cookie)).once();
replay(switchManager);
ReinstallServer42FlowForSwitchManagerRequest request = new ReinstallServer42FlowForSwitchManagerRequest(SWITCH_ID, cookie, SERVER42_MAC_ADDRESS, SERVER42_VLAN, SERVER42_PORT);
recordHandler.handleCommand(new CommandMessage(request, 0, null));
verify(switchManager);
}
use of org.openkilda.messaging.command.flow.ReinstallServer42FlowForSwitchManagerRequest in project open-kilda by telstra.
the class CommandBuilderImpl method buildCommandsToReinstallRules.
@Override
public List<ReinstallDefaultFlowForSwitchManagerRequest> buildCommandsToReinstallRules(SwitchId switchId, List<Long> reinstallRulesCookies) {
SwitchProperties properties = getSwitchProperties(switchId);
List<ReinstallDefaultFlowForSwitchManagerRequest> commands = new ArrayList<>();
for (Long cookie : reinstallRulesCookies) {
if (isDefaultRuleWithSpecialRequirements(cookie)) {
commands.add(new ReinstallServer42FlowForSwitchManagerRequest(switchId, cookie, properties.getServer42MacAddress(), properties.getServer42Vlan(), properties.getServer42Port()));
} else {
commands.add(new ReinstallDefaultFlowForSwitchManagerRequest(switchId, cookie));
}
}
return commands;
}
Aggregations