use of org.openkilda.model.Switch in project open-kilda by telstra.
the class FlowOperationsServiceTest method getFlowsForEndpointNotReturnFlowsForOrphanedPaths.
@Test
public void getFlowsForEndpointNotReturnFlowsForOrphanedPaths() throws SwitchNotFoundException {
Switch switchA = createSwitch(SWITCH_ID_1);
Switch switchB = createSwitch(SWITCH_ID_2);
Switch switchC = createSwitch(SWITCH_ID_3);
Switch switchD = createSwitch(SWITCH_ID_4);
Flow flow = createFlow(FLOW_ID_1, switchA, 1, switchC, 2, FORWARD_PATH_1, REVERSE_PATH_1, switchB);
createOrphanFlowPaths(flow, switchA, 1, switchC, 2, FORWARD_PATH_3, REVERSE_PATH_3, switchD);
assertEquals(0, flowOperationsService.getFlowsForEndpoint(switchD.getSwitchId(), null).size());
}
use of org.openkilda.model.Switch in project open-kilda by telstra.
the class FlowOperationsServiceTest method getFlowsForEndpointMultiSwitchFlowNoPortTest.
@Test
public void getFlowsForEndpointMultiSwitchFlowNoPortTest() throws SwitchNotFoundException {
Switch switchA = createSwitch(SWITCH_ID_1);
Switch switchB = createSwitch(SWITCH_ID_2);
createFlow(FLOW_ID_1, switchA, 1, switchB, 2, FORWARD_PATH_1, REVERSE_PATH_1, null);
assertFlows(flowOperationsService.getFlowsForEndpoint(SWITCH_ID_1, null), FLOW_ID_1);
createFlow(FLOW_ID_2, switchB, 3, switchA, 4, FORWARD_PATH_2, REVERSE_PATH_2, null);
assertFlows(flowOperationsService.getFlowsForEndpoint(SWITCH_ID_1, null), FLOW_ID_1, FLOW_ID_2);
}
use of org.openkilda.model.Switch in project open-kilda by telstra.
the class FlowOperationsServiceTest method getFlowsForEndpointMultiSwitchFlowWithPortTest.
@Test
public void getFlowsForEndpointMultiSwitchFlowWithPortTest() throws SwitchNotFoundException {
Switch switchA = createSwitch(SWITCH_ID_1);
Switch switchB = createSwitch(SWITCH_ID_2);
createFlow(FLOW_ID_1, switchA, 1, switchB, 2, FORWARD_PATH_1, REVERSE_PATH_1, null);
assertFlows(flowOperationsService.getFlowsForEndpoint(SWITCH_ID_1, 1), FLOW_ID_1);
createFlow(FLOW_ID_2, switchB, 3, switchA, 1, FORWARD_PATH_2, REVERSE_PATH_2, null);
assertFlows(flowOperationsService.getFlowsForEndpoint(SWITCH_ID_1, 1), FLOW_ID_1, FLOW_ID_2);
}
use of org.openkilda.model.Switch in project open-kilda by telstra.
the class FlowOperationsServiceTest method getFlowsForEndpointOneSwitchFlowWithPortTest.
@Test
public void getFlowsForEndpointOneSwitchFlowWithPortTest() throws SwitchNotFoundException {
Switch switchA = createSwitch(SWITCH_ID_1);
createFlow(FLOW_ID_1, switchA, 1, switchA, 2, FORWARD_PATH_1, REVERSE_PATH_1, null);
assertFlows(flowOperationsService.getFlowsForEndpoint(SWITCH_ID_1, 1), FLOW_ID_1);
// flow on different port
createFlow(FLOW_ID_2, switchA, 3, switchA, 4, FORWARD_PATH_2, REVERSE_PATH_2, null);
assertFlows(flowOperationsService.getFlowsForEndpoint(SWITCH_ID_1, 1), FLOW_ID_1);
}
use of org.openkilda.model.Switch in project open-kilda by telstra.
the class PathsServiceTest method init.
@Before
public void init() {
/* Topology:
*
* +------3------+
* | |
* 1------4------2
* | |
* +------5------+
* | |
* ... ...
* | |
* +-----550-----+
*/
Switch switchA = Switch.builder().switchId(SWITCH_ID_1).status(SwitchStatus.ACTIVE).build();
Switch switchB = Switch.builder().switchId(SWITCH_ID_2).status(SwitchStatus.ACTIVE).build();
switchRepository.add(switchA);
switchRepository.add(switchB);
createSwitchProperties(switchA, TRANSIT_VLAN, VXLAN);
createSwitchProperties(switchB, TRANSIT_VLAN, VXLAN);
for (int i = 3; i <= SWITCH_COUNT; i++) {
Switch transitSwitch = Switch.builder().switchId(new SwitchId(i)).status(SwitchStatus.ACTIVE).build();
switchRepository.add(transitSwitch);
// last half of switches supports TRANSIT_VLAN and VXLAN
if (SWITCH_COUNT - i < VXLAN_SWITCH_COUNT) {
createSwitchProperties(transitSwitch, TRANSIT_VLAN, VXLAN);
} else {
createSwitchProperties(transitSwitch, TRANSIT_VLAN);
}
createIsl(switchA, i * 2, transitSwitch, i * 2, i, BASE_LATENCY - i, 1000 + i);
createIsl(transitSwitch, i * 2 + 1, switchB, i * 2 + 1, i, BASE_LATENCY - i, 1000 + i);
}
kildaConfigurationRepository.add(KildaConfiguration.builder().flowEncapsulationType(TRANSIT_VLAN).pathComputationStrategy(PathComputationStrategy.COST_AND_AVAILABLE_BANDWIDTH).build());
}
Aggregations