16 package org.openkilda.wfm.topology.flow.validation;
23 import org.junit.BeforeClass;
24 import org.junit.Test;
30 private static final SwitchId SRC_SWITCH =
new SwitchId(
"00:00:00:00:00:00:00:01");
31 private static final int SRC_PORT = 1;
32 private static final int SRC_VLAN = 1;
33 private static final SwitchId DST_SWITCH =
new SwitchId(
"00:00:00:00:00:00:00:02");
34 private static final int DST_PORT = 5;
35 private static final int DST_VLAN = 5;
41 flow.setSourceSwitch(SRC_SWITCH);
42 flow.setSourcePort(SRC_PORT);
43 flow.setSourceVlan(SRC_VLAN);
45 flow.setDestinationSwitch(DST_SWITCH);
46 flow.setDestinationPort(DST_PORT);
47 flow.setDestinationVlan(DST_VLAN);
54 flow.setSourceSwitch(SRC_SWITCH);
55 flow.setSourcePort(SRC_PORT);
56 flow.setSourceVlan(0);
58 target.checkFlowForEndpointConflicts(flow);
64 flow.setSourceSwitch(SRC_SWITCH);
65 flow.setSourcePort(SRC_PORT);
66 flow.setSourceVlan(SRC_VLAN);
68 target.checkFlowForEndpointConflicts(flow);
74 flow.setSourceSwitch(SRC_SWITCH);
75 flow.setSourcePort(SRC_PORT);
76 flow.setSourceVlan(SRC_VLAN + 1);
78 target.checkFlowForEndpointConflicts(flow);
84 flow.setSourceSwitch(SRC_SWITCH);
85 flow.setSourcePort(SRC_PORT);
86 flow.setSourceVlan(SRC_VLAN + 1);
87 flow.setDestinationSwitch(DST_SWITCH);
88 flow.setDestinationPort(DST_PORT);
89 flow.setDestinationVlan(0);
91 target.checkFlowForEndpointConflicts(flow);
97 flow.setSourceSwitch(SRC_SWITCH);
98 flow.setSourcePort(SRC_PORT);
99 flow.setSourceVlan(SRC_VLAN + 1);
100 flow.setDestinationSwitch(DST_SWITCH);
101 flow.setDestinationPort(DST_PORT);
102 flow.setDestinationVlan(DST_VLAN);
104 target.checkFlowForEndpointConflicts(flow);
110 flow.setSourceSwitch(SRC_SWITCH);
111 flow.setSourcePort(SRC_PORT);
112 flow.setSourceVlan(SRC_VLAN + 1);
113 flow.setDestinationSwitch(DST_SWITCH);
114 flow.setDestinationPort(DST_PORT);
115 flow.setDestinationVlan(DST_VLAN + 1);
117 target.checkFlowForEndpointConflicts(flow);
123 flow.setBandwidth(-1);
125 target.checkBandwidth(flow);
void pushFlow(ImmutablePair< Flow, Flow > flow)
void shouldFailForNegativeBandwidth()
void shouldFailIfDestinationVlanIsZeroAndPortIsOccupied()
void shouldNotFailIfDestinationVlanIsNotOccupied()
void shouldFailIfDestinationVlanIsAlreadyOccupied()
void shouldNotFailIfSourceVlanIsNotOccupied()
void shouldFailIfSourceVlanIsAlreadyOccupied()
void shouldFailIfSourceVlanIsZeroAndPortIsOccupied()