use of org.opendaylight.genius.testutils.interfacemanager.TunnelInterfaceDetails in project netvirt by opendaylight.
the class ElanServiceTest method checkDmacOfOtherDPN.
@Test
public void checkDmacOfOtherDPN() throws Exception {
// Create Elan instance
createElanInstance(ExpectedObjects.ELAN1, ExpectedObjects.ELAN1_SEGMENT_ID);
awaitForElanTag(ExpectedObjects.ELAN1);
InterfaceInfo interfaceInfo = ELAN_INTERFACES.get(ELAN1 + ":" + DPN1MAC1).getLeft();
addElanInterface(ExpectedObjects.ELAN1, interfaceInfo, DPN1IP1);
// Read Elan instance
InstanceIdentifier<ElanInstance> elanInstanceIid = InstanceIdentifier.builder(ElanInstances.class).child(ElanInstance.class, new ElanInstanceKey(ExpectedObjects.ELAN1)).build();
ElanInstance actualElanInstances = singleTxdataBroker.syncRead(CONFIGURATION, elanInstanceIid);
interfaceInfo = ELAN_INTERFACES.get(ELAN1 + ":" + DPN2MAC1).getLeft();
addElanInterface(ExpectedObjects.ELAN1, interfaceInfo, DPN2IP1);
// Read and Compare DMAC flow in DPN1 for MAC1 of DPN2
String flowId = ElanUtils.getKnownDynamicmacFlowRef((short) 51, DPN1_ID, DPN2_ID, interfaceInfo.getMacAddress().toString(), actualElanInstances.getElanTag());
InstanceIdentifier<Flow> flowInstanceIidDst = getFlowIid(NwConstants.ELAN_DMAC_TABLE, new FlowId(flowId), DPN1_ID);
awaitForData(LogicalDatastoreType.CONFIGURATION, flowInstanceIidDst);
Flow flowDst = singleTxdataBroker.syncRead(CONFIGURATION, flowInstanceIidDst);
flowDst = getFlowWithoutCookie(flowDst);
TunnelInterfaceDetails tepDetails = EXTN_INTFS.get(DPN1_ID_STR + ":" + DPN2_ID_STR);
Flow expected = ExpectedObjects.checkDmacOfOtherDPN(flowId, interfaceInfo, tepDetails, actualElanInstances);
AssertDataObjects.assertEqualBeans(getSortedActions(expected), getSortedActions(flowDst));
}
Aggregations