@Test public void createL3PrefixFlow_internalExceptionCaught() { EndpointBuilder gatewayEp = buildEndpoint(IPV4_0, MAC_0, CONNECTOR_0); OfOverlayContextBuilder ofOverlayContextBuilder = new OfOverlayContextBuilder(); ofOverlayContextBuilder.setNodeConnectorId(new NodeConnectorId(CONNECTOR_1)); gatewayEp.addAugmentation(OfOverlayContext.class, ofOverlayContextBuilder.build()); IndexedTenant tenant = getTestIndexedTenant(); SubnetBuilder localSubnetBuilder = new SubnetBuilder(); localSubnetBuilder.setId(SUBNET_1); localSubnetBuilder.setVirtualRouterIp(new IpAddress((IPV4_0))); localSubnetBuilder.setParent(L2FD_ID); Subnet localSubnet = localSubnetBuilder.build(); flows.createL3PrefixFlow(tableId, 30, gatewayEp.build(), null, tenant, localSubnet, null, ofWriter); verifyZeroInteractions(ofWriter); }
void createL3PrefixFlow(short goToTable, int priority, Endpoint gatewayEp, EndpointL3Prefix l3Prefix, IndexedTenant tenant, Subnet localSubnet, Set<NodeConnectorId> externalPorts, OfWriter ofWriter) { L3Context l3Context = utils.getL3ContextForSubnet(tenant, localSubnet); if (l3Context != null && localSubnet.getVirtualRouterIp() != null) { MacAddress matcherMacAddress = utils.routerPortMac(l3Context, localSubnet.getVirtualRouterIp(), tenant.getTenant().getId()); OfOverlayContext context = gatewayEp.getAugmentation(OfOverlayContext.class); if (EndpointManager.isInternal(gatewayEp, tenant.getExternalImplicitGroups())) { Preconditions.checkNotNull(context.getNodeConnectorId()); try { Long port = getOfPortNum(context.getNodeConnectorId()); if(matcherMacAddress != null) { writeL3PrefixFlow(priority, goToTable, gatewayEp, l3Prefix, port, matcherMacAddress, ofWriter); } } catch (NumberFormatException e) { LOG.warn("Could not parse port number {}", context.getNodeConnectorId()); } } else { for (NodeConnectorId externalPort : externalPorts) { try { Long port = getOfPortNum(externalPort); if(matcherMacAddress != null) { writeL3PrefixFlow(priority, goToTable, gatewayEp, l3Prefix, port, matcherMacAddress, ofWriter); } } catch (NumberFormatException e) { LOG.warn("Could not parse port number {}", externalPort); } } } } }
DestinationMapperFlows { void createL3PrefixFlow(short goToTable, int priority, Endpoint gatewayEp, EndpointL3Prefix l3Prefix, IndexedTenant tenant, Subnet localSubnet, Set<NodeConnectorId> externalPorts, OfWriter ofWriter) { L3Context l3Context = utils.getL3ContextForSubnet(tenant, localSubnet); if (l3Context != null && localSubnet.getVirtualRouterIp() != null) { MacAddress matcherMacAddress = utils.routerPortMac(l3Context, localSubnet.getVirtualRouterIp(), tenant.getTenant().getId()); OfOverlayContext context = gatewayEp.getAugmentation(OfOverlayContext.class); if (EndpointManager.isInternal(gatewayEp, tenant.getExternalImplicitGroups())) { Preconditions.checkNotNull(context.getNodeConnectorId()); try { Long port = getOfPortNum(context.getNodeConnectorId()); if(matcherMacAddress != null) { writeL3PrefixFlow(priority, goToTable, gatewayEp, l3Prefix, port, matcherMacAddress, ofWriter); } } catch (NumberFormatException e) { LOG.warn("Could not parse port number {}", context.getNodeConnectorId()); } } else { for (NodeConnectorId externalPort : externalPorts) { try { Long port = getOfPortNum(externalPort); if(matcherMacAddress != null) { writeL3PrefixFlow(priority, goToTable, gatewayEp, l3Prefix, port, matcherMacAddress, ofWriter); } } catch (NumberFormatException e) { LOG.warn("Could not parse port number {}", externalPort); } } } } } }
DestinationMapperFlows { void createL3PrefixFlow(short goToTable, int priority, Endpoint gatewayEp, EndpointL3Prefix l3Prefix, IndexedTenant tenant, Subnet localSubnet, Set<NodeConnectorId> externalPorts, OfWriter ofWriter) { L3Context l3Context = utils.getL3ContextForSubnet(tenant, localSubnet); if (l3Context != null && localSubnet.getVirtualRouterIp() != null) { MacAddress matcherMacAddress = utils.routerPortMac(l3Context, localSubnet.getVirtualRouterIp(), tenant.getTenant().getId()); OfOverlayContext context = gatewayEp.getAugmentation(OfOverlayContext.class); if (EndpointManager.isInternal(gatewayEp, tenant.getExternalImplicitGroups())) { Preconditions.checkNotNull(context.getNodeConnectorId()); try { Long port = getOfPortNum(context.getNodeConnectorId()); if(matcherMacAddress != null) { writeL3PrefixFlow(priority, goToTable, gatewayEp, l3Prefix, port, matcherMacAddress, ofWriter); } } catch (NumberFormatException e) { LOG.warn("Could not parse port number {}", context.getNodeConnectorId()); } } else { for (NodeConnectorId externalPort : externalPorts) { try { Long port = getOfPortNum(externalPort); if(matcherMacAddress != null) { writeL3PrefixFlow(priority, goToTable, gatewayEp, l3Prefix, port, matcherMacAddress, ofWriter); } } catch (NumberFormatException e) { LOG.warn("Could not parse port number {}", externalPort); } } } } } DestinationMapperFlows(DestinationMapperUtils utils, NodeId nodeId, short tableId); }
DestinationMapperFlows { void createL3PrefixFlow(short goToTable, int priority, Endpoint gatewayEp, EndpointL3Prefix l3Prefix, IndexedTenant tenant, Subnet localSubnet, Set<NodeConnectorId> externalPorts, OfWriter ofWriter) { L3Context l3Context = utils.getL3ContextForSubnet(tenant, localSubnet); if (l3Context != null && localSubnet.getVirtualRouterIp() != null) { MacAddress matcherMacAddress = utils.routerPortMac(l3Context, localSubnet.getVirtualRouterIp(), tenant.getTenant().getId()); OfOverlayContext context = gatewayEp.getAugmentation(OfOverlayContext.class); if (EndpointManager.isInternal(gatewayEp, tenant.getExternalImplicitGroups())) { Preconditions.checkNotNull(context.getNodeConnectorId()); try { Long port = getOfPortNum(context.getNodeConnectorId()); if(matcherMacAddress != null) { writeL3PrefixFlow(priority, goToTable, gatewayEp, l3Prefix, port, matcherMacAddress, ofWriter); } } catch (NumberFormatException e) { LOG.warn("Could not parse port number {}", context.getNodeConnectorId()); } } else { for (NodeConnectorId externalPort : externalPorts) { try { Long port = getOfPortNum(externalPort); if(matcherMacAddress != null) { writeL3PrefixFlow(priority, goToTable, gatewayEp, l3Prefix, port, matcherMacAddress, ofWriter); } } catch (NumberFormatException e) { LOG.warn("Could not parse port number {}", externalPort); } } } } } DestinationMapperFlows(DestinationMapperUtils utils, NodeId nodeId, short tableId);  }
DestinationMapperFlows { void createL3PrefixFlow(short goToTable, int priority, Endpoint gatewayEp, EndpointL3Prefix l3Prefix, IndexedTenant tenant, Subnet localSubnet, Set<NodeConnectorId> externalPorts, OfWriter ofWriter) { L3Context l3Context = utils.getL3ContextForSubnet(tenant, localSubnet); if (l3Context != null && localSubnet.getVirtualRouterIp() != null) { MacAddress matcherMacAddress = utils.routerPortMac(l3Context, localSubnet.getVirtualRouterIp(), tenant.getTenant().getId()); OfOverlayContext context = gatewayEp.getAugmentation(OfOverlayContext.class); if (EndpointManager.isInternal(gatewayEp, tenant.getExternalImplicitGroups())) { Preconditions.checkNotNull(context.getNodeConnectorId()); try { Long port = getOfPortNum(context.getNodeConnectorId()); if(matcherMacAddress != null) { writeL3PrefixFlow(priority, goToTable, gatewayEp, l3Prefix, port, matcherMacAddress, ofWriter); } } catch (NumberFormatException e) { LOG.warn("Could not parse port number {}", context.getNodeConnectorId()); } } else { for (NodeConnectorId externalPort : externalPorts) { try { Long port = getOfPortNum(externalPort); if(matcherMacAddress != null) { writeL3PrefixFlow(priority, goToTable, gatewayEp, l3Prefix, port, matcherMacAddress, ofWriter); } } catch (NumberFormatException e) { LOG.warn("Could not parse port number {}", externalPort); } } } } } DestinationMapperFlows(DestinationMapperUtils utils, NodeId nodeId, short tableId);   }