use of org.openkilda.testing.model.topology.TopologyDefinition.Isl in project open-kilda by telstra.
the class TopologyVerificationSteps method checkDiscoveredLinks.
@And("^all defined links are detected")
public void checkDiscoveredLinks() {
if (actualLinks.isEmpty() && referenceLinks.isEmpty()) {
scenario.write("There are no links discovered as expected");
return;
}
assertFalse("No links were discovered", actualLinks.isEmpty());
assertThat("Discovered links don't match expected", actualLinks, containsInAnyOrder(referenceLinks.stream().flatMap(link -> {
// in kilda we have forward and reverse isl, that's why we have to divide into 2
Isl pairedLink = Isl.factory(link.getDstSwitch(), link.getDstPort(), link.getSrcSwitch(), link.getSrcPort(), link.getMaxBandwidth(), link.getAswitch());
return Stream.of(link, pairedLink);
}).map(IslMatcher::new).collect(toList())));
}
use of org.openkilda.testing.model.topology.TopologyDefinition.Isl in project open-kilda by telstra.
the class LinkPropertiesSteps method createLinkPropertiesRequest.
@When("^create link properties request for ISL '(.*)'$")
public void createLinkPropertiesRequest(String islAlias) {
linkPropsRequest = new LinkPropsDto();
Isl theIsl = topologyUnderTest.getAliasedObject(islAlias);
linkPropsRequest.setSrcSwitch(theIsl.getSrcSwitch().getDpId().toString());
linkPropsRequest.setSrcPort(theIsl.getSrcPort());
linkPropsRequest.setDstSwitch(theIsl.getDstSwitch().getDpId().toString());
linkPropsRequest.setDstPort(theIsl.getDstPort());
}
use of org.openkilda.testing.model.topology.TopologyDefinition.Isl in project open-kilda by telstra.
the class LinkSteps method selectARandomIslAndAliasItAsIsl.
@Given("^select a random ISL and alias it as '(.*)'$")
public void selectARandomIslAndAliasItAsIsl(String islAlias) {
List<Isl> isls = getUnaliasedIsls();
Random r = new Random();
Isl theIsl = isls.get(r.nextInt(isls.size()));
log.info("Selected random isl: {}", theIsl.toString());
topologyUnderTest.addAlias(islAlias, theIsl);
}