16 package org.openkilda.atdd;
18 import static org.junit.Assert.assertEquals;
19 import static org.junit.Assert.assertTrue;
23 import cucumber.api.java.en.Given;
24 import cucumber.api.java.en.Then;
25 import cucumber.api.java.en.When;
26 import org.glassfish.jersey.client.ClientConfig;
33 import javax.ws.rs.client.Client;
34 import javax.ws.rs.client.ClientBuilder;
35 import javax.ws.rs.core.Response;
50 start = System.currentTimeMillis();
53 @Given(
"^a random linear topology of (\\d+) switches$")
58 @Given(
"^a random tree topology with depth of (\\d+) and fanout of (\\d+)$")
63 @When(
"^the controller learns the topology$")
72 finish = System.currentTimeMillis();
75 @Then(
"^the controller should converge within (\\d+) milliseconds$")
78 System.out.println(String.format(
"Failed finish-start convergence: delta_ma:%d, actual:%d", delta, (
finish-
start)));
90 System.out.println(String.format(
"Failed finish-pre_start convergence test: delta_ma:%d, actual:%d", delta, (
finish-
pre_start)));
96 @Then(
"^the topology is not changed")
102 @When(
"^send malformed lldp packet$")
104 System.out.println(
"=====> Send malformed packet");
106 long current = System.currentTimeMillis();
107 Client client = ClientBuilder.newClient(
new ClientConfig());
109 .target(trafficEndpoint)
110 .path(
"/send_malformed_packet")
113 System.out.println(String.format(
"======> Response = %s",
result.toString()));
114 System.out.println(String.format(
"======> Send malformed packet Time: %,.3f", getTimeDuration(current)));
116 assertEquals(200,
result.getStatus());
void the_controller_learns_the_topology()
void sendMalformedLldpPacket()
static final String toMininetJson(ITopology topo)
void deploy_toplogy(ITopology t)
void the_controller_should_converge_within_milliseconds(int delta)
void a_random_linear_topology_of(int numSwitches)
static void validateTopos(ITopology expected, ITopology actual)
static final String trafficEndpoint
static final Topology buildLinearTopo(int numSwitches)
static boolean CreateMininetTopology(String json)
static int pre_start_handicap
static ITopology translateTopoEngTopo(ITopology expected)
static final Topology buildTreeTopo(int depth, int fanout)
void a_random_full_mesh_topology_of(int depth, int fanout)
static double getTimeDuration(final long current)