package org.opendaylight.groupbasedpolicy.renderer.ofoverlay.mapper;\r
\r
+import com.google.common.base.Preconditions;\r
import com.google.common.collect.ImmutableList;\r
import org.opendaylight.groupbasedpolicy.api.sf.L4ClassifierDefinition;\r
import org.opendaylight.groupbasedpolicy.dto.IndexedTenant;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.Match;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.common.rev140421.ActionName;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.common.rev140421.ClassifierName;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.common.rev140421.ContextId;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.common.rev140421.ContractId;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.common.rev140421.EndpointGroupId;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.common.rev140421.L2BridgeDomainId;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.TenantBuilder;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.ForwardingContextBuilder;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.PolicyBuilder;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.forwarding.context.L2BridgeDomain;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.forwarding.context.L2BridgeDomainBuilder;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.forwarding.context.L2FloodDomain;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.forwarding.context.L2FloodDomainBuilder;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.forwarding.context.L3Context;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.forwarding.context.L3ContextBuilder;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.forwarding.context.Subnet;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.forwarding.context.SubnetBuilder;\r
\r
public abstract class MapperUtilsTest {\r
\r
- protected static final String IPV4_1 = "170.0.0.1";\r
- protected static final String IPV4_2 = "190.0.0.1";\r
- protected static final String MAC_0 = "00:00:00:00:00:00";\r
- protected static final String MAC_1 = "00:00:00:00:00:01";\r
- protected static final String CONNECTOR_0 = "0";\r
- protected static final String CONNECTOR_1 = "1";\r
+ protected static final MacAddress MAC_0 = new MacAddress("00:00:00:00:00:00");\r
+ protected static final MacAddress MAC_1 = new MacAddress("00:00:00:00:00:01");\r
+ protected static final MacAddress MAC_2 = new MacAddress("00:00:00:00:00:02");\r
+ protected static final Ipv4Address IPV4_0 = new Ipv4Address("170.0.0.1");\r
+ protected static final Ipv4Address IPV4_1 = new Ipv4Address("190.0.0.1");\r
+ protected static final Ipv4Address IPV4_2 = new Ipv4Address("210.0.0.1");\r
+ protected static final Ipv6Address IPV6_1 = new Ipv6Address("2000:db80:85a3:08ba:0947:8a2e:3a70:7334");\r
+ protected static final Ipv6Address IPV6_2 = new Ipv6Address("0947:db80:3a70:7334:85a3:8a2e:2000:08ba");\r
+ protected static final NodeConnectorId CONNECTOR_0 = new NodeConnectorId("0");\r
+ protected static final NodeConnectorId CONNECTOR_1 = new NodeConnectorId("1");\r
+ protected static final NodeConnectorId CONNECTOR_2 = new NodeConnectorId("2");\r
+ protected static final SubnetId SUBNET_0 = new SubnetId("subnet0");\r
+ protected static final SubnetId SUBNET_1 = new SubnetId("subnet1");\r
+ protected static final SubnetId SUBNET_2 = new SubnetId("subnet2");\r
+ protected static final SubnetId SUBNET_EXT = new SubnetId("externalSubnet");\r
protected static final String IP_PREFIX_32 = "/32";\r
protected static final String IP_PREFIX_128 = "/128";\r
- protected static final String IPV6_1 = "2000:db80:85a3:08ba:0947:8a2e:3a70:7334";\r
- protected static final String IPV6_2 = "0947:db80:3a70:7334:85a3:8a2e:2000:08ba";\r
- protected static final String DHCP_IP = "255.255.255.255";\r
- protected static final String TENANT_ID = "dummy tenant";\r
- protected static final String NODE_ID = "dummy node";\r
+ protected static final TenantId TENANT_ID = new TenantId("tenantId");\r
+ protected static final NodeId NODE_ID = new NodeId("nodeId");\r
+ protected static final EndpointGroupId ENDPOINT_GROUP_0 = new EndpointGroupId("eg0");\r
+ protected static final EndpointGroupId ENDPOINT_GROUP_1 = new EndpointGroupId("eg1");\r
+ protected static final EndpointGroupId ENDPOINT_GROUP_2 = new EndpointGroupId("eg2");\r
+ protected static final NetworkDomainId NET_DOMAIN_ID = new NetworkDomainId("ndId");\r
+ protected static final L2BridgeDomainId L2BD_ID = new L2BridgeDomainId("l2bdId");\r
+ protected static final L2FloodDomainId L2FD_ID = new L2FloodDomainId("l2fdId");\r
+ protected static final L2FloodDomainId L2_FD_ID_EXT = new L2FloodDomainId("externalL2fdId");\r
+ protected static final L3ContextId L3C_ID = new L3ContextId("l3cId");\r
+ protected static final ContractId CONTRACT_ID = new ContractId("contractId");\r
+ protected static final ContextId CONTEXT_ID = new L3ContextId("ctxId");\r
+ // Often used strings\r
+ protected static final String ALLOW = "allow";\r
protected static final String L2 = "L2";\r
- protected static final String EPG_ID = "dummy epg id";\r
- protected static final String ENDPOINT_GROUP_0 = "eg0";\r
- protected static final String ENDPOINT_GROUP_1 = "eg1";\r
- protected static final String ENDPOINT_GROUP_2 = "eg2";\r
- private static final String DOMAIN_ID = "dummy id";\r
- protected final NodeId nodeId = new NodeId(NODE_ID);\r
- protected final NodeConnectorId nodeConnectorId = new NodeConnectorId(nodeId.getValue() + CONNECTOR_0);\r
- protected final L2BridgeDomainId bd = new L2BridgeDomainId("c95182ba-7807-43f8-98f7-6c7c720b7639");\r
- protected final EndpointGroupId eg = new EndpointGroupId("36dec84a-08c7-497b-80b6-a0035af72a12");\r
- protected final EndpointGroupId eg2 = new EndpointGroupId("632e5e11-7988-4eb5-8fe6-6c182d890276");\r
- protected final ContractId cid = new ContractId("a5874893-bcd5-46de-96af-3c8d99bedf9f");\r
- protected final L3ContextId l3c = new L3ContextId("2cf51ee4-e996-467e-a277-2d380334a91d");\r
- protected final L2FloodDomainId fd = new L2FloodDomainId("98e1439e-52d2-46f8-bd69-5136e6088771");\r
- protected final L2FloodDomainId ext_fd = new L2FloodDomainId("d8024f7a-b83e-11e5-9912-ba0be0483c18");\r
- protected final SubnetId sub = new SubnetId("4fcf8dfc-53b5-4aef-84d3-6b5586992fcb");\r
- protected final SubnetId sub2 = new SubnetId("c285a59f-fcb8-42e6-bf29-87ea522fd626");\r
- protected final SubnetId sub3 = new SubnetId("a0380d52-2a25-48ef-882c-a4d4cd9e00ec");\r
- protected final SubnetId ext_sub = new SubnetId("8da17ad9-3261-4dc9-bcff-928a2f73cce7");\r
- protected final TenantId tid = new TenantId(TENANT_ID);\r
+ protected static final String OPENFLOW = "openflow:";\r
+ protected static final String DROP_ALL = "dropAll";\r
+ protected static final String DROP = "drop";\r
+ protected static final String TCP_SRC = "tcp_src_80";\r
+ // Mock variables\r
protected Short tableId;\r
protected OfContext ctx;\r
protected OfWriter ofWriter;\r
protected PolicyInfo policyInfo;\r
protected FlowTable table;\r
\r
- protected FlowBuilder flowBuilder(FlowId flowId, short tableId, Integer priority, Match match, Instructions instructions) {\r
+ protected FlowBuilder buildFlow(FlowId flowId, short tableId, Integer priority, Match match, Instructions instructions) {\r
FlowBuilder flowBuilder = FlowUtils.base(tableId);\r
flowBuilder.setId(flowId)\r
.setPriority(priority)\r
.setMatch(match)\r
.setInstructions(instructions);\r
-\r
return flowBuilder;\r
}\r
\r
- protected EndpointL3Builder endpointL3Builder(String ip, String insideIp, String mac, String l2, boolean ipv6) {\r
+ protected EndpointL3Builder buildL3Endpoint(Ipv4Address natIp, Ipv4Address ip, MacAddress mac, String l2bd) {\r
+ Preconditions.checkNotNull(natIp);\r
+ Preconditions.checkNotNull(ip);\r
+ Preconditions.checkNotNull(mac);\r
EndpointL3Builder endpointL3Builder = new EndpointL3Builder();\r
-\r
- // Set NAT address augmentation\r
- if (ip != null) {\r
- if (ipv6) {\r
- NatAddressBuilder natAddressBuilder = new NatAddressBuilder();\r
- natAddressBuilder.setNatAddress(new IpAddress(new Ipv6Address(ip)));\r
- endpointL3Builder.addAugmentation(NatAddress.class, natAddressBuilder.build());\r
- } else {\r
- NatAddressBuilder natAddressBuilder = new NatAddressBuilder();\r
- natAddressBuilder.setNatAddress(new IpAddress(new Ipv4Address(ip)));\r
- endpointL3Builder.addAugmentation(NatAddress.class, natAddressBuilder.build());\r
- }\r
- }\r
-\r
- // Set IP address\r
- if (insideIp != null) {\r
- if (ipv6) {\r
- endpointL3Builder.setIpAddress(new IpAddress(new Ipv6Address(insideIp)));\r
- } else {\r
- endpointL3Builder.setIpAddress(new IpAddress(new Ipv4Address(insideIp)));\r
- }\r
+ NatAddressBuilder natAddressBuilder = new NatAddressBuilder();\r
+ natAddressBuilder.setNatAddress(new IpAddress(new Ipv4Address(natIp)));\r
+ endpointL3Builder.addAugmentation(NatAddress.class, natAddressBuilder.build());\r
+ endpointL3Builder.setIpAddress(new IpAddress(ip));\r
+ endpointL3Builder.setMacAddress(new MacAddress(mac));\r
+ if (l2bd != null) {\r
+ endpointL3Builder.setL2Context(new L2BridgeDomainId(l2bd));\r
}\r
+ return endpointL3Builder;\r
+ }\r
\r
- // Set MAC\r
- if (mac != null) {\r
- endpointL3Builder.setMacAddress(new MacAddress(mac));\r
- }\r
+ protected EndpointL3Builder buildL3Endpoint(Ipv6Address natIp, Ipv6Address ip, MacAddress mac, String l2bd) {\r
+ Preconditions.checkNotNull(natIp);\r
+ Preconditions.checkNotNull(ip);\r
+ Preconditions.checkNotNull(mac);\r
+ EndpointL3Builder endpointL3Builder = new EndpointL3Builder();\r
+ NatAddressBuilder natAddressBuilder = new NatAddressBuilder();\r
+ natAddressBuilder.setNatAddress(new IpAddress(new Ipv6Address(natIp)));\r
+ endpointL3Builder.addAugmentation(NatAddress.class, natAddressBuilder.build());\r
+ endpointL3Builder.setIpAddress(new IpAddress(ip));\r
\r
- // Set L2 context\r
- if (l2 != null) {\r
- endpointL3Builder.setL2Context(new L2BridgeDomainId(l2));\r
+ endpointL3Builder.setMacAddress(new MacAddress(mac));\r
+ if (l2bd != null) {\r
+ endpointL3Builder.setL2Context(new L2BridgeDomainId(l2bd));\r
}\r
-\r
return endpointL3Builder;\r
+ }\r
\r
+ public SegmentationBuilder buildSegmentation() {\r
+ SegmentationBuilder segmentationBuilder = new SegmentationBuilder();\r
+ segmentationBuilder.setSegmentationId(1);\r
+ return segmentationBuilder;\r
}\r
\r
- protected IndexedTenant indexedTenantBuilder() {\r
+ protected TenantBuilder buildTenant() {\r
TenantBuilder tenantBuilder = new TenantBuilder();\r
- tenantBuilder.setId(new TenantId(TENANT_ID));\r
+ tenantBuilder.setId(TENANT_ID);\r
+ tenantBuilder.setForwardingContext(buildForwardingContext().build());\r
+ PolicyBuilder policyBuilder = new PolicyBuilder();\r
+ policyBuilder.setEndpointGroup(getEndpointGroups());\r
+ policyBuilder.setSubjectFeatureInstances(getSubjectFeatureInstances());\r
+ tenantBuilder.setPolicy(policyBuilder.build());\r
+ return tenantBuilder;\r
+ }\r
\r
- // Set forwarding context\r
- SegmentationBuilder segmentationBuilder = new SegmentationBuilder();\r
- segmentationBuilder.setSegmentationId(1);\r
- List<L2FloodDomain> l2FloodDomains = new ArrayList<>();\r
- L2FloodDomainBuilder l2FloodDomainBuilder = new L2FloodDomainBuilder();\r
- l2FloodDomainBuilder.setId(new L2FloodDomainId("l2id"));\r
- l2FloodDomainBuilder.addAugmentation(Segmentation.class, segmentationBuilder.build());\r
- l2FloodDomains.add(l2FloodDomainBuilder.build());\r
+ protected IndexedTenant getTestIndexedTenant() {\r
+ return new IndexedTenant(buildTenant().build());\r
+ }\r
+\r
+ protected ForwardingContextBuilder buildForwardingContext() {\r
ForwardingContextBuilder forwardingContextBuilder = new ForwardingContextBuilder();\r
- forwardingContextBuilder.setL2FloodDomain(l2FloodDomains);\r
- tenantBuilder.setForwardingContext(forwardingContextBuilder.build());\r
+ forwardingContextBuilder.setL2FloodDomain(getL2FloodDomainList(false));\r
+ forwardingContextBuilder.setL2BridgeDomain(getL2BridgeDomainList());\r
+ forwardingContextBuilder.setL3Context(getL3ContextList());\r
+ forwardingContextBuilder.setSubnet(getSubnetList());\r
+ return forwardingContextBuilder;\r
+ }\r
\r
- return new IndexedTenant(tenantBuilder.build());\r
+ protected List<L3Context> getL3ContextList() {\r
+ List<L3Context> l3Contexts = new ArrayList<>();\r
+ L3ContextBuilder l3ContextBuilder = new L3ContextBuilder();\r
+ l3ContextBuilder.setId(L3C_ID);\r
+ l3Contexts.add(l3ContextBuilder.build());\r
+ return l3Contexts;\r
}\r
\r
- protected List<L2FloodDomain> l2FloodDomains() {\r
- SegmentationBuilder segmentationBuilder = new SegmentationBuilder();\r
- segmentationBuilder.setSegmentationId(1);\r
+ protected List<L2BridgeDomain> getL2BridgeDomainList() {\r
+ List<L2BridgeDomain> l2BridgeDomains = new ArrayList<>();\r
+ L2BridgeDomainBuilder l2BridgeDomainBuilder = new L2BridgeDomainBuilder();\r
+ l2BridgeDomainBuilder.setId(L2BD_ID);\r
+ l2BridgeDomainBuilder.setParent(L3C_ID);\r
+ l2BridgeDomains.add(l2BridgeDomainBuilder.build());\r
+ return l2BridgeDomains;\r
+ }\r
+\r
+ protected List<L2FloodDomain> getL2FloodDomainList(boolean external) {\r
List<L2FloodDomain> l2FloodDomains = new ArrayList<>();\r
L2FloodDomainBuilder l2FloodDomainBuilder = new L2FloodDomainBuilder();\r
- l2FloodDomainBuilder.setId(new L2FloodDomainId("l2id"));\r
- l2FloodDomainBuilder.addAugmentation(Segmentation.class, segmentationBuilder.build());\r
+ l2FloodDomainBuilder.setId(L2FD_ID);\r
+ if (external) {\r
+ l2FloodDomainBuilder.setId(L2_FD_ID_EXT);\r
+ }\r
+ l2FloodDomainBuilder.setParent(new L2BridgeDomainId(L2BD_ID));\r
+ l2FloodDomainBuilder.addAugmentation(Segmentation.class, buildSegmentation().build());\r
l2FloodDomains.add(l2FloodDomainBuilder.build());\r
return l2FloodDomains;\r
}\r
\r
- protected EndpointBuilder endpointBuilder(IpAddress ip, MacAddress mac, NodeConnectorId connector,\r
- EndpointGroupId groupId, L2BridgeDomainId bridgeDomainId) {\r
- EndpointBuilder endpointBuilder = new EndpointBuilder();\r
-\r
- // Set tenant\r
- endpointBuilder.setTenant(new TenantId(TENANT_ID));\r
-\r
- // Set L3 address\r
- if (ip != null) {\r
- List<L3Address> l3Addresses = new ArrayList<>();\r
- L3AddressBuilder l3AddressBuilder = new L3AddressBuilder();\r
- l3AddressBuilder.setIpAddress(ip);\r
- l3Addresses.add(l3AddressBuilder.build());\r
- endpointBuilder.setL3Address(l3Addresses);\r
- }\r
+ protected List<L3Address> getL3AddressList(Ipv4Address l3IpAddress, L3ContextId l3ContextId) {\r
+ List<L3Address> l3Addresses = new ArrayList<>();\r
+ L3AddressBuilder l3AddressBuilder = new L3AddressBuilder();\r
+ l3AddressBuilder.setIpAddress(new IpAddress(l3IpAddress));\r
+ l3AddressBuilder.setL3Context(new L3ContextId(l3ContextId));\r
+ l3Addresses.add(l3AddressBuilder.build());\r
+ return l3Addresses;\r
+ }\r
\r
- // Set Mac address\r
- endpointBuilder.setMacAddress(new MacAddress(mac));\r
- endpointBuilder.setL2Context(bridgeDomainId);\r
- endpointBuilder.setEndpointGroup(groupId);\r
+ protected List<L3Address> getL3AddressList(Ipv6Address l3IpAddress) {\r
+ List<L3Address> l3Addresses = new ArrayList<>();\r
+ L3AddressBuilder l3AddressBuilder = new L3AddressBuilder();\r
+ l3AddressBuilder.setIpAddress(new IpAddress(l3IpAddress));\r
+ l3Addresses.add(l3AddressBuilder.build());\r
+ return l3Addresses;\r
+ }\r
\r
- // Augment node connector\r
+ protected OfOverlayContextBuilder getOfOverlayContext(NodeConnectorId connector) {\r
OfOverlayContextBuilder ofOverlayContextBuilder = new OfOverlayContextBuilder();\r
- ofOverlayContextBuilder.setNodeConnectorId(new NodeConnectorId(connector));\r
- ofOverlayContextBuilder.setNodeId(nodeId);\r
- endpointBuilder.addAugmentation(OfOverlayContext.class, ofOverlayContextBuilder.build());\r
+ ofOverlayContextBuilder.setNodeConnectorId(connector);\r
+ ofOverlayContextBuilder.setNodeId(NODE_ID);\r
+ return ofOverlayContextBuilder;\r
+ }\r
\r
- // Set network containment\r
- endpointBuilder.setNetworkContainment(new NetworkDomainId(DOMAIN_ID));\r
+ protected EndpointBuilder buildEndpoint(Ipv4Address l3IpAddress, MacAddress mac, NodeConnectorId connector) {\r
+ EndpointBuilder endpointBuilder = new EndpointBuilder();\r
+ endpointBuilder.setTenant(TENANT_ID);\r
+ endpointBuilder.setL3Address(getL3AddressList(l3IpAddress, L3C_ID));\r
+ endpointBuilder.setMacAddress(new MacAddress(mac));\r
+ endpointBuilder.setL2Context(new L2BridgeDomainId(L2BD_ID));\r
+ endpointBuilder.setEndpointGroup(ENDPOINT_GROUP_0);\r
+ endpointBuilder.addAugmentation(OfOverlayContext.class, getOfOverlayContext(connector).build());\r
+ endpointBuilder.setNetworkContainment(NET_DOMAIN_ID);\r
+ return endpointBuilder;\r
+ }\r
\r
+ protected EndpointBuilder buildEndpoint(Ipv6Address l3IpAddress, MacAddress mac, NodeConnectorId connector) {\r
+ EndpointBuilder endpointBuilder = new EndpointBuilder();\r
+ endpointBuilder.setTenant(TENANT_ID);\r
+ endpointBuilder.setL3Address(getL3AddressList(l3IpAddress));\r
+ endpointBuilder.setMacAddress(new MacAddress(mac));\r
+ endpointBuilder.setL2Context(new L2BridgeDomainId(L2BD_ID));\r
+ endpointBuilder.setEndpointGroup(ENDPOINT_GROUP_0);\r
+ endpointBuilder.addAugmentation(OfOverlayContext.class, getOfOverlayContext(connector).build());\r
+ endpointBuilder.setNetworkContainment(NET_DOMAIN_ID);\r
return endpointBuilder;\r
}\r
\r
- protected List<EndpointGroup> endpointGroups() {\r
+ public List<EndpointGroup> getEndpointGroups() {\r
return ImmutableList.of(\r
- new EndpointGroupBuilder().setId(eg)\r
- .setNetworkDomain(sub)\r
+ new EndpointGroupBuilder().setId(ENDPOINT_GROUP_0)\r
+ .setNetworkDomain(SUBNET_0)\r
.setConsumerNamedSelector(ImmutableList.of(new ConsumerNamedSelectorBuilder()\r
- .setName(new SelectorName("cns1")).setContract(ImmutableList.of(cid)).build()))\r
+ .setName(new SelectorName("cns1")).setContract(ImmutableList.of(CONTRACT_ID)).build()))\r
.build(),\r
- new EndpointGroupBuilder().setId(eg2)\r
- .setNetworkDomain(sub2)\r
+ new EndpointGroupBuilder().setId(ENDPOINT_GROUP_1)\r
+ .setNetworkDomain(SUBNET_1)\r
.setProviderNamedSelector(ImmutableList.of(new ProviderNamedSelectorBuilder()\r
- .setName(new SelectorName("pns1")).setContract(ImmutableList.of(cid)).build()))\r
+ .setName(new SelectorName("pns1")).setContract(ImmutableList.of(CONTRACT_ID)).build()))\r
.build());\r
}\r
\r
- private SubjectFeatureInstances subjectFeatureInstances() {\r
+ protected SubjectFeatureInstances getSubjectFeatureInstances() {\r
SubjectFeatureInstancesBuilder builder = new SubjectFeatureInstancesBuilder();\r
return builder.setClassifierInstance(ImmutableList.of(new ClassifierInstanceBuilder()\r
.setName(new ClassifierName("tcp_dst_80"))\r
.setClassifierDefinitionId(L4ClassifierDefinition.DEFINITION.getId())\r
.setParameterValue(ImmutableList.of(new ParameterValueBuilder().setName(new ParameterName("destport"))\r
- .setIntValue(80L)\r
+ .setIntValue(80L) // Endpoint\r
+\r
.build(), new ParameterValueBuilder().setName(new ParameterName("proto"))\r
.setIntValue(6L)\r
.build()))\r
- .build(), new ClassifierInstanceBuilder().setName(new ClassifierName("tcp_src_80"))\r
+ .build(), new ClassifierInstanceBuilder().setName(new ClassifierName(TCP_SRC))\r
.setClassifierDefinitionId(Classifier.L4_CL.getId())\r
.setParameterValue(ImmutableList.of(new ParameterValueBuilder().setName(new ParameterName("sourceport"))\r
.setIntValue(80L)\r
.build();\r
}\r
\r
- protected TenantBuilder baseTenantBuilder() {\r
- TenantBuilder tenantBuilder = new TenantBuilder();\r
- tenantBuilder.setId(tid)\r
- .setPolicy(new PolicyBuilder().setEndpointGroup(endpointGroups())\r
- .setSubjectFeatureInstances(subjectFeatureInstances())\r
- .build())\r
- .setForwardingContext(new ForwardingContextBuilder()\r
- .setL3Context(ImmutableList.of(new L3ContextBuilder().setId(l3c).build()))\r
- .setL2FloodDomain(l2FloodDomains())\r
- .setSubnet(subnet())\r
- .build());\r
- return tenantBuilder;\r
- }\r
-\r
- protected List<Subnet> subnet() {\r
+ protected List<Subnet> getSubnetList() {\r
return ImmutableList.of(\r
- new SubnetBuilder().setId(sub2)\r
- .setParent(fd)\r
+ new SubnetBuilder().setId(SUBNET_0)\r
+ .setParent(L2FD_ID)\r
.setIpPrefix(new IpPrefix(new Ipv4Prefix("10.0.1.0/24")))\r
.setVirtualRouterIp(new IpAddress(new Ipv4Address("10.0.1.1")))\r
.build(),\r
- new SubnetBuilder().setId(sub)\r
- .setParent(fd)\r
+ new SubnetBuilder().setId(SUBNET_1)\r
+ .setParent(L2FD_ID)\r
.setIpPrefix(new IpPrefix(new Ipv4Prefix("10.0.0.0/24")))\r
.setVirtualRouterIp(new IpAddress(new Ipv4Address("10.0.0.1")))\r
.build(),\r
- new SubnetBuilder().setId(sub3)\r
- .setParent(bd)\r
+ new SubnetBuilder().setId(SUBNET_2)\r
+ .setParent(L2BD_ID)\r
.setIpPrefix(new IpPrefix(new Ipv4Prefix("10.0.2.0/24")))\r
.setVirtualRouterIp(new IpAddress(new Ipv4Address("10.0.2.1")))\r
.build(),\r
- new SubnetBuilder()\r
- .setId(ext_sub)\r
+ new SubnetBuilder().setId(SUBNET_EXT)\r
+ .setParent(L2_FD_ID_EXT)\r
.setIpPrefix(new IpPrefix(new Ipv4Prefix("192.168.111.0/24")))\r
- .setParent(ext_fd)\r
.build());\r
}\r
}\r