2 * Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
9 package org.opendaylight.groupbasedpolicy.renderer.ofoverlay.flow;
11 import static org.junit.Assert.assertEquals;
12 import static org.junit.Assert.assertNotEquals;
13 import static org.mockito.Mockito.mock;
14 import static org.mockito.Mockito.when;
15 import static org.opendaylight.groupbasedpolicy.renderer.ofoverlay.flow.FlowUtils.applyActionIns;
16 import static org.opendaylight.groupbasedpolicy.renderer.ofoverlay.flow.FlowUtils.instructions;
17 import static org.opendaylight.groupbasedpolicy.renderer.ofoverlay.flow.FlowUtils.nxOutputRegAction;
19 import java.util.Arrays;
20 import java.util.Collections;
21 import java.util.HashMap;
22 import java.util.HashSet;
23 import java.util.List;
24 import java.util.Objects;
27 import org.junit.Assert;
28 import org.junit.Before;
29 import org.junit.Test;
30 import org.opendaylight.groupbasedpolicy.dto.ConditionGroup;
31 import org.opendaylight.groupbasedpolicy.dto.EgKey;
32 import org.opendaylight.groupbasedpolicy.dto.PolicyInfo;
33 import org.opendaylight.groupbasedpolicy.renderer.ofoverlay.OfWriter;
34 import org.opendaylight.groupbasedpolicy.renderer.ofoverlay.flow.FlowUtils.RegMatch;
35 import org.opendaylight.groupbasedpolicy.renderer.ofoverlay.flow.PolicyEnforcer.PolicyPair;
36 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.IpAddress;
37 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.IpPrefix;
38 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Address;
39 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.PortNumber;
40 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev100924.MacAddress;
41 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow;
42 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
43 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.common.rev140421.ActionName;
44 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.common.rev140421.ClauseName;
45 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.common.rev140421.ConditionMatcherName;
46 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.common.rev140421.ConditionName;
47 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.common.rev140421.SubjectName;
48 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.endpoint.rev140421.endpoints.Endpoint;
49 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.ofoverlay.rev140528.OfOverlayNodeConfigBuilder;
50 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.ofoverlay.rev140528.nodes.node.TunnelBuilder;
51 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.HasDirection.Direction;
52 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.Matcher.MatchType;
53 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.has.action.refs.ActionRefBuilder;
54 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.has.condition.matchers.ConditionMatcherBuilder;
55 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.has.conditions.Condition;
56 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.has.conditions.ConditionBuilder;
57 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.TenantBuilder;
58 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.Contract;
59 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.ContractBuilder;
60 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.contract.ClauseBuilder;
61 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.contract.Subject;
62 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.contract.clause.ConsumerMatchersBuilder;
63 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.contract.clause.ProviderMatchersBuilder;
64 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.contract.subject.Rule;
65 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.contract.subject.RuleBuilder;
66 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId;
67 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
68 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._4.match.TcpMatch;
69 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxReg0;
70 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxReg1;
71 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxReg2;
72 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxReg3;
73 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxReg7;
74 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general.rev140714.ExtensionKey;
75 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general.rev140714.GeneralAugMatchNodesNodeTableFlow;
76 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general.rev140714.general.extension.grouping.Extension;
77 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general.rev140714.general.extension.list.grouping.ExtensionList;
78 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxAugMatchNodesNodeTableFlow;
79 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxmNxReg0Key;
80 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxmNxReg2Key;
81 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.overlay.rev150105.TunnelTypeVxlan;
82 import org.slf4j.Logger;
83 import org.slf4j.LoggerFactory;
85 import com.google.common.collect.ImmutableList;
86 import com.google.common.collect.ImmutableMap;
88 public class PolicyEnforcerTest extends FlowTableTest {
90 protected static final Logger LOG = LoggerFactory.getLogger(PolicyEnforcerTest.class);
94 public void setup() throws Exception {
96 table = new PolicyEnforcer(ctx, ctx.getPolicyManager().getTABLEID_POLICY_ENFORCER());
99 switchManager.addSwitch(
102 Collections.<NodeConnectorId>emptySet(),
103 new OfOverlayNodeConfigBuilder().setTunnel(
104 ImmutableList.of(new TunnelBuilder().setIp(new IpAddress(new Ipv4Address("1.2.3.4")))
105 .setTunnelType(TunnelTypeVxlan.class)
106 .setNodeConnectorId(tunnelId)
111 public void testNoEps() throws Exception {
112 OfWriter fm = dosync(null);
113 assertEquals(2, fm.getTableForNode(nodeId, ctx.getPolicyManager().getTABLEID_POLICY_ENFORCER())
119 public void testSameEg() throws Exception {
120 Endpoint ep1 = localEP().build();
121 endpointManager.addEndpoint(ep1);
122 Endpoint ep2 = localEP().setMacAddress(new MacAddress("00:00:00:00:00:02")).build();
123 endpointManager.addEndpoint(ep2);
124 ctx.addTenant(baseTenant().setContract(ImmutableList.<Contract>of(baseContract(null).build()))
127 OfWriter fm = dosync(null);
128 assertNotEquals(0, fm.getTableForNode(nodeId, ctx.getPolicyManager().getTABLEID_POLICY_ENFORCER())
132 HashMap<String, Flow> flowMap = new HashMap<>();
133 for (Flow f : fm.getTableForNode(nodeId, ctx.getPolicyManager().getTABLEID_POLICY_ENFORCER()).getFlow()) {
134 flowMap.put(f.getId().getValue(), f);
135 if (isAllowSameEpg(f)) {
139 assertEquals(1, count);
140 assertEquals(3, fm.getTableForNode(nodeId, ctx.getPolicyManager().getTABLEID_POLICY_ENFORCER())
143 fm = dosync(flowMap);
144 assertEquals(3, fm.getTableForNode(nodeId, ctx.getPolicyManager().getTABLEID_POLICY_ENFORCER())
150 public void testDifferentEg() throws Exception {
151 assertEquals(7, doTestDifferentEg(ImmutableList.<Subject>of(baseSubject(null).build())));
152 assertEquals(7, doTestDifferentEg(ImmutableList.<Subject>of(baseSubject(Direction.Bidirectional).build())));
153 assertEquals(5, doTestDifferentEg(ImmutableList.<Subject>of(baseSubject(Direction.In).build())));
154 assertEquals(5, doTestDifferentEg(ImmutableList.<Subject>of(baseSubject(Direction.Out).build())));
158 public void doTestRule() throws Exception {
159 Rule rule1 = new RuleBuilder().setActionRef(
160 ImmutableList.of(new ActionRefBuilder().setName(new ActionName("allow")).build()))
162 createClassifierRefs(ImmutableMap.<String, Direction>of("tcp_dst_80", Direction.In, "tcp_src_80",
165 Rule rule2 = new RuleBuilder().setActionRef(
166 ImmutableList.of(new ActionRefBuilder().setName(new ActionName("allow")).build()))
168 createClassifierRefs(ImmutableMap.<String, Direction>of("tcp_dst_80", Direction.In, "tcp_src_80",
171 Rule rule3 = new RuleBuilder().setActionRef(
172 ImmutableList.of(new ActionRefBuilder().setName(new ActionName("allow")).build()))
174 createClassifierRefs(ImmutableMap.<String, Direction>of("tcp_dst_80", Direction.In, "tcp_src_80",
175 Direction.Out, "ether_type", Direction.In)))
177 Rule rule4 = new RuleBuilder().setActionRef(
178 ImmutableList.of(new ActionRefBuilder().setName(new ActionName("allow")).build()))
180 createClassifierRefs(ImmutableMap.<String, Direction>of("tcp_dst_80", Direction.In, "tcp_dst_90",
185 doTestDifferentEg(ImmutableList.<Subject>of(createSubject("s1", ImmutableList.<Rule>of(rule1)))));
187 doTestDifferentEg(ImmutableList.<Subject>of(createSubject("s2", ImmutableList.<Rule>of(rule2)))));
189 doTestDifferentEg(ImmutableList.<Subject>of(createSubject("s3", ImmutableList.<Rule>of(rule3)))));
191 doTestDifferentEg(ImmutableList.<Subject>of(createSubject("s4", ImmutableList.<Rule>of(rule4)))));
194 private int doTestDifferentEg(List<Subject> subjects) throws Exception {
195 Endpoint ep1 = localEP().build();
196 endpointManager.addEndpoint(ep1);
197 Endpoint ep2 = localEP().setMacAddress(new MacAddress("00:00:00:00:00:02")).setEndpointGroup(eg2).build();
198 endpointManager.addEndpoint(ep2);
199 ctx.addTenant(baseTenant().setContract(ImmutableList.<Contract>of(baseContract(subjects).build()))
202 OfWriter fm = dosync(null);
203 assertNotEquals(0, fm.getTableForNode(nodeId, ctx.getPolicyManager().getTABLEID_POLICY_ENFORCER())
207 HashMap<String, Flow> flowMap = new HashMap<>();
208 for (Flow f : fm.getTableForNode(nodeId, ctx.getPolicyManager().getTABLEID_POLICY_ENFORCER()).getFlow()) {
209 flowMap.put(f.getId().getValue(), f);
210 if (isAllowSameEpg(f)) {
212 } else if (f.getMatch() != null && Objects.equals(tunnelId, f.getMatch().getInPort())) {
213 assertEquals(instructions(applyActionIns(nxOutputRegAction(NxmNxReg7.class))), f.getInstructions());
215 } else if (f.getMatch() != null
216 && f.getMatch().getEthernetMatch() != null
217 && Objects.equals(FlowUtils.IPv4, f.getMatch()
222 && f.getMatch().getIpMatch() != null
223 && Objects.equals(Short.valueOf((short) 6), f.getMatch().getIpMatch().getIpProtocol())
224 && f.getMatch().getLayer4Match() != null
225 && (Objects.equals(new PortNumber(Integer.valueOf(80)),
226 ((TcpMatch) f.getMatch().getLayer4Match()).getTcpSourcePort()) || Objects.equals(
227 new PortNumber(Integer.valueOf(80)),
228 ((TcpMatch) f.getMatch().getLayer4Match()).getTcpDestinationPort()))) {
230 } else if (f.getMatch() != null
231 && f.getMatch().getEthernetMatch() != null
232 && Objects.equals(FlowUtils.IPv6, f.getMatch()
237 && f.getMatch().getIpMatch() != null
238 && Objects.equals(Short.valueOf((short) 6), f.getMatch().getIpMatch().getIpProtocol())
239 && f.getMatch().getLayer4Match() != null
240 && (Objects.equals(new PortNumber(Integer.valueOf(80)),
241 ((TcpMatch) f.getMatch().getLayer4Match()).getTcpSourcePort()) || Objects.equals(
242 new PortNumber(Integer.valueOf(80)),
243 ((TcpMatch) f.getMatch().getLayer4Match()).getTcpDestinationPort()))) {
251 public void testConditions() throws Exception {
252 Condition cond1 = new ConditionBuilder().setName(new ConditionName("cond1")).build();
253 Condition cond2 = new ConditionBuilder().setName(new ConditionName("cond2")).build();
255 Endpoint ep1 = localEP().setCondition(ImmutableList.of(cond1.getName())).build();
256 endpointManager.addEndpoint(ep1);
257 Endpoint ep2 = localEP().setMacAddress(new MacAddress("00:00:00:00:00:02"))
258 .setCondition(ImmutableList.of(cond1.getName(), cond2.getName()))
259 .setEndpointGroup(eg2)
261 endpointManager.addEndpoint(ep2);
263 TenantBuilder tb = baseTenant().setContract(
264 ImmutableList.of(new ContractBuilder().setId(cid)
265 .setSubject(ImmutableList.of(baseSubject(Direction.Out).build()))
267 ImmutableList.of(new ClauseBuilder().setName(new ClauseName("test"))
268 .setSubjectRefs(ImmutableList.of(new SubjectName("s1")))
269 .setConsumerMatchers(
270 new ConsumerMatchersBuilder().setConditionMatcher(
271 ImmutableList.of(new ConditionMatcherBuilder().setName(
272 new ConditionMatcherName("m1"))
273 .setCondition(ImmutableList.of(cond1, cond2))
274 .setMatchType(MatchType.Any)
276 .setProviderMatchers(
277 new ProviderMatchersBuilder().setConditionMatcher(
278 ImmutableList.of(new ConditionMatcherBuilder().setName(
279 new ConditionMatcherName("m2"))
280 .setCondition(ImmutableList.of(cond1, cond2))
281 .setMatchType(MatchType.All)
285 ctx.addTenant(tb.build());
287 PolicyInfo policy = ctx.getCurrentPolicy();
288 List<ConditionName> ep1c = endpointManager.getConditionsForEndpoint(ep1);
289 ConditionGroup cg1 = policy.getEgCondGroup(new EgKey(tb.getId(), ep1.getEndpointGroup()), ep1c);
290 List<ConditionName> ep2c = endpointManager.getConditionsForEndpoint(ep2);
291 ConditionGroup cg2 = policy.getEgCondGroup(new EgKey(tb.getId(), ep2.getEndpointGroup()), ep2c);
292 int cg1Id = OrdinalFactory.getCondGroupOrdinal(cg1);
293 int cg2Id = OrdinalFactory.getCondGroupOrdinal(cg2);
294 int eg1Id = OrdinalFactory.getContextOrdinal(ep1.getTenant(), ep1.getEndpointGroup());
295 int eg2Id = OrdinalFactory.getContextOrdinal(ep1.getTenant(), ep2.getEndpointGroup());
297 assertNotEquals(cg1Id, cg2Id);
299 MatchBuilder mb = new MatchBuilder();
300 FlowUtils.addNxRegMatch(mb, RegMatch.of(NxmNxReg0.class, Long.valueOf(eg1Id)),
301 RegMatch.of(NxmNxReg1.class, Long.valueOf(cg1Id)), RegMatch.of(NxmNxReg2.class, Long.valueOf(eg2Id)),
302 RegMatch.of(NxmNxReg3.class, Long.valueOf(cg2Id)));
304 OfWriter fm = dosync(null);
305 assertEquals(7, fm.getTableForNode(nodeId, ctx.getPolicyManager().getTABLEID_POLICY_ENFORCER())
308 HashMap<String, Flow> flowMap = new HashMap<>();
309 for (Flow f : fm.getTableForNode(nodeId, ctx.getPolicyManager().getTABLEID_POLICY_ENFORCER()).getFlow()) {
310 flowMap.put(f.getId().getValue(), f);
311 if (f.getMatch() != null && f.getMatch().getEthernetMatch() != null) {
315 assertEquals(3, count);
316 fm = dosync(flowMap);
317 int numberOfFlows = fm.getTableForNode(nodeId, ctx.getPolicyManager().getTABLEID_POLICY_ENFORCER())
320 fm = dosync(flowMap);
321 assertEquals(numberOfFlows, fm.getTableForNode(nodeId, ctx.getPolicyManager().getTABLEID_POLICY_ENFORCER())
326 private boolean isAllowSameEpg(Flow flow) {
327 // flow has to have exactly 2 registers set, namely NxmNxReg0 and NxmNxReg2
328 // (these register values don't have to be equal)
330 if (flow != null && flow.getMatch() != null) {
331 GeneralAugMatchNodesNodeTableFlow genAug = flow.getMatch().getAugmentation(
332 GeneralAugMatchNodesNodeTableFlow.class);
333 if (genAug != null) {
334 List<ExtensionList> extensions = genAug.getExtensionList();
335 if (extensions != null && extensions.size() == 2) {
338 for (ExtensionList extensionList : extensions) {
339 Class<? extends ExtensionKey> extensionKey = extensionList.getExtensionKey();
340 Extension extension = extensionList.getExtension();
341 if (extensionKey != null && extension != null) {
342 NxAugMatchNodesNodeTableFlow nxAugMatch = extension.getAugmentation(NxAugMatchNodesNodeTableFlow.class);
343 if (nxAugMatch != null && nxAugMatch.getNxmNxReg() != null) {
344 if (extensionKey.equals(NxmNxReg0Key.class)) {
345 reg0 = nxAugMatch.getNxmNxReg().getValue();
346 } else if (extensionKey.equals(NxmNxReg2Key.class)) {
347 reg2 = nxAugMatch.getNxmNxReg().getValue();
352 if (reg0 != null && reg2 != null) {
361 PolicyPair policyPair;
364 int consumerCondGrpId;
365 int providerCondGrpId;
366 Set<IpPrefix> consumerEicIpPrefixes;
367 Set<IpPrefix> providerEicIpPrefixes;
368 IpPrefix consumerEicIp;
369 IpPrefix providerEicIp;
370 NodeId consumerEpNodeId;
371 NodeId providerEpNodeId;
374 public void PolicyPairInitialisation() {
377 consumerCondGrpId = 5;
378 providerCondGrpId = 8;
379 consumerEicIp = mock(IpPrefix.class);
380 providerEicIp = mock(IpPrefix.class);
381 consumerEicIpPrefixes = new HashSet<IpPrefix>(Arrays.asList(consumerEicIp));
382 providerEicIpPrefixes = new HashSet<IpPrefix>(Arrays.asList(providerEicIp));
383 consumerEpNodeId = mock(NodeId.class);
384 when(consumerEpNodeId.getValue()).thenReturn("consumerValue");
385 providerEpNodeId = mock(NodeId.class);
386 when(providerEpNodeId.getValue()).thenReturn("providerValue");
390 public void PolicyPairConstructorTest() {
391 policyPair = new PolicyPair(consumerEpgId, providerEpgId, consumerCondGrpId, providerCondGrpId,
392 consumerEicIpPrefixes, providerEicIpPrefixes, consumerEpNodeId, providerEpNodeId);
393 Assert.assertEquals(consumerEpgId, policyPair.getConsumerEpgId());
394 Assert.assertEquals(providerEpgId, policyPair.getProviderEpgId());
395 Assert.assertEquals(consumerEpNodeId, policyPair.getConsumerEpNodeId());
396 Assert.assertEquals(providerEpNodeId, policyPair.getProviderEpNodeId());
397 Assert.assertNotNull(policyPair.toString());
401 public void PolicyPairEqualsTest() {
402 policyPair = new PolicyPair(0, 0, 0, 0, null, null, null, null);
404 other = new PolicyPair(0, 0, 0, 0, null, null, null, null);
405 Assert.assertTrue(policyPair.equals(other));
407 policyPair = new PolicyPair(consumerEpgId, providerEpgId, consumerCondGrpId, providerCondGrpId,
408 consumerEicIpPrefixes, providerEicIpPrefixes, consumerEpNodeId, providerEpNodeId);
409 Assert.assertTrue(policyPair.equals(policyPair));
410 Assert.assertFalse(policyPair.equals(null));
411 Assert.assertFalse(policyPair.equals(new Object()));
413 Assert.assertFalse(other.equals(policyPair));
414 Assert.assertFalse(policyPair.equals(other));
416 other = new PolicyPair(0, 0, 0, 0, null, providerEicIpPrefixes, null, null);
417 Assert.assertFalse(other.equals(policyPair));
418 Assert.assertFalse(policyPair.equals(other));
420 other = new PolicyPair(0, 0, 0, 0, consumerEicIpPrefixes, providerEicIpPrefixes, null, null);
421 Assert.assertFalse(other.equals(policyPair));
423 other = new PolicyPair(0, 0, 0, 0, consumerEicIpPrefixes, providerEicIpPrefixes, providerEpNodeId, null);
424 Assert.assertFalse(policyPair.equals(other));
426 other = new PolicyPair(0, 0, 0, 0, consumerEicIpPrefixes, providerEicIpPrefixes, consumerEpNodeId, null);
427 Assert.assertFalse(other.equals(policyPair));
429 other = new PolicyPair(0, 0, 0, 0, consumerEicIpPrefixes, providerEicIpPrefixes, consumerEpNodeId,
431 Assert.assertFalse(policyPair.equals(other));
433 other = new PolicyPair(0, 0, 0, 0, consumerEicIpPrefixes, providerEicIpPrefixes, consumerEpNodeId,
435 Assert.assertFalse(other.equals(policyPair));
436 Assert.assertFalse(policyPair.equals(other));
438 other = new PolicyPair(0, 0, 0, 8, consumerEicIpPrefixes, providerEicIpPrefixes, consumerEpNodeId,
440 Assert.assertFalse(other.equals(policyPair));
441 Assert.assertFalse(policyPair.equals(other));
443 other = new PolicyPair(0, 8, 0, 8, consumerEicIpPrefixes, providerEicIpPrefixes, consumerEpNodeId,
445 Assert.assertFalse(other.equals(policyPair));
446 Assert.assertFalse(policyPair.equals(other));
448 other = new PolicyPair(0, 8, 5, 8, consumerEicIpPrefixes, providerEicIpPrefixes, consumerEpNodeId,
450 Assert.assertFalse(other.equals(policyPair));
451 Assert.assertFalse(policyPair.equals(other));
453 other = new PolicyPair(5, 8, 5, 8, consumerEicIpPrefixes, providerEicIpPrefixes, consumerEpNodeId,
455 Assert.assertTrue(policyPair.equals(other));