Bumps support branch to onos 1.13.10
Additionally updates sadis apis to 3.1.1-SNAPSHOT
Change-Id: If571458efb8a66ec972106dad34418b23d772fe9
diff --git a/app/src/test/java/org/opencord/aaa/impl/AaaStatisticsTest.java b/app/src/test/java/org/opencord/aaa/impl/AaaStatisticsTest.java
index cdf0ede..a146491 100644
--- a/app/src/test/java/org/opencord/aaa/impl/AaaStatisticsTest.java
+++ b/app/src/test/java/org/opencord/aaa/impl/AaaStatisticsTest.java
@@ -832,21 +832,33 @@
}
/*
- * Mock implementation of SocketBasedRadiusCommunicator class.
- *
- */
+ * Mock implementation of SocketBasedRadiusCommunicator class.
+ *
+ */
class TestSocketBasedRadiusCommunicator extends SocketBasedRadiusCommunicator {
- TestSocketBasedRadiusCommunicator(ApplicationId appId, PacketService pktService, AaaManager aaaManager) {
- super(appId, pktService, aaaManager);
- }
+ TestSocketBasedRadiusCommunicator(ApplicationId appId, PacketService pktService, AaaManager aaaManager) {
+ super(appId, pktService, aaaManager);
+ }
+
+ /**
+ * Wait 10 millis to simulate a non 0 rtt.
+ *
+ * @throws InterruptedException
+ */
+ private void waitPacket() throws InterruptedException {
+ synchronized (this) {
+ this.wait(10);
+ }
+ }
// Implementation of socketBasedRadiusCommunicator--> run() method
public void handlePacketFromServer(PacketContext context) {
-
- RADIUS incomingPkt = (RADIUS) fetchPacket(savedPackets.size() - 1);
- try {
- if (context == null) {
+ RADIUS incomingPkt = (RADIUS) fetchPacket(savedPackets.size() - 1);
+ try {
+ // wait a couple of millis to avoid rtt being 0
+ waitPacket();
+ if (context == null) {
aaaStatisticsManager.handleRoundtripTime(incomingPkt.getIdentifier());
aaaManager.handleRadiusPacket(incomingPkt);
} else if (null != context) {
@@ -856,14 +868,15 @@
incomingPkt =
RADIUS.deserializer().deserialize(incomingPkt.generateAuthCode(), 0, 1);
}
- } catch (DeserializationException dex) {
- aaaManager.aaaStatisticsManager.getAaaStats().increaseMalformedResponsesRx();
- aaaStatisticsManager.getAaaStats().countDroppedResponsesRx();
- log.error("Cannot deserialize packet", dex);
- } catch (StateMachineException sme) {
- log.error("Illegal state machine operation", sme);
- }
-
+ } catch (DeserializationException dex) {
+ aaaManager.aaaStatisticsManager.getAaaStats().increaseMalformedResponsesRx();
+ aaaStatisticsManager.getAaaStats().countDroppedResponsesRx();
+ log.error("Cannot deserialize packet", dex);
+ } catch (StateMachineException sme) {
+ log.error("Illegal state machine operation", sme);
+ } catch (InterruptedException inte) {
+ Thread.currentThread().interrupt();
+ }
}
}
diff --git a/app/src/test/java/org/opencord/aaa/impl/AaaTestBase.java b/app/src/test/java/org/opencord/aaa/impl/AaaTestBase.java
index 98bce71..1d19578 100644
--- a/app/src/test/java/org/opencord/aaa/impl/AaaTestBase.java
+++ b/app/src/test/java/org/opencord/aaa/impl/AaaTestBase.java
@@ -15,6 +15,7 @@
*/
package org.opencord.aaa.impl;
+import com.google.common.collect.Lists;
import org.onlab.packet.BasePacket;
import org.onlab.packet.EAP;
import org.onlab.packet.EAPOL;
@@ -43,6 +44,7 @@
import org.opencord.sadis.BaseInformationService;
import org.opencord.sadis.SadisService;
import org.opencord.sadis.SubscriberAndDeviceInformation;
+import org.opencord.sadis.UniTagInformation;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
@@ -215,17 +217,29 @@
private class MockSubscriberAndDeviceInformation extends SubscriberAndDeviceInformation {
- MockSubscriberAndDeviceInformation(String id, VlanId ctag,
- VlanId stag, String nasPortId,
- String circuitId, MacAddress hardId,
+ MockSubscriberAndDeviceInformation(String id, VlanId uniTagMatch, VlanId ctag,
+ VlanId stag, int dsPonPrio, int upPonPrio,
+ int techProfileId, String dsBpId, String usBpId,
+ String nasPortId, String circuitId, MacAddress hardId,
Ip4Address ipAddress) {
- this.setCTag(ctag);
+ // Builds UniTagInformation
+ UniTagInformation.Builder tagInfoBuilder = new UniTagInformation.Builder();
+ UniTagInformation uniTagInfo = tagInfoBuilder.setUniTagMatch(uniTagMatch)
+ .setPonCTag(ctag)
+ .setPonSTag(stag)
+ .setDsPonCTagPriority(dsPonPrio)
+ .setUsPonSTagPriority(upPonPrio)
+ .setTechnologyProfileId(techProfileId)
+ .setDownstreamBandwidthProfile(dsBpId)
+ .setUpstreamBandwidthProfile(usBpId)
+ .build();
+
this.setHardwareIdentifier(hardId);
this.setId(id);
this.setIPAddress(ipAddress);
- this.setSTag(stag);
this.setNasPortId(nasPortId);
this.setCircuitId(circuitId);
+ this.setUniTagList(Lists.newArrayList(uniTagInfo));
}
}
@@ -292,14 +306,24 @@
}
final class MockSubService implements BaseInformationService<SubscriberAndDeviceInformation> {
+ private final VlanId uniTagMatch = VlanId.vlanId((short) 35);
private final VlanId clientCtag = VlanId.vlanId((short) 999);
private final VlanId clientStag = VlanId.vlanId((short) 111);
+ private final int dsPrio = 0;
+ private final int usPrio = 0;
+ private final int techProfileId = 64;
+ private final String usBpId = "HSIA-US";
+ private final String dsBpId = "HSIA-DS";
private final String clientNasPortId = "PON 1/1";
private final String clientCircuitId = "CIR-PON 1/1";
+
MockSubscriberAndDeviceInformation sub =
- new MockSubscriberAndDeviceInformation(clientNasPortId, clientCtag,
- clientStag, clientNasPortId, clientCircuitId, null, null);
+ new MockSubscriberAndDeviceInformation(clientNasPortId, uniTagMatch, clientCtag,
+ clientStag, dsPrio, usPrio,
+ techProfileId, dsBpId, usBpId,
+ clientNasPortId, clientCircuitId, null,
+ null);
@Override
public SubscriberAndDeviceInformation get(String id) {