use of org.onosproject.net.Path in project onos by opennetworkinglab.
the class TopologyManagerTest method onDemandPath.
@Test
public void onDemandPath() {
submitTopologyGraph();
Topology topology = service.currentTopology();
LinkWeigher weight = new LinkWeigherAdapter(3.3);
Set<Path> paths = service.getPaths(topology, did("a"), did("c"), weight);
assertEquals("wrong path count", 2, paths.size());
Path path = paths.iterator().next();
assertEquals("wrong path length", 2, path.links().size());
assertEquals("wrong path cost", ScalarWeight.toWeight(6.6), path.weight());
}
use of org.onosproject.net.Path in project onos by opennetworkinglab.
the class PathManagerTest method infraToEdge.
@Test
public void infraToEdge() {
DeviceId src = did("src");
HostId dst = hid("12:34:56:78:90:ab/1");
fakeTopoMgr.paths.add(createPath("src", "middle", "edge"));
fakeHostMgr.hosts.put(dst, host("12:34:56:78:90:ab/1", "edge"));
Set<Path> paths = service.getPaths(src, dst);
validatePaths(paths, 1, 3, src, dst);
}
use of org.onosproject.net.Path in project onos by opennetworkinglab.
the class PathManagerTest method infraToInfra.
@Test
public void infraToInfra() {
DeviceId src = did("src");
DeviceId dst = did("dst");
fakeTopoMgr.paths.add(createPath("src", "middle", "dst"));
Set<Path> paths = service.getPaths(src, dst);
validatePaths(paths, 1, 2, src, dst);
validatePaths(service.getKShortestPaths(src, dst).collect(Collectors.toSet()), 1, 2, src, dst);
}
Aggregations