Cleaning up unused code in Microsemi driver
Change-Id: If7e9790d9141324dff084e41d040ba0132141de8
diff --git a/drivers/microsemi/src/main/java/org/onosproject/drivers/microsemi/Ea1000DeviceDescription.java b/drivers/microsemi/src/main/java/org/onosproject/drivers/microsemi/Ea1000DeviceDescription.java
index 43c76f1..34274e2 100644
--- a/drivers/microsemi/src/main/java/org/onosproject/drivers/microsemi/Ea1000DeviceDescription.java
+++ b/drivers/microsemi/src/main/java/org/onosproject/drivers/microsemi/Ea1000DeviceDescription.java
@@ -83,16 +83,21 @@
IetfSystem system = ietfSystemService.getIetfSystemInit(session);
if (system != null && system.systemState() != null) {
swVersion = system.systemState().platform().osRelease();
- AugmentedSysPlatform augmentedSysPlatform =
+ AugmentedSysPlatform augmentedSysStatePlatform =
(AugmentedSysPlatform) system.systemState()
.platform().augmentation(DefaultAugmentedSysPlatform.class);
- serialNumber = augmentedSysPlatform.deviceIdentification().serialNumber();
+ if (augmentedSysStatePlatform != null && augmentedSysStatePlatform.deviceIdentification() != null) {
+ serialNumber = augmentedSysStatePlatform.deviceIdentification().serialNumber();
+ } else {
+ log.warn("Serial Number of device not available: {}", handler().data().deviceId());
+ }
DateAndTime deviceDateAndTime = system.systemState().clock().currentDatetime();
OffsetDateTime odt =
OffsetDateTime.parse(deviceDateAndTime.string(), DateTimeFormatter.ISO_OFFSET_DATE_TIME);
if (odt.getYear() < OffsetDateTime.now(ZoneId.of("UTC")).getYear()) {
OffsetDateTime nowUtc = OffsetDateTime.now(ZoneId.of("UTC"));
- log.warn("Date on device is in the past: {}. Setting it to {}", odt.toString(), nowUtc);
+ log.warn("Date on device {} is in the past: {}. Setting it to {}",
+ handler().data().deviceId(), odt.toString(), nowUtc);
ietfSystemService.setCurrentDatetime(nowUtc, session);
}
}
diff --git a/drivers/microsemi/src/main/java/org/onosproject/drivers/microsemi/yang/IetfSystemNetconfService.java b/drivers/microsemi/src/main/java/org/onosproject/drivers/microsemi/yang/IetfSystemNetconfService.java
index 32e77b1..d72050e 100644
--- a/drivers/microsemi/src/main/java/org/onosproject/drivers/microsemi/yang/IetfSystemNetconfService.java
+++ b/drivers/microsemi/src/main/java/org/onosproject/drivers/microsemi/yang/IetfSystemNetconfService.java
@@ -20,14 +20,8 @@
import org.onosproject.netconf.DatastoreId;
import org.onosproject.netconf.NetconfException;
import org.onosproject.netconf.NetconfSession;
-import org.onosproject.yang.gen.v1.ietfsystemmicrosemi.rev20160505.ietfsystemmicrosemi.doupgradeandreboot.DoUpgradeAndRebootInput;
-import org.onosproject.yang.gen.v1.ietfsystemmicrosemi.rev20160505.ietfsystemmicrosemi.doupgradeandreboot.DoUpgradeAndRebootOutput;
-import org.onosproject.yang.gen.v1.ietfsystemmicrosemi.rev20160505.ietfsystemmicrosemi.pullupdatetarfromtftp.PullUpdateTarFromTftpInput;
-import org.onosproject.yang.gen.v1.ietfsystemmicrosemi.rev20160505.ietfsystemmicrosemi.readfromsyslog.ReadFromSyslogInput;
-import org.onosproject.yang.gen.v1.ietfsystemmicrosemi.rev20160505.ietfsystemmicrosemi.readfromsyslog.ReadFromSyslogOutput;
import org.onosproject.yang.gen.v1.ietfsystem.rev20140806.IetfSystem;
import org.onosproject.yang.gen.v1.ietfsystem.rev20140806.IetfSystemOpParam;
-import org.onosproject.yang.gen.v1.ietfsystem.rev20140806.ietfsystem.systemrestart.SystemRestartInput;
/**
* Extension of ietfSystemService to include NETCONF sessions.
@@ -76,15 +70,6 @@
void setCurrentDatetime(OffsetDateTime date, NetconfSession session) throws NetconfException;
/**
- * Service interface of systemRestart.
- *
- * @param inputVar input of service interface systemRestart
- * @param session An active NETCONF session
- * @throws NetconfException if the session has any error
- */
- void systemRestart(SystemRestartInput inputVar, NetconfSession session) throws NetconfException;
-
- /**
* Service interface of systemShutdown.
*
* @param session An active NETCONF session
@@ -92,36 +77,4 @@
*/
void systemShutdown(NetconfSession session) throws NetconfException;
- /**
- * Service interface of doUpgradeAndReboot.
- *
- * @param inputVar input of service interface doUpgradeAndReboot
- * @param session An active NETCONF session
- * @return doUpgradeAndRebootOutput output of service interface doUpgradeAndReboot
- * @throws NetconfException if the session has any error
- */
- DoUpgradeAndRebootOutput doUpgradeAndReboot(DoUpgradeAndRebootInput inputVar, NetconfSession session)
- throws NetconfException;
-
- /**
- * Service interface of pullUpdateTarFromTftp.
- *
- * @param inputVar input of service interface pullUpdateTarFromTftp
- * @param session An active NETCONF session
- * @throws NetconfException if the session has any error
- */
- void pullUpdateTarFromTftp(PullUpdateTarFromTftpInput inputVar, NetconfSession session)
- throws NetconfException;
-
- /**
- * Service interface of readFromSyslog.
- *
- * @param inputVar input of service interface readFromSyslog
- * @param session An active NETCONF session
- * @return readFromSyslogOutput output of service interface readFromSyslog
- * @throws NetconfException if the session has any error
- */
- ReadFromSyslogOutput readFromSyslog(ReadFromSyslogInput inputVar, NetconfSession session)
- throws NetconfException;
-
}
diff --git a/drivers/microsemi/src/main/java/org/onosproject/drivers/microsemi/yang/MicrosemiModelRegistrator.java b/drivers/microsemi/src/main/java/org/onosproject/drivers/microsemi/yang/MicrosemiModelRegistrator.java
deleted file mode 100644
index a075d83..0000000
--- a/drivers/microsemi/src/main/java/org/onosproject/drivers/microsemi/yang/MicrosemiModelRegistrator.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * Copyright 2017-present Open Networking Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.onosproject.drivers.microsemi.yang;
-
-import com.google.common.collect.ImmutableMap;
-import org.apache.felix.scr.annotations.Component;
-import org.onosproject.yang.AbstractYangModelRegistrator;
-import org.onosproject.yang.gen.v1.entitystatetcmib.rev20051122.EntityStateTcMib;
-import org.onosproject.yang.gen.v1.fpgainternal.rev20151130.FpgaInternal;
-import org.onosproject.yang.gen.v1.ianacrypthash.rev20140806.IanaCryptHash;
-import org.onosproject.yang.gen.v1.ianaiftype.rev20140508.IanaIfType;
-import org.onosproject.yang.gen.v1.ieeetypes.rev20080522.IeeeTypes;
-import org.onosproject.yang.gen.v1.ietfinettypes.rev20130715.IetfInetTypes;
-import org.onosproject.yang.gen.v1.ietfinterfaces.rev20140508.IetfInterfaces;
-import org.onosproject.yang.gen.v1.ietfnetconf.rev20110601.IetfNetconf;
-import org.onosproject.yang.gen.v1.ietfnetconfacm.rev20120222.IetfNetconfAcm;
-import org.onosproject.yang.gen.v1.ietfnetconfmonitoring.rev20101004.IetfNetconfMonitoring;
-import org.onosproject.yang.gen.v1.ietfnetconfnotifications.rev20120206.IetfNetconfNotifications;
-import org.onosproject.yang.gen.v1.ietfnetconfwithdefaults.rev20100609.IetfNetconfWithDefaults;
-import org.onosproject.yang.gen.v1.ietfsystem.rev20140806.IetfSystem;
-import org.onosproject.yang.gen.v1.ietfsystemmicrosemi.rev20160505.IetfSystemMicrosemi;
-import org.onosproject.yang.gen.v1.ietfsystemtlsauth.rev20140524.IetfSystemTlsAuth;
-import org.onosproject.yang.gen.v1.ietfx509certtoname.rev20130326.IetfX509CertToName;
-import org.onosproject.yang.gen.v1.ietfyangtypes.rev20130715.IetfYangTypes;
-import org.onosproject.yang.gen.v1.mseacfm.rev20160229.MseaCfm;
-import org.onosproject.yang.gen.v1.mseasafiltering.rev20160412.MseaSaFiltering;
-import org.onosproject.yang.gen.v1.mseasoamfm.rev20160229.MseaSoamFm;
-import org.onosproject.yang.gen.v1.mseasoampm.rev20160229.MseaSoamPm;
-import org.onosproject.yang.gen.v1.mseatypes.rev20160229.MseaTypes;
-import org.onosproject.yang.gen.v1.mseaunievcinterface.rev20160317.MseaUniEvcInterface;
-import org.onosproject.yang.gen.v1.mseaunievcservice.rev20160317.MseaUniEvcService;
-import org.onosproject.yang.gen.v1.ncnotifications.rev20080714.NcNotifications;
-import org.onosproject.yang.gen.v1.netopeercfgnetopeer.rev20130214.NetopeerCfgnetopeer;
-import org.onosproject.yang.gen.v1.notifications.rev20080714.Notifications;
-import org.onosproject.yang.gen.v1.rfc2544.rev20151020.Rfc2544;
-import org.onosproject.yang.gen.v1.svcactivationtypes.rev20151027.SvcActivationTypes;
-import org.onosproject.yang.gen.v1.y1564.rev20151029.Y1564;
-import org.onosproject.yang.model.DefaultYangModuleId;
-import org.onosproject.yang.model.YangModuleId;
-import org.onosproject.yang.runtime.AppModuleInfo;
-import org.onosproject.yang.runtime.DefaultAppModuleInfo;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * Representation of Microsemi model registrator which registers Microsemi device
- * models.
- */
-@Component(immediate = true)
-public class MicrosemiModelRegistrator extends AbstractYangModelRegistrator {
-
- public MicrosemiModelRegistrator() {
- super(IetfSystem.class, getAppInfo());
- }
-
- private static Map<YangModuleId, AppModuleInfo> getAppInfo() {
- Map<YangModuleId, AppModuleInfo> appInfo = new HashMap<>();
-
- appInfo.put(new DefaultYangModuleId("fpga-internal", "2015-11-30"),
- new DefaultAppModuleInfo(FpgaInternal.class, null));
- appInfo.put(new DefaultYangModuleId("iana-if-type", "2014-05-08"),
- new DefaultAppModuleInfo(IanaIfType.class, null));
- appInfo.put(new DefaultYangModuleId("ietf-yang-types", "2013-07-15"),
- new DefaultAppModuleInfo(IetfYangTypes.class, null));
- appInfo.put(new DefaultYangModuleId("msea-sa-filtering", "2016-04-12"),
- new DefaultAppModuleInfo(MseaSaFiltering.class, null));
- appInfo.put(new DefaultYangModuleId("ietf-x509-cert-to-name", "2013-03-26"),
- new DefaultAppModuleInfo(IetfX509CertToName.class, null));
- appInfo.put(new DefaultYangModuleId("ietf-system", "2014-08-06"),
- new DefaultAppModuleInfo(IetfSystem.class, null));
- appInfo.put(new DefaultYangModuleId("msea-types", "2016-02-29"),
- new DefaultAppModuleInfo(MseaTypes.class, null));
- appInfo.put(new DefaultYangModuleId("ietf-inet-types", "2013-07-15"),
- new DefaultAppModuleInfo(IetfInetTypes.class, null));
- appInfo.put(new DefaultYangModuleId("ietf-netconf-with-defaults", "2010-06-09"),
- new DefaultAppModuleInfo(IetfNetconfWithDefaults.class, null));
- appInfo.put(new DefaultYangModuleId("msea-uni-evc-service", "2016-03-17"),
- new DefaultAppModuleInfo(MseaUniEvcService.class, null));
- appInfo.put(new DefaultYangModuleId("ietf-netconf-monitoring", "2010-10-04"),
- new DefaultAppModuleInfo(IetfNetconfMonitoring.class, null));
- appInfo.put(new DefaultYangModuleId("ietf-netconf-acm", "2012-02-22"),
- new DefaultAppModuleInfo(IetfNetconfAcm.class, null));
- appInfo.put(new DefaultYangModuleId("ietf-system-tls-auth", "2014-05-24"),
- new DefaultAppModuleInfo(IetfSystemTlsAuth.class, null));
- appInfo.put(new DefaultYangModuleId("rfc-2544", "2015-10-20"),
- new DefaultAppModuleInfo(Rfc2544.class, null));
- appInfo.put(new DefaultYangModuleId("msea-cfm", "2016-02-29"),
- new DefaultAppModuleInfo(MseaCfm.class, null));
- appInfo.put(new DefaultYangModuleId("netopeer-cfgnetopeer", "2013-02-14"),
- new DefaultAppModuleInfo(NetopeerCfgnetopeer.class, null));
- appInfo.put(new DefaultYangModuleId("ENTITY-STATE-TC-MIB", "2005-11-22"),
- new DefaultAppModuleInfo(EntityStateTcMib.class, null));
- appInfo.put(new DefaultYangModuleId("msea-soam-fm", "2016-02-29"),
- new DefaultAppModuleInfo(MseaSoamFm.class, null));
- appInfo.put(new DefaultYangModuleId("ietf-netconf-notifications", "2012-02-06"),
- new DefaultAppModuleInfo(IetfNetconfNotifications.class, null));
- appInfo.put(new DefaultYangModuleId("nc-notifications", "2008-07-14"),
- new DefaultAppModuleInfo(NcNotifications.class, null));
- appInfo.put(new DefaultYangModuleId("iana-crypt-hash", "2014-08-06"),
- new DefaultAppModuleInfo(IanaCryptHash.class, null));
- appInfo.put(new DefaultYangModuleId("msea-uni-evc-interface", "2016-03-17"),
- new DefaultAppModuleInfo(MseaUniEvcInterface.class, null));
- appInfo.put(new DefaultYangModuleId("msea-soam-pm", "2016-02-29"),
- new DefaultAppModuleInfo(MseaSoamPm.class, null));
- appInfo.put(new DefaultYangModuleId("ieee-types", "2008-05-22"),
- new DefaultAppModuleInfo(IeeeTypes.class, null));
- appInfo.put(new DefaultYangModuleId("svc-activation-types", "2015-10-27"),
- new DefaultAppModuleInfo(SvcActivationTypes.class, null));
- appInfo.put(new DefaultYangModuleId("ietf-netconf", "2011-06-01"),
- new DefaultAppModuleInfo(IetfNetconf.class, null));
- appInfo.put(new DefaultYangModuleId("ietf-system-microsemi", "2016-05-05"),
- new DefaultAppModuleInfo(IetfSystemMicrosemi.class, null));
- appInfo.put(new DefaultYangModuleId("notifications", "2008-07-14"),
- new DefaultAppModuleInfo(Notifications.class, null));
- appInfo.put(new DefaultYangModuleId("y-1564", "2015-10-29"),
- new DefaultAppModuleInfo(Y1564.class, null));
- appInfo.put(new DefaultYangModuleId("ietf-interfaces", "2014-05-08"),
- new DefaultAppModuleInfo(IetfInterfaces.class, null));
- return ImmutableMap.copyOf(appInfo);
- }
-}
diff --git a/drivers/microsemi/src/main/java/org/onosproject/drivers/microsemi/yang/impl/AbstractYangServiceImpl.java b/drivers/microsemi/src/main/java/org/onosproject/drivers/microsemi/yang/impl/AbstractYangServiceImpl.java
index 27c1e86..074aad4 100644
--- a/drivers/microsemi/src/main/java/org/onosproject/drivers/microsemi/yang/impl/AbstractYangServiceImpl.java
+++ b/drivers/microsemi/src/main/java/org/onosproject/drivers/microsemi/yang/impl/AbstractYangServiceImpl.java
@@ -76,15 +76,12 @@
@Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
protected YangModelRegistry yangModelRegistry;
-// @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
-// protected SchemaContextProvider schemaContextProvider;
-
protected ApplicationId appId;
// xSer is not a service and is a class variable. Can be lost on deactivate.
// Must be recreated on activate
- protected XmlSerializer xSer;
- protected YangSerializerContext yCtx;
+ protected XmlSerializer xSer = null;
+ protected YangSerializerContext yCtx = null;
protected static final Pattern REGEX_XML_HEADER =
Pattern.compile("(<\\?xml).*(\\?>)", Pattern.DOTALL);
@@ -107,11 +104,8 @@
@Activate
public void activate() {
Set<YangSerializer> yangSer = ((YangSerializerRegistry) yangModelRegistry).getSerializers();
- yangSer.forEach(ser -> {
- if (ser instanceof XmlSerializer) {
- xSer = (XmlSerializer) ser;
- }
- });
+ xSer = (XmlSerializer) yangSer.stream()
+ .filter(ser -> (ser instanceof XmlSerializer)).findFirst().get();
SchemaContext context = ((SchemaContextProvider) yangModelRegistry)
.getSchemaContext(ResourceId.builder().addBranchPointSchema("/", null).build());
diff --git a/drivers/microsemi/src/main/java/org/onosproject/drivers/microsemi/yang/impl/IetfSystemManager.java b/drivers/microsemi/src/main/java/org/onosproject/drivers/microsemi/yang/impl/IetfSystemManager.java
index 0e8f4bd..9a8b471 100644
--- a/drivers/microsemi/src/main/java/org/onosproject/drivers/microsemi/yang/impl/IetfSystemManager.java
+++ b/drivers/microsemi/src/main/java/org/onosproject/drivers/microsemi/yang/impl/IetfSystemManager.java
@@ -29,14 +29,8 @@
import org.onosproject.netconf.NetconfSession;
import org.onosproject.yang.gen.v1.ietfsystem.rev20140806.ietfsystem.DefaultSystem;
import org.onosproject.yang.gen.v1.ietfsystem.rev20140806.ietfsystem.DefaultSystemState;
-import org.onosproject.yang.gen.v1.ietfsystemmicrosemi.rev20160505.ietfsystemmicrosemi.doupgradeandreboot.DoUpgradeAndRebootInput;
-import org.onosproject.yang.gen.v1.ietfsystemmicrosemi.rev20160505.ietfsystemmicrosemi.doupgradeandreboot.DoUpgradeAndRebootOutput;
-import org.onosproject.yang.gen.v1.ietfsystemmicrosemi.rev20160505.ietfsystemmicrosemi.pullupdatetarfromtftp.PullUpdateTarFromTftpInput;
-import org.onosproject.yang.gen.v1.ietfsystemmicrosemi.rev20160505.ietfsystemmicrosemi.readfromsyslog.ReadFromSyslogInput;
-import org.onosproject.yang.gen.v1.ietfsystemmicrosemi.rev20160505.ietfsystemmicrosemi.readfromsyslog.ReadFromSyslogOutput;
import org.onosproject.yang.gen.v1.ietfsystem.rev20140806.IetfSystem;
import org.onosproject.yang.gen.v1.ietfsystem.rev20140806.IetfSystemOpParam;
-import org.onosproject.yang.gen.v1.ietfsystem.rev20140806.ietfsystem.systemrestart.SystemRestartInput;
import org.onosproject.yang.model.DefaultModelObjectData;
import org.onosproject.yang.model.ModelConverter;
import org.onosproject.yang.model.ModelObject;
@@ -146,34 +140,10 @@
}
@Override
- public void systemRestart(SystemRestartInput inputVar, NetconfSession session) {
- throw new UnsupportedOperationException("Not yet implemented");
- }
-
- @Override
public void systemShutdown(NetconfSession session) {
throw new UnsupportedOperationException("Not yet implemented");
}
- @Override
- public DoUpgradeAndRebootOutput doUpgradeAndReboot(DoUpgradeAndRebootInput inputVar, NetconfSession session)
- throws NetconfException {
- throw new UnsupportedOperationException("Not yet implemented");
- }
-
- @Override
- public void pullUpdateTarFromTftp(PullUpdateTarFromTftpInput inputVar, NetconfSession session)
- throws NetconfException {
- throw new UnsupportedOperationException("Not yet implemented");
- }
-
- @Override
- public ReadFromSyslogOutput readFromSyslog(ReadFromSyslogInput inputVar, NetconfSession session)
- throws NetconfException {
- throw new UnsupportedOperationException("Not yet implemented");
- }
-
-
/**
* Builds a request crafted to get the configuration required to create
* details descriptions for the device.
@@ -186,9 +156,10 @@
rpc.append("xmlns:sysms=\"http://www.microsemi.com/microsemi-edge-assure/msea-system\">");
rpc.append("<platform>");
rpc.append("<os-release/>");
- rpc.append("<sysms:device-identification>");
- rpc.append("<sysms:serial-number/>");
- rpc.append("</sysms:device-identification>");
+//FIXME: This has been commented out until the augment of common models issue with onos-yang-tools is sorted
+// rpc.append("<sysms:device-identification>");
+// rpc.append("<sysms:serial-number/>");
+// rpc.append("</sysms:device-identification>");
rpc.append("</platform>");
rpc.append("<clock>");
rpc.append("<current-datetime/>");
diff --git a/drivers/microsemi/src/main/java/org/onosproject/drivers/microsemi/yang/impl/MseaCfmManager.java b/drivers/microsemi/src/main/java/org/onosproject/drivers/microsemi/yang/impl/MseaCfmManager.java
index 43be669..695dfcb 100644
--- a/drivers/microsemi/src/main/java/org/onosproject/drivers/microsemi/yang/impl/MseaCfmManager.java
+++ b/drivers/microsemi/src/main/java/org/onosproject/drivers/microsemi/yang/impl/MseaCfmManager.java
@@ -35,7 +35,6 @@
import org.onosproject.yang.gen.v1.mseacfm.rev20160229.mseacfm.abortloopback.AbortLoopbackInput;
import org.onosproject.yang.gen.v1.mseacfm.rev20160229.mseacfm.mefcfm.MaintenanceDomain;
import org.onosproject.yang.gen.v1.mseacfm.rev20160229.mseacfm.mefcfm.maintenancedomain.MaintenanceAssociation;
-import org.onosproject.yang.gen.v1.mseacfm.rev20160229.mseacfm.mefcfm.maintenancedomain.maintenanceassociation.CcmIntervalEnum;
import org.onosproject.yang.gen.v1.mseacfm.rev20160229.mseacfm.mefcfm.maintenancedomain.maintenanceassociation.MaintenanceAssociationEndPoint;
import org.onosproject.yang.gen.v1.mseacfm.rev20160229.mseacfm.transmitlinktrace.TransmitLinktraceInput;
import org.onosproject.yang.gen.v1.mseacfm.rev20160229.mseacfm.transmitlinktrace.TransmitLinktraceOutput;
@@ -43,7 +42,6 @@
import org.onosproject.yang.gen.v1.mseasoampm.rev20160229.mseasoampm.mefcfm.maintenancedomain.maintenanceassociation.maintenanceassociationendpoint.AugmentedMseaCfmMaintenanceAssociationEndPoint;
import org.onosproject.yang.gen.v1.mseasoampm.rev20160229.mseasoampm.mefcfm.maintenancedomain.maintenanceassociation.maintenanceassociationendpoint.DefaultAugmentedMseaCfmMaintenanceAssociationEndPoint;
import org.onosproject.yang.gen.v1.mseasoampm.rev20160229.mseasoampm.mefcfm.maintenancedomain.maintenanceassociation.maintenanceassociationendpoint.augmentedmseacfmmaintenanceassociationendpoint.delaymeasurements.DelayMeasurement;
-import org.onosproject.yang.gen.v1.mseasoampm.rev20160229.mseasoampm.mefcfm.maintenancedomain.maintenanceassociation.maintenanceassociationendpoint.augmentedmseacfmmaintenanceassociationendpoint.lossmeasurements.lossmeasurement.MessagePeriodEnum;
import org.onosproject.yang.model.DefaultModelObjectData;
import org.onosproject.yang.model.ModelConverter;
import org.onosproject.yang.model.ModelObject;
@@ -56,6 +54,7 @@
import org.onosproject.yang.runtime.DefaultCompositeStream;
import java.io.ByteArrayInputStream;
+import java.util.regex.Pattern;
/**
* Implementation of the MseaCfmServiceNetconf YANG model service.
@@ -69,6 +68,16 @@
public static final String MSEA_CFM_NS = "http://www.microsemi.com/microsemi-edge-assure/msea-cfm";
public static final String MSEA_CFM_PM_NS = "http://www.microsemi.com/microsemi-edge-assure/msea-soam-pm";
+
+ //FIXME Remove when the issue with Null bits on onos-yang-tools is sorted
+ @Deprecated
+ protected static final Pattern REGEX_EMPTY_ACTIVE_DEFECTS =
+ Pattern.compile("(<active-defects)[ ]?(/>)", Pattern.DOTALL);
+ //FIXME Remove when the issue with Null bits on onos-yang-tools is sorted
+ @Deprecated
+ protected static final Pattern REGEX_EMPTY_LAST_DEFECT_SENT =
+ Pattern.compile("(<msea-soam-fm:last-defect-sent)[ ]?(/>)", Pattern.DOTALL);
+
@Activate
public void activate() {
super.activate();
@@ -96,7 +105,6 @@
String xmlResult = session.get(xmlQueryStr, null);
xmlResult = removeRpcReplyData(xmlResult);
- xmlResult = removePrefixedMessagePeriod(xmlResult);
DefaultCompositeStream resultDcs = new DefaultCompositeStream(
null, new ByteArrayInputStream(xmlResult.getBytes()));
CompositeData compositeData = xSer.decode(resultDcs, yCtx);
@@ -127,7 +135,7 @@
String xmlResult = session.get(xmlQueryStr, null);
xmlResult = removeRpcReplyData(xmlResult);
- xmlResult = removePrefixedCcmInterval(xmlResult);
+ xmlResult = removeEmptyActiveDefects(xmlResult);
DefaultCompositeStream resultDcs = new DefaultCompositeStream(
null, new ByteArrayInputStream(xmlResult.getBytes()));
CompositeData compositeData = xSer.decode(resultDcs, yCtx);
@@ -155,7 +163,6 @@
String xmlResult = session.get(xmlQueryStr, null);
xmlResult = removeRpcReplyData(xmlResult);
- xmlResult = removePrefixedMessagePeriod(xmlResult);
DefaultCompositeStream resultDcs = new DefaultCompositeStream(
null, new ByteArrayInputStream(xmlResult.getBytes()));
CompositeData compositeData = xSer.decode(resultDcs, yCtx);
@@ -287,6 +294,16 @@
throw new UnsupportedOperationException("Not yet implemented");
}
+ //FIXME Remove when the fix for null bits with onos-yang-tools
+ // https://gerrit.onosproject.org/#/c/15777/ is available
+ @Deprecated
+ private static String removeEmptyActiveDefects(String rpcReplyXml) throws NetconfException {
+ rpcReplyXml = REGEX_EMPTY_ACTIVE_DEFECTS.matcher(rpcReplyXml).replaceFirst("");
+ rpcReplyXml = REGEX_EMPTY_LAST_DEFECT_SENT.matcher(rpcReplyXml).replaceFirst("");
+
+ return rpcReplyXml;
+ }
+
@Deprecated //Replace this with a ModelObject defintion
private String buildMepEssentialsQueryString(MdId mdId, MaIdShort maId,
MepId mepId) {
@@ -435,29 +452,4 @@
return rpc.toString();
}
-
- private static final String removePrefixedMessagePeriod(String xmlResult) {
- xmlResult = xmlResult.replace("message-period>3ms</",
- "message-period>" + MessagePeriodEnum.YANGAUTOPREFIX3MS.toString() + "</");
- xmlResult = xmlResult.replace("message-period>10ms</",
- "message-period>" + MessagePeriodEnum.YANGAUTOPREFIX10MS.toString() + "</");
- xmlResult = xmlResult.replace("message-period>100ms</",
- "message-period>" + MessagePeriodEnum.YANGAUTOPREFIX100MS.toString() + "</");
- xmlResult = xmlResult.replace("message-period>1000ms</",
- "message-period>" + MessagePeriodEnum.YANGAUTOPREFIX1000MS.toString() + "</");
- return xmlResult;
- }
-
- private static final String removePrefixedCcmInterval(String xmlResult) {
- xmlResult = xmlResult.replace("ccm-interval>3.3ms</",
- "ccm-interval>" + CcmIntervalEnum.YANGAUTOPREFIX3_3MS.toString() + "</");
- xmlResult = xmlResult.replace("ccm-interval>10ms</",
- "ccm-interval>" + CcmIntervalEnum.YANGAUTOPREFIX10MS.toString() + "</");
- xmlResult = xmlResult.replace("ccm-interval>100ms</",
- "ccm-interval>" + CcmIntervalEnum.YANGAUTOPREFIX100MS.toString() + "</");
- xmlResult = xmlResult.replace("ccm-interval>1s</",
- "ccm-interval>" + CcmIntervalEnum.YANGAUTOPREFIX1S.toString() + "</");
- return xmlResult;
- }
-
}
diff --git a/drivers/microsemi/src/test/java/org/onosproject/drivers/microsemi/EA1000CfmMepProgrammableTest.java b/drivers/microsemi/src/test/java/org/onosproject/drivers/microsemi/EA1000CfmMepProgrammableTest.java
index 1b8135c..20e80a1 100644
--- a/drivers/microsemi/src/test/java/org/onosproject/drivers/microsemi/EA1000CfmMepProgrammableTest.java
+++ b/drivers/microsemi/src/test/java/org/onosproject/drivers/microsemi/EA1000CfmMepProgrammableTest.java
@@ -41,14 +41,17 @@
import org.onosproject.yang.gen.v1.mseacfm.rev20160229.mseacfm.mefcfm.maintenancedomain.MdNameAndTypeCombo;
import org.onosproject.yang.gen.v1.mseacfm.rev20160229.mseacfm.mefcfm.maintenancedomain.maintenanceassociation.MaNameAndTypeCombo;
+import java.util.BitSet;
+
/**
* Test of the CFM implementation on EA1000 through the incubator/net/l2monitoring interface.
*/
public class EA1000CfmMepProgrammableTest {
EA1000CfmMepProgrammable cfmProgrammable;
- MdId mdId1 = MdIdCharStr.asMdId("md-1");
- MaIdShort maId11 = MaIdCharStr.asMaId("ma-1-1");
- MepId mep111 = MepId.valueOf((short) 1);
+ public static final MdId MD_ID_1 = MdIdCharStr.asMdId("md-1");
+ public static final MaIdShort MA_ID_11 = MaIdCharStr.asMaId("ma-1-1");
+ public static final MepId MEP_111 = MepId.valueOf((short) 1);
+ public static final MepId MEP_112 = MepId.valueOf((short) 2);
@Before
public void setUp() throws Exception {
@@ -72,7 +75,7 @@
@Test
public void testGetMep() throws CfmConfigException {
- MepEntry mepEntry = cfmProgrammable.getMep(mdId1, maId11, mep111);
+ MepEntry mepEntry = cfmProgrammable.getMep(MD_ID_1, MA_ID_11, MEP_111);
//Result will come from MockNetconfSessionEa1000.SAMPLE_MSEACFM_MD_MA_MEP_FULL_REPLY
assertNotNull(mepEntry);
@@ -80,13 +83,43 @@
assertTrue(mepEntry.cciEnabled());
assertEquals(Priority.PRIO5.name(), mepEntry.ccmLtmPriority().name());
- assertTrue(mepEntry.activeMacStatusDefect()); //remote-mac-error
- assertTrue(mepEntry.activeRdiCcmDefect()); //remote-rdi
+ assertTrue("Expecting remote-mac-error", mepEntry.activeMacStatusDefect()); //remote-mac-error
+ assertTrue("Expecting remote-rdi", mepEntry.activeRdiCcmDefect()); //remote-rdi
assertNotNull(mepEntry.activeRemoteMepList());
- //TODO Comment back in this test - this is a serious issue with onos-yang-tools that only 1 is found
- // See https://gerrit.onosproject.org/#/c/15164/
+//FIXME Waiting on patch https://gerrit.onosproject.org/#/c/15778/
+// assertEquals("Expecting 2 Remote Meps", 2, mepEntry.activeRemoteMepList().size());
+ mepEntry.activeRemoteMepList().forEach(rmep -> {
+ if (rmep.remoteMepId().value() == 1) {
+ assertEquals(RemoteMepState.RMEP_FAILED.name(),
+ rmep.state().toString());
+ assertEquals(54654654L, rmep.failedOrOkTime().toMillis());
+ assertEquals("aa:bb:cc:dd:ee:ff".toUpperCase(), rmep.macAddress().toString());
+ assertFalse(rmep.rdi());
+ assertEquals(PortStatusTlvType.PS_NO_STATUS_TLV.name(),
+ rmep.portStatusTlvType().toString());
+ assertEquals(InterfaceStatusTlvType.IS_DORMANT.name(),
+ rmep.interfaceStatusTlvType().toString());
+ }
+ });
+
+ }
+
+ @Test
+ public void testGetMep2() throws CfmConfigException {
+ MepEntry mepEntry = cfmProgrammable.getMep(MD_ID_1, MA_ID_11, MEP_112);
+
+ //Result will come from MockNetconfSessionEa1000.SAMPLE_MSEACFM_MD_MA_MEP_FULL_REPLY
+ assertNotNull(mepEntry);
+ assertTrue(mepEntry.administrativeState());
+ assertTrue(mepEntry.cciEnabled());
+ assertEquals(Priority.PRIO4.name(), mepEntry.ccmLtmPriority().name());
+
+ assertNotNull(mepEntry.activeRemoteMepList());
+ BitSet bs1 = new BitSet();
+ bs1.clear();
+//FIXME Waiting on patch https://gerrit.onosproject.org/#/c/15778/
// assertEquals("Expecting 2 Remote Meps", 2, mepEntry.activeRemoteMepList().size());
mepEntry.activeRemoteMepList().forEach(rmep -> {
if (rmep.remoteMepId().value() == 1) {
@@ -110,7 +143,7 @@
*/
@Test
public void testDeleteMep() throws CfmConfigException {
- assertTrue(cfmProgrammable.deleteMep(mdId1, maId11, mep111));
+ assertTrue(cfmProgrammable.deleteMep(MD_ID_1, MA_ID_11, MEP_111));
}
/**
@@ -126,12 +159,12 @@
lbCreate.vlanPriority(Priority.PRIO3);
lbCreate.vlanDropEligible(true);
- cfmProgrammable.transmitLoopback(mdId1, maId11, mep111, lbCreate.build());
+ cfmProgrammable.transmitLoopback(MD_ID_1, MA_ID_11, MEP_111, lbCreate.build());
}
@Test
public void testAbortLoopback() throws CfmConfigException {
- cfmProgrammable.abortLoopback(mdId1, maId11, mep111);
+ cfmProgrammable.abortLoopback(MD_ID_1, MA_ID_11, MEP_111);
}
// @Test
diff --git a/drivers/microsemi/src/test/java/org/onosproject/drivers/microsemi/yang/IetfSystemManagerTest.java b/drivers/microsemi/src/test/java/org/onosproject/drivers/microsemi/yang/IetfSystemManagerTest.java
index 22112b3..8a5e6f4 100644
--- a/drivers/microsemi/src/test/java/org/onosproject/drivers/microsemi/yang/IetfSystemManagerTest.java
+++ b/drivers/microsemi/src/test/java/org/onosproject/drivers/microsemi/yang/IetfSystemManagerTest.java
@@ -96,7 +96,7 @@
AugmentedSysPlatform sysSystemState =
(AugmentedSysPlatform) sys.systemState().platform().augmentation(DefaultAugmentedSysPlatform.class);
- assertEquals("Eagle Simulator.", sysSystemState.deviceIdentification().serialNumber());
+ assertEquals("EA1000 unit test.", sysSystemState.deviceIdentification().serialNumber());
}
@Test
diff --git a/drivers/microsemi/src/test/java/org/onosproject/drivers/microsemi/yang/MockNetconfSessionEa1000.java b/drivers/microsemi/src/test/java/org/onosproject/drivers/microsemi/yang/MockNetconfSessionEa1000.java
index d2c07e5..b9d4342 100644
--- a/drivers/microsemi/src/test/java/org/onosproject/drivers/microsemi/yang/MockNetconfSessionEa1000.java
+++ b/drivers/microsemi/src/test/java/org/onosproject/drivers/microsemi/yang/MockNetconfSessionEa1000.java
@@ -19,6 +19,7 @@
import java.util.concurrent.atomic.AtomicInteger;
import java.util.regex.Pattern;
+import org.onosproject.drivers.microsemi.EA1000CfmMepProgrammableTest;
import org.onosproject.netconf.DatastoreId;
import org.onosproject.netconf.NetconfDeviceInfo;
import org.onosproject.netconf.NetconfDeviceOutputEventListener;
@@ -375,43 +376,59 @@
+ "(</rpc>)\\R?"
+ "(]]>){2}", Pattern.DOTALL);
- //For testGetConfigMseaCfmEssentials
+ //For testGetMep
+ private String sampleXmlRegexGetMseaCfmFullStr =
+ "(<\\?xml).*(<rpc).*(<get>)\\R?"
+ + "(<filter type=\"subtree\">)\\R?"
+ + "(<mef-cfm).*"
+ + "(<maintenance-domain>)\\R?"
+ + "(<id/>)\\R?"
+ + "(<name>)([a-zA-Z0-9\\-:\\.]){1,48}(</name>)\\R?"
+ + "(<md-level/>)?\\R?"
+ + "(<maintenance-association>)\\R?"
+ + "(<id/>)\\R?"
+ + "(<name>)([a-zA-Z0-9\\-:\\.]){1,48}(</name>)\\R?"
+ + "(<maintenance-association-end-point>)\\R?"
+ + "(<mep-identifier>)[0-9]{1,4}(</mep-identifier>)\\R?"
+ + "(<interface/>)?\\R?"
+ + "(<primary-vid/>)?\\R?"
+ + "(<administrative-state/>)?\\R?"
+ + "(<mac-address/>)?\\R?"
+ + "(<ccm-ltm-priority/>)?\\R?"
+ + "(<continuity-check/>)?\\R?"
+ + "(<loopback/>)?\\R?"
+ + "(<linktrace/>)?\\R?"
+ + "(<remote-mep-database/>)\\R?"
+ + "(<msea-soam-fm:operational-state/>)\\R?"
+ + "(<msea-soam-fm:connectivity-status/>)\\R?"
+ + "(<msea-soam-fm:port-status/>)\\R?"
+ + "(<msea-soam-fm:interface-status/>)\\R?"
+ + "(<msea-soam-fm:last-defect-sent/>)\\R?"
+ + "(<msea-soam-fm:rdi-transmit-status/>)\\R?"
+ + "(</maintenance-association-end-point>)\\R?"
+ + "(</maintenance-association>)\\R?"
+ + "(</maintenance-domain>)\\R?"
+ + "(</mef-cfm>)\\R?"
+ + "(</filter>)\\R?"
+ + "(</get>)\\R?"
+ + "(</rpc>)\\R?"
+ + "(]]>){2}";
+
private Pattern sampleXmlRegexGetMseaCfmFull =
- Pattern.compile("(<\\?xml).*(<rpc).*(<get>)\\R?"
- + "(<filter type=\"subtree\">)\\R?"
- + "(<mef-cfm).*"
- + "(<maintenance-domain>)\\R?"
- + "(<id/>)\\R?"
- + "(<name>)([a-zA-Z0-9\\-:\\.]){1,48}(</name>)\\R?"
- + "(<md-level/>)?\\R?"
- + "(<maintenance-association>)\\R?"
- + "(<id/>)\\R?"
- + "(<name>)([a-zA-Z0-9\\-:\\.]){1,48}(</name>)\\R?"
- + "(<maintenance-association-end-point>)\\R?"
- + "(<mep-identifier>)[0-9]{1,4}(</mep-identifier>)\\R?"
- + "(<interface/>)?\\R?"
- + "(<primary-vid/>)?\\R?"
- + "(<administrative-state/>)?\\R?"
- + "(<mac-address/>)?\\R?"
- + "(<ccm-ltm-priority/>)?\\R?"
- + "(<continuity-check/>)?\\R?"
- + "(<loopback/>)?\\R?"
- + "(<linktrace/>)?\\R?"
- + "(<remote-mep-database/>)\\R?"
- + "(<msea-soam-fm:operational-state/>)\\R?"
- + "(<msea-soam-fm:connectivity-status/>)\\R?"
- + "(<msea-soam-fm:port-status/>)\\R?"
- + "(<msea-soam-fm:interface-status/>)\\R?"
- + "(<msea-soam-fm:last-defect-sent/>)\\R?"
- + "(<msea-soam-fm:rdi-transmit-status/>)\\R?"
- + "(</maintenance-association-end-point>)\\R?"
- + "(</maintenance-association>)\\R?"
- + "(</maintenance-domain>)\\R?"
- + "(</mef-cfm>)\\R?"
- + "(</filter>)\\R?"
- + "(</get>)\\R?"
- + "(</rpc>)\\R?"
- + "(]]>){2}", Pattern.DOTALL);
+ Pattern.compile(sampleXmlRegexGetMseaCfmFullStr
+ .replace("(<mep-identifier>)[0-9]{1,4}(</mep-identifier>)",
+ "(<mep-identifier>)" +
+ EA1000CfmMepProgrammableTest.MEP_111 +
+ "(</mep-identifier>)"),
+ Pattern.DOTALL);
+
+ private Pattern sampleXmlRegexGetMseaCfmFull2 =
+ Pattern.compile(sampleXmlRegexGetMseaCfmFullStr
+ .replace("(<mep-identifier>)[0-9]{1,4}(</mep-identifier>)",
+ "(<mep-identifier>)" +
+ EA1000CfmMepProgrammableTest.MEP_112 +
+ "(</mep-identifier>)"),
+ Pattern.DOTALL);
//For testGetConfigMseaCfmEssentials
private Pattern sampleXmlRegexGetMseaDelay =
@@ -555,7 +572,7 @@
+ "<platform>\n"
+ "<os-release>4.4.0-53-generic</os-release>\n"
+ "<sysms:device-identification>\n"
- + "<sysms:serial-number>Eagle Simulator.</sysms:serial-number>\n"
+ + "<sysms:serial-number>EA1000 unit test.</sysms:serial-number>\n"
+ "</sysms:device-identification>\n"
+ "</platform>\n"
+ "</system-state>\n"
@@ -830,25 +847,25 @@
+ "xmlns:msea-soam-pm=\"http://www.microsemi.com/microsemi-edge-assure/msea-soam-pm\">"
+ "<maintenance-domain>"
+ "<id>1</id>"
- + "<name>md-1</name>"
+ + "<name>" + EA1000CfmMepProgrammableTest.MD_ID_1 + "</name>"
+ "<maintenance-association>"
+ "<id>1</id>"
- + "<name>ma-1-1</name>"
+ + "<name>" + EA1000CfmMepProgrammableTest.MA_ID_11 + "</name>"
+ "<ccm-interval>3.3ms</ccm-interval>"
+ "<maintenance-association-end-point>"
- + "<mep-identifier>1</mep-identifier>"
+ + "<mep-identifier>" + EA1000CfmMepProgrammableTest.MEP_111 + "</mep-identifier>"
+ "<interface>eth0</interface>"
+ "<primary-vid>20</primary-vid>"
+ "<administrative-state>true</administrative-state>"
+ "<mac-address>00:b0:ae:03:ff:31</mac-address>"
+ "<ccm-ltm-priority>5</ccm-ltm-priority>"
+ "<continuity-check>"
- + "<cci-enabled>true</cci-enabled>"
- + "<fng-state>defect-reported</fng-state>"
- + "<highest-priority-defect-found>remote-invalid-ccm</highest-priority-defect-found>"
- + "<active-defects>remote-rdi remote-invalid-ccm</active-defects>"
- + "<ccm-sequence-error-count>0</ccm-sequence-error-count>"
- + "<sent-ccms>197</sent-ccms>"
+ + "<cci-enabled>true</cci-enabled>"
+ + "<fng-state>defect-reported</fng-state>"
+ + "<highest-priority-defect-found>remote-invalid-ccm</highest-priority-defect-found>"
+ + "<active-defects>remote-rdi remote-invalid-ccm</active-defects>"
+ + "<ccm-sequence-error-count>0</ccm-sequence-error-count>"
+ + "<sent-ccms>197</sent-ccms>"
+ "</continuity-check>"
+ "<loopback>"
+ "</loopback>"
@@ -887,6 +904,85 @@
+ "</data>"
+ "</rpc-reply>";
+
+ /**
+ * With an empty <last-defect-sent />. Retrieved from simulator.
+ */
+ private static final String SAMPLE_MSEACFM_MD_MA_MEP_FULL_REPLY2 =
+ "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
+ + "<rpc-reply xmlns=\"urn:ietf:params:xml:ns:netconf:base:1.0\" message-id=\"47\">"
+ + "<data>"
+ + "<mef-cfm xmlns=\"http://www.microsemi.com/microsemi-edge-assure/msea-cfm\" "
+ + "xmlns:msea-soam-fm=\"http://www.microsemi.com/microsemi-edge-assure/msea-soam-fm\" "
+ + "xmlns:msea-soam-pm=\"http://www.microsemi.com/microsemi-edge-assure/msea-soam-pm\">"
+ + "<maintenance-domain>"
+ + "<id>1</id>"
+ + "<name>" + EA1000CfmMepProgrammableTest.MD_ID_1 + "</name>"
+ + "<maintenance-association>"
+ + "<id>1</id>"
+ + "<name>" + EA1000CfmMepProgrammableTest.MA_ID_11 + "</name>"
+ + "<maintenance-association-end-point>"
+ + "<mep-identifier>" + EA1000CfmMepProgrammableTest.MEP_112 + "</mep-identifier>"
+ + "<interface>eth0</interface>"
+ + "<administrative-state>true</administrative-state>"
+ + "<ccm-ltm-priority>4</ccm-ltm-priority>"
+ + "<continuity-check>"
+ + "<cci-enabled>true</cci-enabled>"
+ + "<fng-state>report-defect</fng-state>"
+ + "<highest-priority-defect-found>remote-mac-error</highest-priority-defect-found>"
+ + "<active-defects> remote-mac-error invalid-ccm</active-defects>"
+ + "<last-error-ccm>U2FtcGxlIGxhc3QgZXJyb3IgY2NtAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
+ + "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
+ + "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
+ + "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="
+ + "</last-error-ccm>"
+ + "<ccm-sequence-error-count>10</ccm-sequence-error-count>"
+ + "<sent-ccms>15</sent-ccms>"
+ + "</continuity-check>"
+ + "<mac-address>53:65:61:6e:20:43</mac-address>"
+ + "<msea-soam-fm:port-status>no-status-tlv</msea-soam-fm:port-status>"
+ + "<msea-soam-fm:interface-status>no-status-tlv</msea-soam-fm:interface-status>"
+ + "<msea-soam-fm:last-defect-sent />"
+ + "<msea-soam-fm:rdi-transmit-status>false</msea-soam-fm:rdi-transmit-status>"
+ + "<loopback>"
+ + "<replies-received>123</replies-received>"
+ + "<replies-transmitted>456</replies-transmitted>"
+ + "</loopback>"
+ + "<remote-mep-database>"
+ + "<remote-mep>"
+ + "<remote-mep-id>20</remote-mep-id>"
+ + "<remote-mep-state>ok</remote-mep-state>"
+ + "<failed-ok-time>150859498</failed-ok-time>"
+ + "<mac-address>53:65:61:6e:20:43</mac-address>"
+ + "<rdi>true</rdi>"
+ + "<port-status-tlv>up</port-status-tlv>"
+ + "<interface-status-tlv>no-status-tlv</interface-status-tlv>"
+ + "</remote-mep>"
+ + "<remote-mep>"
+ + "<remote-mep-id>30</remote-mep-id>"
+ + "<remote-mep-state>ok</remote-mep-state>"
+ + "<failed-ok-time>150859498</failed-ok-time>"
+ + "<mac-address>53:65:61:6e:20:43</mac-address>"
+ + "<rdi>true</rdi>"
+ + "<port-status-tlv>no-status-tlv</port-status-tlv>"
+ + "<interface-status-tlv>down</interface-status-tlv>"
+ + "</remote-mep>"
+ + "</remote-mep-database>"
+ + "<linktrace>"
+ + "<unexpected-replies-received>0</unexpected-replies-received>"
+ + "<msea-soam-fm:ltm-msgs-transmitted>2</msea-soam-fm:ltm-msgs-transmitted>"
+ + "<msea-soam-fm:ltm-msgs-received>2</msea-soam-fm:ltm-msgs-received>"
+ + "<msea-soam-fm:ltr-msgs-transmitted>2</msea-soam-fm:ltr-msgs-transmitted>"
+ + "<msea-soam-fm:ltr-msgs-received>2</msea-soam-fm:ltr-msgs-received>"
+ + "<linktrace-database />"
+ + "</linktrace>"
+ + "</maintenance-association-end-point>"
+ + "</maintenance-association>"
+ + "</maintenance-domain>"
+ + "</mef-cfm>"
+ + "</data>"
+ + "</rpc-reply>";
+
private static final String SAMPLE_MSEACFM_DELAY_MEASUREMENT_FULL_REPLY =
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
+ "<rpc-reply xmlns=\"urn:ietf:params:xml:ns:netconf:base:1.0\" message-id=\"47\">"
@@ -1208,6 +1304,9 @@
} else if (sampleXmlRegexGetMseaCfmFull.matcher(request).matches()) {
return SAMPLE_MSEACFM_MD_MA_MEP_FULL_REPLY;
+ } else if (sampleXmlRegexGetMseaCfmFull2.matcher(request).matches()) {
+ return SAMPLE_MSEACFM_MD_MA_MEP_FULL_REPLY2;
+
} else if (sampleXmlRegexDeleteMseaCfmMep.matcher(request).matches()) {
return SAMPLE_REPLY_OK;
diff --git a/drivers/microsemi/src/test/java/org/onosproject/yang/MockMicrosemiRegistrator.java b/drivers/microsemi/src/test/java/org/onosproject/yang/MockMicrosemiRegistrator.java
index f8129f2..111ec8a 100644
--- a/drivers/microsemi/src/test/java/org/onosproject/yang/MockMicrosemiRegistrator.java
+++ b/drivers/microsemi/src/test/java/org/onosproject/yang/MockMicrosemiRegistrator.java
@@ -15,7 +15,7 @@
*/
package org.onosproject.yang;
-import org.onosproject.drivers.microsemi.yang.MicrosemiModelRegistrator;
+import org.onosproject.models.microsemi.MicrosemiModelRegistrator;
import org.onosproject.yang.compiler.datamodel.YangNode;
import org.onosproject.yang.compiler.tool.YangNodeInfo;
import org.onosproject.yang.runtime.DefaultModelRegistrationParam;