use of org.onosproject.vpls.api.VplsData in project onos by opennetworkinglab.
the class VplsManagerTest method hostAddEventTest.
/**
* Trigger host event listener by HOST_ADDED event.
*/
@Test
public void hostAddEventTest() {
VplsData vplsData = vplsManager.createVpls(VPLS1, NONE);
vplsManager.addInterface(vplsData, V100H1);
HostEvent hostEvent = new HostEvent(HostEvent.Type.HOST_ADDED, V100HOST1);
hostService.postHostEvent(hostEvent);
vplsData = vplsStore.getVpls(VPLS1);
assertEquals(UPDATING, vplsData.state());
}
use of org.onosproject.vpls.api.VplsData in project onos by opennetworkinglab.
the class VplsManagerTest method testRemoveInterfaces.
/**
* Removes network interfaces from a VPLS.
*/
@Test
public void testRemoveInterfaces() {
VplsData vplsData = vplsManager.createVpls(VPLS1, NONE);
vplsManager.addInterface(vplsData, V100H1);
vplsManager.addInterface(vplsData, V100H2);
vplsManager.removeInterfaces(vplsData, ImmutableSet.of(V100H1, V100H2));
vplsData = vplsStore.getVpls(VPLS1);
assertNotNull(vplsData);
assertEquals(vplsData.state(), UPDATING);
assertEquals(0, vplsData.interfaces().size());
}
use of org.onosproject.vpls.api.VplsData in project onos by opennetworkinglab.
the class VplsManagerTest method testAddInterfaces.
/**
* Adds network interfaces to a VPLS.
*/
@Test
public void testAddInterfaces() {
VplsData vplsData = vplsManager.createVpls(VPLS1, NONE);
vplsManager.addInterfaces(vplsData, ImmutableSet.of(V100H1, V100H2));
vplsData = vplsStore.getVpls(VPLS1);
assertNotNull(vplsData);
assertEquals(vplsData.state(), UPDATING);
assertEquals(2, vplsData.interfaces().size());
assertTrue(vplsData.interfaces().contains(V100H1));
assertTrue(vplsData.interfaces().contains(V100H2));
}
use of org.onosproject.vpls.api.VplsData in project onos by opennetworkinglab.
the class VplsManagerTest method testRemoveVpls.
/**
* Removes a VPLS.
*/
@Test
public void testRemoveVpls() {
VplsData vplsData = vplsManager.createVpls(VPLS1, NONE);
vplsManager.removeVpls(vplsData);
assertEquals(vplsData.state(), REMOVING);
vplsData = vplsStore.getVpls(VPLS1);
assertNull(vplsData);
Collection<VplsData> allVpls = vplsStore.getAllVpls();
assertEquals(0, allVpls.size());
}
use of org.onosproject.vpls.api.VplsData in project onos by opennetworkinglab.
the class VplsManagerTest method testCreateVpls.
/**
* Creates VPLS by given name and encapsulation type.
*/
@Test
public void testCreateVpls() {
VplsData vplsData = vplsManager.createVpls(VPLS1, NONE);
assertEquals(VPLS1, vplsData.name());
assertEquals(NONE, vplsData.encapsulationType());
vplsData = vplsStore.getVpls(VPLS1);
assertEquals(vplsData.state(), ADDING);
}
Aggregations