use of org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.PortFeatures in project openflowplugin by opendaylight.
the class PortTranslatorUtilTest method testTranslatePortFeatures.
/**
* Test method for
* {@link PortTranslatorUtil#translatePortFeatures(org.opendaylight.yang.gen.v1.urn.opendaylight
* .openflow.common.types.rev130731.PortFeatures)}.
*/
@Test
public void testTranslatePortFeatures() {
for (int i = 0; i < pfBls.length; i++) {
pfBls[i] = true;
final PortFeatures apf = getPortFeatures();
org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.PortFeatures npf = PortTranslatorUtil.translatePortFeatures(apf);
assertEqualsPortFeatures(apf, npf);
pfBls[i] = false;
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.PortFeatures in project openflowplugin by opendaylight.
the class SalPortServiceImplTest method dummyUpdatePortInput.
private UpdatePortInput dummyUpdatePortInput() {
org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.port.mod.port.PortBuilder concretePortBuilder = new org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.port.mod.port.PortBuilder();
concretePortBuilder.setConfiguration(new PortConfig(true, true, true, true));
concretePortBuilder.setAdvertisedFeatures(new PortFeatures(true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true));
concretePortBuilder.setPortNumber(new PortNumberUni(DUMMY_PORT_NUMBER));
concretePortBuilder.setHardwareAddress(new MacAddress(DUMMY_MAC_ADDRESS));
List<org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.port.mod.port.Port> ports = Lists.newArrayList(concretePortBuilder.build());
Port port = new PortBuilder().setPort(ports).build();
UpdatedPort updatePort = new UpdatedPortBuilder().setPort(port).build();
return new UpdatePortInputBuilder().setUpdatedPort(updatePort).build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.PortFeatures in project openflowplugin by opendaylight.
the class MultipartReplyMessageFactoryTest method createPortList.
private static List<Ports> createPortList() {
PortsBuilder builder = new PortsBuilder();
builder.setPortNo(1L);
builder.setHwAddr(new MacAddress("94:de:80:a6:61:40"));
builder.setName("Port name");
builder.setConfig(new PortConfig(true, false, true, false));
builder.setState(new PortState(true, false, true));
builder.setCurrentFeatures(new PortFeatures(true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false));
builder.setAdvertisedFeatures(new PortFeatures(true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false));
builder.setSupportedFeatures(new PortFeatures(true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false));
builder.setPeerFeatures(new PortFeatures(true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false));
builder.setCurrSpeed(1234L);
builder.setMaxSpeed(1234L);
List<Ports> list = new ArrayList<>();
list.add(builder.build());
return list;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.PortFeatures in project openflowplugin by opendaylight.
the class PortStatusMessageFactoryTest method testWithDifferentBitmaps.
/**
* Testing {@link PortStatusMessageFactory} for correct translation into POJO.
*/
@Test
public void testWithDifferentBitmaps() {
ByteBuf bb = BufferHelper.buildBuffer(// reason, padding
"01 00 00 00 00 00 00 00 " + // port no, padding
"00 01 02 03 00 00 00 00 " + // mac address, padding
"08 00 27 00 B0 EB 00 00 " + // port name, String "s1-eth1"
"73 31 2d 65 74 68 31 00 00 00 00 00 00 00 00 00 " + // port config
"00 00 00 24 " + // port state
"00 00 00 02 " + // current + advertised features
"00 00 00 81 00 00 00 A1 " + // supported + peer features
"00 00 FF FF 00 00 00 00 " + // curr speed, max speed
"00 00 00 81 00 00 00 80");
PortStatusMessage message = BufferHelper.deserialize(statusFactory, bb);
Assert.assertEquals("Wrong portConfig", new PortConfig(true, false, true, false), message.getConfig());
Assert.assertEquals("Wrong portState", new PortState(true, false, false), message.getState());
Assert.assertEquals("Wrong supportedFeatures", new PortFeatures(true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true), message.getSupportedFeatures());
Assert.assertEquals("Wrong peerFeatures", new PortFeatures(false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false), message.getPeerFeatures());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.PortFeatures in project openflowplugin by opendaylight.
the class PortUpdateTranslatorTest method testTranslate_13.
@Test
public void testTranslate_13() throws Exception {
Mockito.when(deviceInfo.getVersion()).thenReturn(OFConstants.OFP_VERSION_1_3);
final org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.PortFeatures portFeatures = org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.PortFeatures.getDefaultInstance("hundredGbFd");
final FlowCapableNodeConnector nodeConnector = portUpdateTranslator.translate(portBld.build(), deviceInfo, null);
commonCheck(nodeConnector);
Assert.assertEquals(portConfig, nodeConnector.getConfiguration());
Assert.assertEquals(portFeatures, nodeConnector.getCurrentFeature());
Assert.assertEquals(portFeatures, nodeConnector.getAdvertisedFeatures());
Assert.assertEquals(portFeatures, nodeConnector.getPeerFeatures());
Assert.assertEquals(portFeatures, nodeConnector.getSupported());
Assert.assertEquals(portStateBld.build(), nodeConnector.getState());
Assert.assertTrue(nodeConnector.getQueue().isEmpty());
}
Aggregations