1 package org.openkilda.atdd.floodlight;
3 import static com.google.common.base.Charsets.UTF_8;
4 import static org.junit.Assert.assertTrue;
15 import cucumber.api.java.en.Given;
16 import cucumber.api.java.en.Then;
17 import cucumber.api.java.en.When;
18 import org.apache.commons.io.IOUtils;
19 import org.junit.Assert;
21 import java.util.List;
22 import javax.ws.rs.ProcessingException;
25 private static final String SWITCH_DPID =
"00:01:00:00:00:00:00:01";
26 private static final String ETHERNET_DEST_ADDRESS =
"01:23:45:67:89:0a";
34 @Given(
"^started floodlight container")
39 @Given(
"^created simple topology from two switches")
42 IOUtils.toString(this.getClass().getResourceAsStream(
"/topologies/simple-topology.json"), UTF_8);
46 @Given(
"^added custom flow rules")
56 @When(
"^floodlight controller is restarted")
61 @Then(
"^flow rules should not be cleared up")
66 Assert.assertEquals(staticEntries.size(), 0);
72 List<CoreFlowEntry> flows = null;
80 }
catch (InterruptedException ignored) { }
84 throw new ProcessingException(
"Can't reads flows list from FloodLight");
87 boolean isFlowSurvived =
false;
89 if (!entry.match.ethDest.equals(ETHERNET_DEST_ADDRESS)) {
93 isFlowSurvived =
true;
97 assertTrue(
"The test flow didn't survive controller reboot", isFlowSurvived);
StaticFlowEntry withEthDest(String ethDest)
List< CoreFlowEntry > listCoreFlows(String dpId)
StaticFlowEntry withAction(String action)
DpIdEntriesList listStaticEntries(String dpId)
StaticFlowEntry withCookie(Long cookie)
void givenStartedContainer()
static boolean CreateMininetTopology(String json)
StaticFlowEntry withInPort(String inPort)
static void clearEverything()
void addStaticFlow(StaticFlowEntry flow)