use of org.openkilda.messaging.payload.flow.FlowPayload 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.FlowPayload in project open-kilda by telstra.
the class FlowIgnoreBandwidthTest method flowHaveIgnoreBandwidthFlag.
@Then("^flow between ([0-9a-f]{2}(?::[0-9a-f]{2}){7}) and ([0-9a-f]{2}(?::[0-9a-f]{2}){7}) have ignore_bandwidth flag$")
public void flowHaveIgnoreBandwidthFlag(String source, String dest) {
String flowId = lookupCreatedFlowId(source, dest);
FlowPayload flow = FlowUtils.getFlow(flowId);
Assert.assertNotNull("Can\'t locate flow", flow);
Assert.assertTrue("Flow's ignore_bandwidth flag is NOT set", flow.isIgnoreBandwidth());
}
use of org.openkilda.messaging.payload.flow.FlowPayload 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