olt testing
Change-Id: I169f2225b1df7b7de0ac7d977b6b6b4c63827c56
diff --git a/apps/cordfabric/src/main/java/org/onosproject/cordfabric/CordFabricManager.java b/apps/cordfabric/src/main/java/org/onosproject/cordfabric/CordFabricManager.java
index c8af1c1..c5395e8 100644
--- a/apps/cordfabric/src/main/java/org/onosproject/cordfabric/CordFabricManager.java
+++ b/apps/cordfabric/src/main/java/org/onosproject/cordfabric/CordFabricManager.java
@@ -81,6 +81,7 @@
private InternalDeviceListener deviceListener = new InternalDeviceListener();
private static final int PRIORITY = 50000;
+ private static final int TESTPRIO = 49999;
private short radiusPort = 1812;
@@ -90,6 +91,10 @@
private final Multimap<VlanId, ConnectPoint> vlans = HashMultimap.create();
+ //TODO make this configurable
+ private boolean testMode = true;
+
+
@Activate
public void activate() {
appId = coreService.registerApplication("org.onosproject.cordfabric");
@@ -169,6 +174,22 @@
.setOutput(PortNumber.portNumber(5))
.build();
+ TrafficTreatment testPort = DefaultTrafficTreatment.builder()
+ .setOutput(PortNumber.portNumber(8))
+ .build();
+
+ ForwardingObjective ofTestPath = DefaultForwardingObjective.builder()
+ .fromApp(appId)
+ .makePermanent()
+ .withFlag(ForwardingObjective.Flag.VERSATILE)
+ .withPriority(TESTPRIO)
+ .withSelector(
+ DefaultTrafficSelector.builder()
+ .matchInPort(PortNumber.portNumber(2))
+ .build())
+ .withTreatment(testPort)
+ .add();
+
ForwardingObjective radiusToServer = DefaultForwardingObjective.builder()
.fromApp(appId)
.makePermanent()
@@ -225,6 +246,9 @@
.withTreatment(toOlt)
.add();
+ if (testMode) {
+ flowObjectiveService.forward(fabricDeviceId, ofTestPath);
+ }
flowObjectiveService.forward(fabricDeviceId, upCtrl);
flowObjectiveService.forward(fabricDeviceId, downCtrl);