use of org.openkilda.messaging.payload.flow.FlowEndpointPayload in project open-kilda by telstra.
the class FlowCrudBasicRunTest method successfulFlowCreation.
@When("^flow (.*) creation request with (.*) (\\d+) (\\d+) and (.*) (\\d+) (\\d+) and (\\d+) is successful$")
public void successfulFlowCreation(final String flowId, final String sourceSwitch, final int sourcePort, final int sourceVlan, final String destinationSwitch, final int destinationPort, final int destinationVlan, final int bandwidth) throws Exception {
flowPayload = new FlowPayload(FlowUtils.getFlowName(flowId), new FlowEndpointPayload(sourceSwitch, sourcePort, sourceVlan), new FlowEndpointPayload(destinationSwitch, destinationPort, destinationVlan), bandwidth, false, flowId, null);
FlowPayload response = FlowUtils.putFlow(flowPayload);
assertNotNull(response);
response.setLastUpdated(null);
assertEquals(flowPayload, response);
}
use of org.openkilda.messaging.payload.flow.FlowEndpointPayload in project open-kilda by telstra.
the class FlowCrudBasicRunTest method failedFlowCreation.
@When("^flow (.*) creation request with (.*) (\\d+) (\\d+) and (.*) (\\d+) (\\d+) and (\\d+) is failed$")
public void failedFlowCreation(final String flowId, final String sourceSwitch, final int sourcePort, final int sourceVlan, final String destinationSwitch, final int destinationPort, final int destinationVlan, final int bandwidth) throws Exception {
flowPayload = new FlowPayload(FlowUtils.getFlowName(flowId), new FlowEndpointPayload(sourceSwitch, sourcePort, sourceVlan), new FlowEndpointPayload(destinationSwitch, destinationPort, destinationVlan), bandwidth, false, flowId, null);
FlowPayload response = FlowUtils.putFlow(flowPayload);
assertNull(response);
}
use of org.openkilda.messaging.payload.flow.FlowEndpointPayload in project open-kilda by telstra.
the class FlowFFRTest method successfulFlowCreation.
@When("^a flow (.*) is successfully created$")
public void successfulFlowCreation(String flowId) throws Throwable {
FlowPayload flowPayload = new FlowPayload(FlowUtils.getFlowName(flowId), new FlowEndpointPayload(sourceSwitch, sourcePort, sourceVlan), new FlowEndpointPayload(destinationSwitch, destinationPort, destinationVlan), bandwidth, false, flowId, null);
FlowPayload response = FlowUtils.putFlow(flowPayload);
assertNotNull(response);
response.setLastUpdated(null);
assertEquals(flowPayload, response);
System.out.println(response.toString());
TimeUnit.SECONDS.sleep(5);
}
use of org.openkilda.messaging.payload.flow.FlowEndpointPayload in project open-kilda by telstra.
the class StormTopologyLCM method activeSimpleNetworkTopologyWithTwoSwitchesAndFlow.
/**
* Test initial function, clear all then load basic network topology and create flow
*/
@Given("^active simple network topology with two switches and flow$")
public void activeSimpleNetworkTopologyWithTwoSwitchesAndFlow() throws Throwable {
// clearEverything
TestUtils.clearEverything(StringUtils.EMPTY);
FlowUtils.cleanupFlows();
// Load topo from file and send to mininet
String topology = IOUtils.toString(this.getClass().getResourceAsStream("/topologies/simple-topology.json"), UTF_8);
assertTrue(TopologyHelp.CreateMininetTopology(topology));
// Create and check flow
FlowPayload flowPayload = new FlowPayload(flowId, new FlowEndpointPayload("00:01:00:00:00:00:00:01", 1, 100), new FlowEndpointPayload("00:01:00:00:00:00:00:02", 1, 100), 10000, false, flowId, null);
FlowPayload response = null;
for (int i = 0; i < 10; ++i) {
response = FlowUtils.putFlow(flowPayload);
if (response != null) {
break;
}
TimeUnit.SECONDS.sleep(1);
}
assertNotNull(response);
response.setLastUpdated(null);
assertEquals(flowPayload, response);
// Check traffic on new flow
assertTrue(trafficIsOk(true));
// Save bolt state for compare it with new one after restart
expectedStateDumpsFromBolts = kafkaUtils.getStateDumpsFromBolts();
}
Aggregations