[VOL-3816] Support PPPoED trap rules installation on Olt app.
Signed-off-by: Gustavo Silva <gsilva@furukawalatam.com>
Change-Id: I71868eddbeecc688095e7966b76f42fb158095ed
diff --git a/app/src/test/java/org/opencord/olt/impl/OltFlowTest.java b/app/src/test/java/org/opencord/olt/impl/OltFlowTest.java
index 033945e..3283886 100644
--- a/app/src/test/java/org/opencord/olt/impl/OltFlowTest.java
+++ b/app/src/test/java/org/opencord/olt/impl/OltFlowTest.java
@@ -182,6 +182,42 @@
}
@Test
+ public void testPppoedFiltering() {
+ oltFlowService.flowObjectiveService.clearQueue();
+
+ // ensure pppoed traps are not added if global config is off.
+ oltFlowService.enablePppoe = false;
+ oltFlowService.processPPPoEDFilteringObjectives(DEVICE_ID_1, uniPortNumber,
+ usMeterId, uniTagInfo,
+ true, true);
+ assert oltFlowService.flowObjectiveService.getPendingFlowObjectives().size() == 0;
+
+ // ensure upstream pppoed traps can be added and removed
+ oltFlowService.enablePppoe = true;
+ oltFlowService.processPPPoEDFilteringObjectives(DEVICE_ID_1, uniPortNumber,
+ usMeterId, uniTagInfo,
+ true, true);
+ assert oltFlowService.flowObjectiveService.getPendingFlowObjectives().size() == 1;
+ oltFlowService.processPPPoEDFilteringObjectives(DEVICE_ID_1, uniPortNumber,
+ usMeterId, uniTagInfo,
+ false, true);
+ assert oltFlowService.flowObjectiveService.getPendingFlowObjectives().size() == 2;
+
+ // ensure downstream pppoed traps can be added and removed
+ oltFlowService.processPPPoEDFilteringObjectives(DEVICE_ID_1, nniPortNumber,
+ null, null,
+ true, false);
+ assert oltFlowService.flowObjectiveService.getPendingFlowObjectives().size() == 3;
+ oltFlowService.processPPPoEDFilteringObjectives(DEVICE_ID_1, nniPortNumber,
+ null, null,
+ false, false);
+ assert oltFlowService.flowObjectiveService.getPendingFlowObjectives().size() == 4;
+
+ // cleanup
+ oltFlowService.flowObjectiveService.clearQueue();
+ }
+
+ @Test
public void testIgmpFiltering() {
oltFlowService.flowObjectiveService.clearQueue();
diff --git a/app/src/test/java/org/opencord/olt/impl/TestBase.java b/app/src/test/java/org/opencord/olt/impl/TestBase.java
index bc5a4d6..4d7bcd5 100644
--- a/app/src/test/java/org/opencord/olt/impl/TestBase.java
+++ b/app/src/test/java/org/opencord/olt/impl/TestBase.java
@@ -81,7 +81,6 @@
}
private class MockBpService implements BaseInformationService<BandwidthProfileInformation> {
-
@Override
public void invalidateAll() {