use of org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.policy.rev151009.routing.policy.policy.definitions.policy.definition.statements.statement.actions.bgp.actions.set.ext.community.set.ext.community.method.Reference in project lispflowmapping by opendaylight.
the class MappingServiceIntegrationTestUtil method checkSmr.
/**
* Read packets from the given socket until a Map-Request is found. Assert that the request is an SMR, and the
* Source EID field contains the given IPv4 EID. Note that the source EID does not have a mask length. If a
* reference to the LISP Mapping Service is passed, send an SMR-invoked Map-Request, to simulate what would happen
* in the real world. If a reference to the Mapping Service is passed, the internal state of the map caches and
* subscribers is logged.
*
* @param socket the receive socket
* @param lms reference to the LISP Mapping Service, if present, an SMR-invoked Map-Request is sent in reply to the
* SMR
* @param ms reference to the Mapping System, if present, the internal state of map-caches and subscribers is logged
* @param vni the VNI for the expected EID
* @param eids the expected EIDs, as an IPv4 string, without mask length
*/
static void checkSmr(DatagramSocket socket, IFlowMapping lms, IMappingService ms, long vni, String... eids) {
LOG.debug("checkSmr: expecting {} SMRs: {}", eids.length, eids);
List<MapRequest> mapRequests = receiveExpectedSmrs(socket, eids.length);
assertNoMoreSMRs(socket, ms);
HashMap<Eid, Integer> eidSet = prepareExpectedEids(vni, eids);
for (MapRequest mapRequest : mapRequests) {
LOG.trace("Solicit Map-Request: {}", mapRequest);
Eid originalSourceEid = mapRequest.getEidItem().get(0).getEid();
assertEquals(DEFAULT_IPV4_EID_PREFIX, originalSourceEid);
Eid smrEid = mapRequest.getSourceEid().getEid();
int counterDecremented = eidSet.get(smrEid) - 1;
if (counterDecremented < 0) {
fail("checkSmr: SMR contains EID " + LispAddressStringifier.getString(smrEid) + ", which is not in the list of expected EIDs: " + eidSet);
} else {
LOG.debug("checkSmr: successfully received expected SMR for {}", LispAddressStringifier.getString(smrEid));
}
if (lms != null) {
sendSMRInvokedMapRequestMessage(mapRequest, lms);
// TODO Capture the reply to the SMR-invoked Map-Request and assert on the expected result
}
}
if (ms != null) {
printMapCacheState(ms);
}
}
Aggregations