use of org.onosproject.newoptical.api.OpticalConnectivityId in project onos by opennetworkinglab.
the class OpticalPathProvisionerTest method testInstalledEventLocal.
/**
* Checks if PATH_INSTALLED event comes up after intent whose master is this node is installed.
*/
@Test
public void testInstalledEventLocal() {
Bandwidth bandwidth = Bandwidth.bps(100);
Duration latency = Duration.ofMillis(10);
OpticalConnectivityId cid = target.setupConnectivity(CP12, CP71, bandwidth, latency);
// notify all intents are installed
intentService.notifyInstalled();
assertEquals(1, listener.events.size());
assertEquals(OpticalPathEvent.Type.PATH_INSTALLED, listener.events.get(0).type());
assertEquals(cid, listener.events.get(0).subject());
}
use of org.onosproject.newoptical.api.OpticalConnectivityId in project onos by opennetworkinglab.
the class OpticalPathProvisionerTest method testRemovedEventRemote.
/**
* Checks if PATH_REMOVED event comes up after packet link is removed.
*/
@Test
public void testRemovedEventRemote() {
// set the master for ingress device of intent to remote node
mastershipService.setMastership(DEVICE2.id(), MastershipRole.NONE);
Bandwidth bandwidth = Bandwidth.bps(100);
Duration latency = Duration.ofMillis(10);
OpticalConnectivityId cid = target.setupConnectivity(CP12, CP71, bandwidth, latency);
// notify all intents are installed
intentService.notifyInstalled();
target.removeConnectivity(cid);
// notify all intents are withdrawn
intentService.notifyWithdrawn();
// remote nodes must not receive event before distributed map is updated
assertEquals(0, listener.events.size());
}
Aggregations