Search in sources :

Example 1 with TestRouterInterface

use of org.onosproject.openstacknetworking.impl.TestRouterInterface in project onos by opennetworkinglab.

the class OpenstackNetworkingUtilTest method testAddRouterIface.

/**
 * Tests addRouterIface method.
 */
@Test
public void testAddRouterIface() {
    OpenstackRouterAdminService service = new TestOpenstackRouterAdminService();
    addRouterIface(openstackPort, service);
    RouterInterface initialRouterInterface = new TestRouterInterface(openstackPort.getDeviceId(), openstackPort.getFixedIps().stream().findAny().get().getSubnetId(), openstackPort.getId(), openstackPort.getTenantId());
    assertTrue(routerInterfacesEquals(initialRouterInterface, service.routerInterface(openstackPort.getId())));
    addRouterIface(openstackSriovPort1, service);
    RouterInterface updatedInitialRouterInterface = new TestRouterInterface(openstackSriovPort1.getDeviceId(), openstackSriovPort1.getFixedIps().stream().findAny().get().getSubnetId(), openstackSriovPort1.getId(), openstackSriovPort1.getTenantId());
    assertTrue(routerInterfacesEquals(updatedInitialRouterInterface, service.routerInterface(openstackSriovPort1.getId())));
}
Also used : OpenstackRouterAdminService(org.onosproject.openstacknetworking.api.OpenstackRouterAdminService) TestRouterInterface(org.onosproject.openstacknetworking.impl.TestRouterInterface) RouterInterface(org.openstack4j.model.network.RouterInterface) TestRouterInterface(org.onosproject.openstacknetworking.impl.TestRouterInterface) OpenstackNodeTest(org.onosproject.openstacknode.api.OpenstackNodeTest) Test(org.junit.Test) OpenstackFloatingIpWebResourceTest(org.onosproject.openstacknetworking.web.OpenstackFloatingIpWebResourceTest) OpenstackNetworkWebResourceTest(org.onosproject.openstacknetworking.web.OpenstackNetworkWebResourceTest)

Aggregations

Test (org.junit.Test)1 OpenstackRouterAdminService (org.onosproject.openstacknetworking.api.OpenstackRouterAdminService)1 TestRouterInterface (org.onosproject.openstacknetworking.impl.TestRouterInterface)1 OpenstackFloatingIpWebResourceTest (org.onosproject.openstacknetworking.web.OpenstackFloatingIpWebResourceTest)1 OpenstackNetworkWebResourceTest (org.onosproject.openstacknetworking.web.OpenstackNetworkWebResourceTest)1 OpenstackNodeTest (org.onosproject.openstacknode.api.OpenstackNodeTest)1 RouterInterface (org.openstack4j.model.network.RouterInterface)1