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.renderer.ofoverlay.OfWriter;
31 import org.opendaylight.groupbasedpolicy.renderer.ofoverlay.flow.FlowUtils.RegMatch;
32 import org.opendaylight.groupbasedpolicy.renderer.ofoverlay.flow.PolicyEnforcer.PolicyPair;
33 import org.opendaylight.groupbasedpolicy.resolver.ConditionGroup;
34 import org.opendaylight.groupbasedpolicy.resolver.EgKey;
35 import org.opendaylight.groupbasedpolicy.resolver.PolicyInfo;
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 policyResolver.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 policyResolver.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 policyResolver.addTenant(tb.build());
287 PolicyInfo policy = policyResolver.getCurrentPolicy();
288 List<ConditionName> ep1c = endpointManager.getCondsForEndpoint(ep1);
289 ConditionGroup cg1 = policy.getEgCondGroup(new EgKey(tb.getId(), ep1.getEndpointGroup()), ep1c);
290 List<ConditionName> ep2c = endpointManager.getCondsForEndpoint(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)));
303 GeneralAugMatchNodesNodeTableFlow m1 = mb.getAugmentation(GeneralAugMatchNodesNodeTableFlow.class);
304 FlowUtils.addNxRegMatch(mb, RegMatch.of(NxmNxReg0.class, Long.valueOf(eg2Id)),
305 RegMatch.of(NxmNxReg1.class, Long.valueOf(cg2Id)), RegMatch.of(NxmNxReg2.class, Long.valueOf(eg1Id)),
306 RegMatch.of(NxmNxReg3.class, Long.valueOf(cg1Id)));
307 GeneralAugMatchNodesNodeTableFlow m2 = mb.getAugmentation(GeneralAugMatchNodesNodeTableFlow.class);
309 OfWriter fm = dosync(null);
310 assertEquals(7, fm.getTableForNode(nodeId, ctx.getPolicyManager().getTABLEID_POLICY_ENFORCER())
313 HashMap<String, Flow> flowMap = new HashMap<>();
314 for (Flow f : fm.getTableForNode(nodeId, ctx.getPolicyManager().getTABLEID_POLICY_ENFORCER()).getFlow()) {
315 flowMap.put(f.getId().getValue(), f);
316 if (f.getMatch() != null && f.getMatch().getEthernetMatch() != null) {
320 assertEquals(3, count);
321 fm = dosync(flowMap);
322 int numberOfFlows = fm.getTableForNode(nodeId, ctx.getPolicyManager().getTABLEID_POLICY_ENFORCER())
325 fm = dosync(flowMap);
326 assertEquals(numberOfFlows, fm.getTableForNode(nodeId, ctx.getPolicyManager().getTABLEID_POLICY_ENFORCER())
331 private boolean isAllowSameEpg(Flow flow) {
332 // flow has to have exactly 2 registers set, namely NxmNxReg0 and NxmNxReg2
333 // (these register values don't have to be equal)
335 if (flow != null && flow.getMatch() != null) {
336 GeneralAugMatchNodesNodeTableFlow genAug = flow.getMatch().getAugmentation(
337 GeneralAugMatchNodesNodeTableFlow.class);
338 if (genAug != null) {
339 List<ExtensionList> extensions = genAug.getExtensionList();
340 if (extensions != null && extensions.size() == 2) {
343 for (ExtensionList extensionList : extensions) {
344 Class<? extends ExtensionKey> extensionKey = extensionList.getExtensionKey();
345 Extension extension = extensionList.getExtension();
346 if (extensionKey != null && extension != null) {
347 NxAugMatchNodesNodeTableFlow nxAugMatch = extension.getAugmentation(NxAugMatchNodesNodeTableFlow.class);
348 if (nxAugMatch != null && nxAugMatch.getNxmNxReg() != null) {
349 if (extensionKey.equals(NxmNxReg0Key.class)) {
350 reg0 = nxAugMatch.getNxmNxReg().getValue();
351 } else if (extensionKey.equals(NxmNxReg2Key.class)) {
352 reg2 = nxAugMatch.getNxmNxReg().getValue();
357 if (reg0 != null && reg2 != null) {
366 PolicyPair policyPair;
369 int consumerCondGrpId;
370 int providerCondGrpId;
371 Set<IpPrefix> consumerEicIpPrefixes;
372 Set<IpPrefix> providerEicIpPrefixes;
373 IpPrefix consumerEicIp;
374 IpPrefix providerEicIp;
375 NodeId consumerEpNodeId;
376 NodeId providerEpNodeId;
379 public void PolicyPairInitialisation() {
382 consumerCondGrpId = 5;
383 providerCondGrpId = 8;
384 consumerEicIp = mock(IpPrefix.class);
385 providerEicIp = mock(IpPrefix.class);
386 consumerEicIpPrefixes = new HashSet<IpPrefix>(Arrays.asList(consumerEicIp));
387 providerEicIpPrefixes = new HashSet<IpPrefix>(Arrays.asList(providerEicIp));
388 consumerEpNodeId = mock(NodeId.class);
389 when(consumerEpNodeId.getValue()).thenReturn("consumerValue");
390 providerEpNodeId = mock(NodeId.class);
391 when(providerEpNodeId.getValue()).thenReturn("providerValue");
395 public void PolicyPairConstructorTest() {
396 policyPair = new PolicyPair(consumerEpgId, providerEpgId, consumerCondGrpId, providerCondGrpId,
397 consumerEicIpPrefixes, providerEicIpPrefixes, consumerEpNodeId, providerEpNodeId);
398 Assert.assertEquals(consumerEpgId, policyPair.getConsumerEpgId());
399 Assert.assertEquals(providerEpgId, policyPair.getProviderEpgId());
400 Assert.assertEquals(consumerEpNodeId, policyPair.getConsumerEpNodeId());
401 Assert.assertEquals(providerEpNodeId, policyPair.getProviderEpNodeId());
402 Assert.assertNotNull(policyPair.toString());
406 public void PolicyPairEqualsTest() {
407 policyPair = new PolicyPair(0, 0, 0, 0, null, null, null, null);
409 other = new PolicyPair(0, 0, 0, 0, null, null, null, null);
410 Assert.assertTrue(policyPair.equals(other));
412 policyPair = new PolicyPair(consumerEpgId, providerEpgId, consumerCondGrpId, providerCondGrpId,
413 consumerEicIpPrefixes, providerEicIpPrefixes, consumerEpNodeId, providerEpNodeId);
414 Assert.assertTrue(policyPair.equals(policyPair));
415 Assert.assertFalse(policyPair.equals(null));
416 Assert.assertFalse(policyPair.equals(new Object()));
418 Assert.assertFalse(other.equals(policyPair));
419 Assert.assertFalse(policyPair.equals(other));
421 other = new PolicyPair(0, 0, 0, 0, null, providerEicIpPrefixes, null, null);
422 Assert.assertFalse(other.equals(policyPair));
423 Assert.assertFalse(policyPair.equals(other));
425 other = new PolicyPair(0, 0, 0, 0, consumerEicIpPrefixes, providerEicIpPrefixes, null, null);
426 Assert.assertFalse(other.equals(policyPair));
428 other = new PolicyPair(0, 0, 0, 0, consumerEicIpPrefixes, providerEicIpPrefixes, providerEpNodeId, null);
429 Assert.assertFalse(policyPair.equals(other));
431 other = new PolicyPair(0, 0, 0, 0, consumerEicIpPrefixes, providerEicIpPrefixes, consumerEpNodeId, null);
432 Assert.assertFalse(other.equals(policyPair));
434 other = new PolicyPair(0, 0, 0, 0, consumerEicIpPrefixes, providerEicIpPrefixes, consumerEpNodeId,
436 Assert.assertFalse(policyPair.equals(other));
438 other = new PolicyPair(0, 0, 0, 0, consumerEicIpPrefixes, providerEicIpPrefixes, consumerEpNodeId,
440 Assert.assertFalse(other.equals(policyPair));
441 Assert.assertFalse(policyPair.equals(other));
443 other = new PolicyPair(0, 0, 0, 8, consumerEicIpPrefixes, providerEicIpPrefixes, consumerEpNodeId,
445 Assert.assertFalse(other.equals(policyPair));
446 Assert.assertFalse(policyPair.equals(other));
448 other = new PolicyPair(0, 8, 0, 8, consumerEicIpPrefixes, providerEicIpPrefixes, consumerEpNodeId,
450 Assert.assertFalse(other.equals(policyPair));
451 Assert.assertFalse(policyPair.equals(other));
453 other = new PolicyPair(0, 8, 5, 8, consumerEicIpPrefixes, providerEicIpPrefixes, consumerEpNodeId,
455 Assert.assertFalse(other.equals(policyPair));
456 Assert.assertFalse(policyPair.equals(other));
458 other = new PolicyPair(5, 8, 5, 8, consumerEicIpPrefixes, providerEicIpPrefixes, consumerEpNodeId,
460 Assert.assertTrue(policyPair.equals(other));