use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.reg.move.grouping.NxRegMove in project genius by opendaylight.
the class ActionMoveSourceDestinationEth method buildAction.
@Override
public Action buildAction(int newActionKey) {
ActionBuilder ab = new ActionBuilder();
NxRegMove regMove = new NxRegMoveBuilder().setSrc(new SrcBuilder().setSrcChoice(new SrcOfEthSrcCaseBuilder().setOfEthSrc(Boolean.TRUE).build()).setStart(0).build()).setDst(new DstBuilder().setDstChoice(new DstOfEthDstCaseBuilder().setOfEthDst(Boolean.TRUE).build()).setStart(0).setEnd(47).build()).build();
ab.setAction(new NxActionRegMoveNodesNodeTableFlowApplyActionsCaseBuilder().setNxRegMove(regMove).build());
ab.setKey(new ActionKey(newActionKey));
return ab.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.reg.move.grouping.NxRegMove in project genius by opendaylight.
the class ActionMoveSourceDestinationEthTest method verifyAction.
private void verifyAction(Action action) {
assertTrue(action.getAction() instanceof NxActionRegMoveNodesNodeTableFlowApplyActionsCase);
NxActionRegMoveNodesNodeTableFlowApplyActionsCase actionCase = (NxActionRegMoveNodesNodeTableFlowApplyActionsCase) action.getAction();
NxRegMove nxRegMove = actionCase.getNxRegMove();
assertTrue(nxRegMove.getSrc().getSrcChoice() instanceof SrcOfEthSrcCase);
SrcOfEthSrcCase srcChoice = (SrcOfEthSrcCase) nxRegMove.getSrc().getSrcChoice();
assertTrue(srcChoice.isOfEthSrc());
assertEquals(0, nxRegMove.getSrc().getStart().intValue());
assertTrue(nxRegMove.getDst().getDstChoice() instanceof DstOfEthDstCase);
DstOfEthDstCase dstChoice = (DstOfEthDstCase) nxRegMove.getDst().getDstChoice();
assertTrue(dstChoice.isOfEthDst());
assertEquals(0, nxRegMove.getDst().getStart().intValue());
assertEquals(47, nxRegMove.getDst().getEnd().intValue());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.reg.move.grouping.NxRegMove in project genius by opendaylight.
the class ActionMoveSourceDestinationIpTest method verifyAction.
private void verifyAction(Action action) {
assertTrue(action.getAction() instanceof NxActionRegMoveNodesNodeTableFlowApplyActionsCase);
NxActionRegMoveNodesNodeTableFlowApplyActionsCase actionCase = (NxActionRegMoveNodesNodeTableFlowApplyActionsCase) action.getAction();
NxRegMove nxRegMove = actionCase.getNxRegMove();
assertTrue(nxRegMove.getSrc().getSrcChoice() instanceof SrcOfIpSrcCase);
SrcOfIpSrcCase srcChoice = (SrcOfIpSrcCase) nxRegMove.getSrc().getSrcChoice();
assertTrue(srcChoice.isOfIpSrc());
assertEquals(0, nxRegMove.getSrc().getStart().intValue());
assertTrue(nxRegMove.getDst().getDstChoice() instanceof DstOfIpDstCase);
DstOfIpDstCase dstChoice = (DstOfIpDstCase) nxRegMove.getDst().getDstChoice();
assertTrue(dstChoice.isOfIpDst());
assertEquals(0, nxRegMove.getDst().getStart().intValue());
assertEquals(31, nxRegMove.getDst().getEnd().intValue());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.reg.move.grouping.NxRegMove in project genius by opendaylight.
the class ActionMoveSourceDestinationIpv6Test method verifyAction.
private void verifyAction(Action action) {
assertTrue(action.getAction() instanceof NxActionRegMoveNodesNodeTableFlowApplyActionsCase);
NxActionRegMoveNodesNodeTableFlowApplyActionsCase actionCase = (NxActionRegMoveNodesNodeTableFlowApplyActionsCase) action.getAction();
NxRegMove nxRegMove = actionCase.getNxRegMove();
assertTrue(nxRegMove.getSrc().getSrcChoice() instanceof SrcNxIpv6SrcCase);
SrcNxIpv6SrcCase srcChoice = (SrcNxIpv6SrcCase) nxRegMove.getSrc().getSrcChoice();
assertTrue(srcChoice.isNxIpv6Src());
assertEquals(0, nxRegMove.getSrc().getStart().intValue());
assertTrue(nxRegMove.getDst().getDstChoice() instanceof DstNxIpv6DstCase);
DstNxIpv6DstCase dstChoice = (DstNxIpv6DstCase) nxRegMove.getDst().getDstChoice();
assertTrue(dstChoice.isNxIpv6Dst());
assertEquals(0, nxRegMove.getDst().getStart().intValue());
assertEquals(127, nxRegMove.getDst().getEnd().intValue());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.reg.move.grouping.NxRegMove in project openflowplugin by opendaylight.
the class RegMoveConvertorTest method setUp.
@Before
public void setUp() throws Exception {
final Src src = Mockito.mock(Src.class);
final Dst dst = Mockito.mock(Dst.class);
when(actionsCase.getNxRegMove()).thenReturn(nxRegMove);
when(nxRegMove.getSrc()).thenReturn(src);
when(nxRegMove.getDst()).thenReturn(dst);
when(nxRegMove.getSrc().getStart()).thenReturn(1);
when(nxRegMove.getSrc().getEnd()).thenReturn(2);
when(nxRegMove.getDst().getStart()).thenReturn(3);
when(nxRegMove.getDst().getEnd()).thenReturn(4);
when(nxRegMove.getDst().getDstChoice()).thenReturn(Mockito.mock(DstNxTunIdCase.class));
when(nxRegMove.getSrc().getSrcChoice()).thenReturn(Mockito.mock(SrcNxTunIdCase.class));
final ActionRegMove actionRegMove = Mockito.mock(ActionRegMove.class);
final NxActionRegMove nxActionRegMove = Mockito.mock(NxActionRegMove.class);
when(nxActionRegMove.getSrc()).thenReturn(NiciraMatchCodecs.TUN_ID_CODEC.getHeaderWithoutHasMask().toLong());
when(nxActionRegMove.getDst()).thenReturn(NiciraMatchCodecs.TUN_ID_CODEC.getHeaderWithoutHasMask().toLong());
when(nxActionRegMove.getNBits()).thenReturn(7);
when(actionRegMove.getNxActionRegMove()).thenReturn(nxActionRegMove);
when(action.getActionChoice()).thenReturn(actionRegMove);
regMoveConvertor = new RegMoveConvertor();
}
Aggregations