aboutsummaryrefslogtreecommitdiffstats
path: root/sdnr/wt/devicemanager-o-ran-sc/o-ran/ru-fh/provider/src/test
diff options
context:
space:
mode:
authorRavi Pendurty <ravi.pendurty@highstreet-technologies.com>2023-10-20 14:30:41 +0530
committerRavi Pendurty <ravi.pendurty@highstreet-technologies.com>2023-10-20 14:31:01 +0530
commitea5ba02bdfd1ed6e16683b01f1f499cb2473e37e (patch)
treea12785119b185c6ec3777ad7826dc4c27f0c26ef /sdnr/wt/devicemanager-o-ran-sc/o-ran/ru-fh/provider/src/test
parent70cc4c4295376e4af9cb9009a6ee5ddc389d61d9 (diff)
Support multiple YANG revisions
Provide o-ran-supervision messages to VES collector Issue-ID: CCSDK-3948 Change-Id: I16cb880414dde00a48fa59d8b90251beedae2c0e Signed-off-by: Ravi Pendurty <ravi.pendurty@highstreet-technologies.com>
Diffstat (limited to 'sdnr/wt/devicemanager-o-ran-sc/o-ran/ru-fh/provider/src/test')
-rw-r--r--sdnr/wt/devicemanager-o-ran-sc/o-ran/ru-fh/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/impl/dom/TestORanDOMFaultNotificationListener.java36
-rw-r--r--sdnr/wt/devicemanager-o-ran-sc/o-ran/ru-fh/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/impl/dom/TestORanDOMNetworkElement.java38
-rw-r--r--sdnr/wt/devicemanager-o-ran-sc/o-ran/ru-fh/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/impl/dom/TestORanDOMNotification.java3
-rw-r--r--sdnr/wt/devicemanager-o-ran-sc/o-ran/ru-fh/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/impl/dom/TestORanDOMToInternalDataModel.java91
-rw-r--r--sdnr/wt/devicemanager-o-ran-sc/o-ran/ru-fh/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/impl/dom/TestORanNetworkElementFactory.java61
-rw-r--r--sdnr/wt/devicemanager-o-ran-sc/o-ran/ru-fh/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/impl/dom/TestORanRegistrationToVESpnfRegistration.java5
-rw-r--r--sdnr/wt/devicemanager-o-ran-sc/o-ran/ru-fh/provider/src/test/resources/o-ran-fm@2022-08-15.yang153
-rw-r--r--sdnr/wt/devicemanager-o-ran-sc/o-ran/ru-fh/provider/src/test/resources/oran-fm-active-alarm.xml25
8 files changed, 352 insertions, 60 deletions
diff --git a/sdnr/wt/devicemanager-o-ran-sc/o-ran/ru-fh/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/impl/dom/TestORanDOMFaultNotificationListener.java b/sdnr/wt/devicemanager-o-ran-sc/o-ran/ru-fh/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/impl/dom/TestORanDOMFaultNotificationListener.java
index 89ff6dc90..de19bf1a2 100644
--- a/sdnr/wt/devicemanager-o-ran-sc/o-ran/ru-fh/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/impl/dom/TestORanDOMFaultNotificationListener.java
+++ b/sdnr/wt/devicemanager-o-ran-sc/o-ran/ru-fh/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/impl/dom/TestORanDOMFaultNotificationListener.java
@@ -22,6 +22,7 @@
package org.onap.ccsdk.features.sdnr.wt.devicemanager.oran.impl.dom;
import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import com.google.common.io.Files;
@@ -29,6 +30,7 @@ import java.io.File;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.time.Instant;
+import java.util.Optional;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
@@ -37,17 +39,22 @@ import org.mockito.Mock;
import org.mockito.junit.MockitoJUnitRunner;
import org.onap.ccsdk.features.sdnr.wt.common.configuration.ConfigurationFileRepresentation;
import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.DataProvider;
+import org.onap.ccsdk.features.sdnr.wt.devicemanager.oran.notification.ORanDOMFaultNotificationListener;
+import org.onap.ccsdk.features.sdnr.wt.devicemanager.oran.yangspecs.ORANFM;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.DeviceManagerServiceProvider;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.FaultService;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.VESCollectorService;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.vescollectorconnector.impl.VESCollectorServiceImpl;
+import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.Capabilities;
import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfDomAccessor;
import org.onap.ccsdk.features.sdnr.wt.websocketmanager.model.WebsocketManagerService;
import org.opendaylight.mdsal.dom.api.DOMEvent;
import org.opendaylight.mdsal.dom.api.DOMNotification;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.FaultlogEntity;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId;
-import org.opendaylight.yangtools.yang.common.QName;
+import org.opendaylight.yangtools.yang.common.QNameModule;
+import org.opendaylight.yangtools.yang.common.Revision;
+import org.opendaylight.yangtools.yang.common.XMLNamespace;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
import org.opendaylight.yangtools.yang.data.impl.schema.Builders;
@@ -89,6 +96,8 @@ public class TestORanDOMFaultNotificationListener {
@Mock
DataProvider databaseService;
VESCollectorService vesCollectorService;
+ static Optional<ORANFM> oranfm;
+ private Capabilities capabilities;
@After
@Before
@@ -98,6 +107,11 @@ public class TestORanDOMFaultNotificationListener {
LOG.info("Remove {}", f.getAbsolutePath());
f.delete();
}
+ capabilities = mock(Capabilities.class);
+ when(domAccessor.getCapabilites()).thenReturn(capabilities);
+ when(capabilities.isSupportingNamespaceAndRevision(
+ QNameModule.create(XMLNamespace.of(ORANFM.NAMESPACE), Revision.of("2022-08-15")))).thenReturn(true);
+ oranfm = ORANFM.getModule(domAccessor);
}
@Test
@@ -105,7 +119,7 @@ public class TestORanDOMFaultNotificationListener {
Files.asCharSink(new File(TESTFILENAME), StandardCharsets.UTF_8).write(TESTCONFIG_CONTENT);
vesCollectorService = new VESCollectorServiceImpl(new ConfigurationFileRepresentation(TESTFILENAME));
when(domAccessor.getNodeId()).thenReturn(new NodeId("nSky"));
- ORanDOMFaultNotificationListener faultListener = new ORanDOMFaultNotificationListener(domAccessor,
+ ORanDOMFaultNotificationListener faultListener = new ORanDOMFaultNotificationListener(domAccessor, oranfm,
vesCollectorService, faultService, websocketManagerService, databaseService);
NetconfDeviceNotification ndn = new NetconfDeviceNotification(createORANDOMFault(), Instant.now());
faultListener.onNotification(ndn);
@@ -114,20 +128,14 @@ public class TestORanDOMFaultNotificationListener {
}
public static ContainerNode createORANDOMFault() {
- final QName fault_id = QName.create(ORanDeviceManagerQNames.ORAN_FM_ALARM_NOTIF, "fault-id");
- final QName fault_source = QName.create(ORanDeviceManagerQNames.ORAN_FM_ALARM_NOTIF, "fault-source");
- final QName fault_severity = QName.create(ORanDeviceManagerQNames.ORAN_FM_ALARM_NOTIF, "fault-severity");
- final QName is_cleared = QName.create(ORanDeviceManagerQNames.ORAN_FM_ALARM_NOTIF, "is-cleared");
- final QName fault_text = QName.create(ORanDeviceManagerQNames.ORAN_FM_ALARM_NOTIF, "fault-text");
- return Builders.containerBuilder().withNodeIdentifier(NodeIdentifier.create(ORanDeviceManagerQNames.ORAN_FM_ALARM_NOTIF))
- .withChild(ImmutableNodes.leafNode(fault_id, "47"))
- .withChild(ImmutableNodes.leafNode(fault_source, "Slot-2-Port-B"))
- .withChild(ImmutableNodes.leafNode(fault_severity, "MAJOR"))
- .withChild(ImmutableNodes.leafNode(is_cleared, "true"))
- .withChild(ImmutableNodes.leafNode(fault_text, "CPRI Port Down")).build();
+ return Builders.containerBuilder().withNodeIdentifier(NodeIdentifier.create(oranfm.get().getAlarmNotifQName()))
+ .withChild(ImmutableNodes.leafNode(oranfm.get().getFaultIdQName(), "47"))
+ .withChild(ImmutableNodes.leafNode(oranfm.get().getFaultSourceQName(), "Slot-2-Port-B"))
+ .withChild(ImmutableNodes.leafNode(oranfm.get().getFaultSeverityQName(), "MAJOR"))
+ .withChild(ImmutableNodes.leafNode(oranfm.get().getFaultIsClearedQName(), "true"))
+ .withChild(ImmutableNodes.leafNode(oranfm.get().getFaultTextQName(), "CPRI Port Down")).build();
}
-
public static class NetconfDeviceNotification implements DOMNotification, DOMEvent {
private final ContainerNode content;
private final Absolute schemaPath;
diff --git a/sdnr/wt/devicemanager-o-ran-sc/o-ran/ru-fh/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/impl/dom/TestORanDOMNetworkElement.java b/sdnr/wt/devicemanager-o-ran-sc/o-ran/ru-fh/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/impl/dom/TestORanDOMNetworkElement.java
index 283d122b0..7fd947211 100644
--- a/sdnr/wt/devicemanager-o-ran-sc/o-ran/ru-fh/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/impl/dom/TestORanDOMNetworkElement.java
+++ b/sdnr/wt/devicemanager-o-ran-sc/o-ran/ru-fh/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/impl/dom/TestORanDOMNetworkElement.java
@@ -21,17 +21,25 @@
*/
package org.onap.ccsdk.features.sdnr.wt.devicemanager.oran.impl.dom;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
+import com.google.common.io.Files;
+import java.io.File;
import java.io.IOException;
+import java.nio.charset.StandardCharsets;
import java.util.Optional;
import org.eclipse.jdt.annotation.NonNull;
import org.junit.BeforeClass;
import org.junit.Test;
+import org.onap.ccsdk.features.sdnr.wt.common.configuration.ConfigurationFileRepresentation;
import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.DataProvider;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.ne.service.NetworkElement;
+import org.onap.ccsdk.features.sdnr.wt.devicemanager.oran.config.ORanDMConfig;
+import org.onap.ccsdk.features.sdnr.wt.devicemanager.oran.util.ORanDeviceManagerQNames;
+import org.onap.ccsdk.features.sdnr.wt.devicemanager.oran.yangspecs.ORANFM;
+import org.onap.ccsdk.features.sdnr.wt.devicemanager.oran.yangspecs.OnapSystem;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.DeviceManagerServiceProvider;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.FaultService;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.NotificationProxyParser;
@@ -43,12 +51,15 @@ import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfDomAccesso
import org.onap.ccsdk.features.sdnr.wt.websocketmanager.model.WebsocketManagerService;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId;
import org.opendaylight.yangtools.yang.common.QName;
+import org.opendaylight.yangtools.yang.common.QNameModule;
+import org.opendaylight.yangtools.yang.common.Revision;
+import org.opendaylight.yangtools.yang.common.XMLNamespace;
public class TestORanDOMNetworkElement {
private static final QName OneCell =
QName.create("urn:onf:otcc:wireless:yang:radio-access:commscope-onecell", "2020-06-22", "onecell").intern();
- private static final @NonNull QName OnapSystem =
+ private static final @NonNull QName OnapSystem1 =
QName.create("urn:onap:system", "2020-10-26", "onap-system").intern();
private static String NODEIDSTRING = "nSky";
private static NodeId nodeId = new NodeId(NODEIDSTRING);
@@ -61,6 +72,16 @@ public class TestORanDOMNetworkElement {
private static NotificationProxyParser notificationProxyParser;
private static VESCollectorCfgService vesCfgService;
private static WebsocketManagerService websocketManagerService;
+ private static ORanDMConfig oranDmConfig;
+ private static ConfigurationFileRepresentation oranCfg;
+
+ private static String fileName = "test1.properties";
+ // @formatter:off
+ private static final String TESTCONFIG_CONTENT = "[ORAN-SUPERVISION]\n"
+ + "supervision-notification-interval=60\n"
+ + "guard-timer-overhead=10\n"
+ + "";
+ // @formatter:on
@BeforeClass
public static void init() throws InterruptedException, IOException {
@@ -72,6 +93,7 @@ public class TestORanDOMNetworkElement {
notificationProxyParser = mock(NotificationProxyParser.class);
vesCfgService = mock(VESCollectorCfgService.class);
websocketManagerService = mock(WebsocketManagerService.class);
+ oranDmConfig = mock(ORanDMConfig.class);
when(accessor.getCapabilites()).thenReturn(capabilities);
when(accessor.getNodeId()).thenReturn(nodeId);
@@ -79,6 +101,10 @@ public class TestORanDOMNetworkElement {
when(domAccessor.getNodeId()).thenReturn(nodeId);
when(domAccessor.getCapabilites()).thenReturn(capabilities);
when(vesCollectorService.getNotificationProxyParser()).thenReturn(notificationProxyParser);
+ when(capabilities.isSupportingNamespaceAndRevision(
+ QNameModule.create(XMLNamespace.of(ORANFM.NAMESPACE), Revision.of("2022-08-15")))).thenReturn(true);
+ when(capabilities.isSupportingNamespaceAndRevision(
+ QNameModule.create(XMLNamespace.of(OnapSystem.NAMESPACE), Revision.of("2022-11-04")))).thenReturn(true);
DataProvider dataProvider = mock(DataProvider.class);
FaultService faultService = mock(FaultService.class);
@@ -89,6 +115,8 @@ public class TestORanDOMNetworkElement {
when(vesCollectorService.getConfig()).thenReturn(vesCfgService);
when(vesCfgService.isVESCollectorEnabled()).thenReturn(true);
+ Files.asCharSink(new File(fileName), StandardCharsets.UTF_8).write(TESTCONFIG_CONTENT);
+ oranCfg = new ConfigurationFileRepresentation(fileName);
}
@Test
@@ -96,9 +124,9 @@ public class TestORanDOMNetworkElement {
Optional<NetworkElement> oRanNe;
when(capabilities.isSupportingNamespace(ORanDeviceManagerQNames.ORAN_HW_COMPONENT)).thenReturn(true);
when(capabilities.isSupportingNamespace(OneCell)).thenReturn(false);
- when(capabilities.isSupportingNamespace(OnapSystem)).thenReturn(false);
+ when(capabilities.isSupportingNamespace(OnapSystem1)).thenReturn(false);
- ORanNetworkElementFactory factory = new ORanNetworkElementFactory();
+ ORanNetworkElementFactory factory = new ORanNetworkElementFactory(oranCfg, oranDmConfig);
oRanNe = factory.create(accessor, serviceProvider);
assertTrue(factory.create(accessor, serviceProvider).isPresent());
oRanNe.get().register();
diff --git a/sdnr/wt/devicemanager-o-ran-sc/o-ran/ru-fh/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/impl/dom/TestORanDOMNotification.java b/sdnr/wt/devicemanager-o-ran-sc/o-ran/ru-fh/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/impl/dom/TestORanDOMNotification.java
index 1665ac1ad..96983b1ba 100644
--- a/sdnr/wt/devicemanager-o-ran-sc/o-ran/ru-fh/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/impl/dom/TestORanDOMNotification.java
+++ b/sdnr/wt/devicemanager-o-ran-sc/o-ran/ru-fh/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/impl/dom/TestORanDOMNotification.java
@@ -29,6 +29,8 @@ import java.time.Instant;
import org.junit.BeforeClass;
import org.junit.Test;
import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.DataProvider;
+import org.onap.ccsdk.features.sdnr.wt.devicemanager.oran.notification.ORanDOMChangeNotificationListener;
+import org.onap.ccsdk.features.sdnr.wt.devicemanager.oran.util.ORanDeviceManagerQNames;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.VESCollectorCfgService;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.VESCollectorService;
import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfDomAccessor;
@@ -141,7 +143,6 @@ public class TestORanDOMNotification {
@Test
public void test() {
ContainerNode cn = createDOMNotificationBody();
- System.out.println(cn.toString());
NetconfDeviceNotification ndn = new NetconfDeviceNotification(cn, Instant.now());
ORanDOMChangeNotificationListener changeListener = new ORanDOMChangeNotificationListener(domAccessor, vesCollectorService, databaseService);
changeListener.onNotification(ndn);
diff --git a/sdnr/wt/devicemanager-o-ran-sc/o-ran/ru-fh/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/impl/dom/TestORanDOMToInternalDataModel.java b/sdnr/wt/devicemanager-o-ran-sc/o-ran/ru-fh/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/impl/dom/TestORanDOMToInternalDataModel.java
index 5ce758210..01502e49c 100644
--- a/sdnr/wt/devicemanager-o-ran-sc/o-ran/ru-fh/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/impl/dom/TestORanDOMToInternalDataModel.java
+++ b/sdnr/wt/devicemanager-o-ran-sc/o-ran/ru-fh/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/impl/dom/TestORanDOMToInternalDataModel.java
@@ -22,6 +22,8 @@
package org.onap.ccsdk.features.sdnr.wt.devicemanager.oran.impl.dom;
import static org.junit.Assert.assertEquals;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
import com.google.common.collect.Sets;
import java.io.IOException;
import java.io.InputStream;
@@ -33,9 +35,13 @@ import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamReader;
import org.junit.AfterClass;
import org.junit.BeforeClass;
-import org.junit.Ignore;
import org.junit.Test;
+import org.onap.ccsdk.features.sdnr.wt.devicemanager.oran.dataprovider.ORanDOMToInternalDataModel;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.oran.impl.dom.util.TestYangParserUtil;
+import org.onap.ccsdk.features.sdnr.wt.devicemanager.oran.yangspecs.ORANFM;
+import org.onap.ccsdk.features.sdnr.wt.devicemanager.oran.yangspecs.OnapSystem;
+import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.Capabilities;
+import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfDomAccessor;
import org.opendaylight.mdsal.dom.api.DOMEvent;
import org.opendaylight.mdsal.dom.api.DOMNotification;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.FaultlogEntity;
@@ -48,10 +54,12 @@ import org.opendaylight.yangtools.yang.common.QNameModule;
import org.opendaylight.yangtools.yang.common.Revision;
import org.opendaylight.yangtools.yang.common.XMLNamespace;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
-import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.AugmentationIdentifier;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
+import org.opendaylight.yangtools.yang.data.api.schema.AugmentationNode;
import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
+import org.opendaylight.yangtools.yang.data.api.schema.UnkeyedListEntryNode;
+import org.opendaylight.yangtools.yang.data.api.schema.UnkeyedListNode;
import org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWriter;
import org.opendaylight.yangtools.yang.data.codec.xml.XmlParserStream;
import org.opendaylight.yangtools.yang.data.impl.schema.Builders;
@@ -73,9 +81,18 @@ public class TestORanDOMToInternalDataModel {
QNameModule.create(XMLNamespace.of("urn:ietf:params:xml:ns:yang:ietf-system"), Revision.of("2014-08-06"));
private static final QName IETF_CONTAINER = QName.create(IETF_SYSTEM_MODULE, "system");
+ private static final QNameModule ORAN_MODULE =
+ QNameModule.create(XMLNamespace.of("urn:o-ran:fm:1.0"), Revision.of("2022-08-15"));
+ private static final QName ORAN_ACTIVE_ALARM_CONTAINER = QName.create(ORAN_MODULE, "active-alarm-list");
+
private static EffectiveModelContext schemaContext;
private static Inference hwContainerSchema;
private static Inference systemSchema;
+ private static Inference activeAlarmSchema;
+ private static Capabilities capabilities;
+ private static Optional<OnapSystem> onapSystem;
+ private static Optional<ORANFM> oranfm;
+ private static NetconfDomAccessor domAccessor;
private static final NodeId nodeId = new NodeId("nSky");
@@ -84,6 +101,18 @@ public class TestORanDOMToInternalDataModel {
schemaContext = TestYangParserUtil.parseYangResourceDirectory("/");
hwContainerSchema = Inference.ofDataTreePath(schemaContext, HW_CONTAINER);
systemSchema = Inference.ofDataTreePath(schemaContext, IETF_CONTAINER);
+ activeAlarmSchema = Inference.ofDataTreePath(schemaContext, ORAN_ACTIVE_ALARM_CONTAINER);
+
+ capabilities = mock(Capabilities.class);
+ domAccessor = mock(NetconfDomAccessor.class);
+ when(domAccessor.getCapabilites()).thenReturn(capabilities);
+ when(capabilities.isSupportingNamespaceAndRevision(
+ QNameModule.create(XMLNamespace.of(OnapSystem.NAMESPACE), Revision.of("2022-11-04")))).thenReturn(true);
+ onapSystem = OnapSystem.getModule(domAccessor);
+ when(capabilities.isSupportingNamespaceAndRevision(
+ QNameModule.create(XMLNamespace.of(ORANFM.NAMESPACE), Revision.of("2022-08-15")))).thenReturn(true);
+ oranfm = ORANFM.getModule(domAccessor);
+
}
@AfterClass
@@ -91,12 +120,14 @@ public class TestORanDOMToInternalDataModel {
schemaContext = null;
hwContainerSchema = null;
systemSchema = null;
+ activeAlarmSchema = null;
}
@Test
public void testIetfHardwareFromXML() throws XMLStreamException, URISyntaxException, IOException, SAXException {
- final InputStream resourceAsStream = TestORanDOMToInternalDataModel.class.getResourceAsStream("/ietf-hardware.xml");
+ final InputStream resourceAsStream =
+ TestORanDOMToInternalDataModel.class.getResourceAsStream("/ietf-hardware.xml");
/*
* final XMLInputFactory factory = XMLInputFactory.newInstance();
@@ -121,11 +152,11 @@ public class TestORanDOMToInternalDataModel {
inventoryList.stream().filter(inventory -> inventory.getTreeLevel() == null).count());
}
- @Ignore //TODO
@Test
public void testIetfSystemFromXML() throws XMLStreamException, URISyntaxException, IOException, SAXException {
- final InputStream resourceAsStream = TestORanDOMToInternalDataModel.class.getResourceAsStream("/onap-system.xml");
+ final InputStream resourceAsStream =
+ TestORanDOMToInternalDataModel.class.getResourceAsStream("/onap-system.xml");
final XMLStreamReader reader = UntrustedXML.createXMLStreamReader(resourceAsStream);
@@ -140,9 +171,10 @@ public class TestORanDOMToInternalDataModel {
NormalizedNode transformedInput = result.getResult();
ContainerNode cn = (ContainerNode) transformedInput;
- AugmentationIdentifier onapSystemIID = YangInstanceIdentifier.AugmentationIdentifier.create(
- Sets.newHashSet(ORanDeviceManagerQNames.ONAP_SYSTEM_NAME, ORanDeviceManagerQNames.ONAP_SYSTEM_WEB_UI));
- Optional<Guicutthrough> gc = ORanDOMToInternalDataModel.getGuicutthrough(cn.getChildByArg(onapSystemIID));
+ AugmentationNode gcData = (AugmentationNode) cn.childByArg(
+ YangInstanceIdentifier.AugmentationIdentifier.create(Sets.newHashSet(onapSystem.get().getName(),
+ onapSystem.get().getWebUi(), onapSystem.get().getGeoLocation())));
+ Optional<Guicutthrough> gc = ORanDOMToInternalDataModel.getGuicutthrough(gcData, onapSystem.get());
assertEquals(gc.isPresent(), true);
}
@@ -151,23 +183,40 @@ public class TestORanDOMToInternalDataModel {
public void testORANFault() {
ContainerNode cn = createORANDOMFault();
NetconfDeviceNotification faultNotif = new NetconfDeviceNotification(cn, Instant.now());
- FaultlogEntity fle = ORanDOMToInternalDataModel.getFaultLog(faultNotif, nodeId, 1);
+ FaultlogEntity fle = ORanDOMToInternalDataModel.getFaultLog(faultNotif, oranfm.get(), nodeId, 1);
assertEquals(fle.getId(), "47");
}
+ @Test
+ public void testORANActiveAlarms() throws XMLStreamException, URISyntaxException, IOException, SAXException {
+ final InputStream resourceAsStream =
+ TestORanDOMToInternalDataModel.class.getResourceAsStream("/oran-fm-active-alarm.xml");
+
+ final XMLStreamReader reader = UntrustedXML.createXMLStreamReader(resourceAsStream);
+ final NormalizedNodeResult result = new NormalizedNodeResult();
+ final NormalizedNodeStreamWriter streamWriter = ImmutableNormalizedNodeStreamWriter.from(result);
+
+ final XmlParserStream xmlParser = XmlParserStream.create(streamWriter, activeAlarmSchema);
+ xmlParser.parse(reader);
+
+ xmlParser.flush();
+ xmlParser.close();
+ NormalizedNode transformedInput = result.getResult();
+ ContainerNode cn = (ContainerNode) transformedInput;
+
+ UnkeyedListNode activeAlarmsList =
+ (UnkeyedListNode) cn.childByArg(new NodeIdentifier(oranfm.get().getFaultActiveAlarmsQName()));
+ for (UnkeyedListEntryNode activeAlarmEntry : activeAlarmsList.body())
+ ORanDOMToInternalDataModel.getFaultLog(activeAlarmEntry, oranfm.get(), new NodeId("nSky"), Integer.valueOf(0));
+ }
+
public static ContainerNode createORANDOMFault() {
- final QName fault_id = QName.create(ORanDeviceManagerQNames.ORAN_FM_FAULT_ID, "fault-id");
- final QName fault_source = QName.create(ORanDeviceManagerQNames.ORAN_FM_FAULT_SOURCE, "fault-source");
- final QName fault_severity = QName.create(ORanDeviceManagerQNames.ORAN_FM_FAULT_SEVERITY, "fault-severity");
- final QName is_cleared = QName.create(ORanDeviceManagerQNames.ORAN_FM_FAULT_IS_CLEARED, "is-cleared");
- final QName fault_text = QName.create(ORanDeviceManagerQNames.ORAN_FM_FAULT_TEXT, "fault-text");
- return Builders.containerBuilder()
- .withNodeIdentifier(NodeIdentifier.create(ORanDeviceManagerQNames.ORAN_FM_ALARM_NOTIF))
- .withChild(ImmutableNodes.leafNode(fault_id, "47"))
- .withChild(ImmutableNodes.leafNode(fault_source, "Slot-2-Port-B"))
- .withChild(ImmutableNodes.leafNode(fault_severity, "MAJOR"))
- .withChild(ImmutableNodes.leafNode(is_cleared, "true"))
- .withChild(ImmutableNodes.leafNode(fault_text, "CPRI Port Down")).build();
+ return Builders.containerBuilder().withNodeIdentifier(NodeIdentifier.create(oranfm.get().getAlarmNotifQName()))
+ .withChild(ImmutableNodes.leafNode(oranfm.get().getFaultIdQName(), "47"))
+ .withChild(ImmutableNodes.leafNode(oranfm.get().getFaultSourceQName(), "Slot-2-Port-B"))
+ .withChild(ImmutableNodes.leafNode(oranfm.get().getFaultSeverityQName(), "MAJOR"))
+ .withChild(ImmutableNodes.leafNode(oranfm.get().getFaultIsClearedQName(), "true"))
+ .withChild(ImmutableNodes.leafNode(oranfm.get().getFaultTextQName(), "CPRI Port Down")).build();
}
public static class NetconfDeviceNotification implements DOMNotification, DOMEvent {
diff --git a/sdnr/wt/devicemanager-o-ran-sc/o-ran/ru-fh/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/impl/dom/TestORanNetworkElementFactory.java b/sdnr/wt/devicemanager-o-ran-sc/o-ran/ru-fh/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/impl/dom/TestORanNetworkElementFactory.java
index 2ca2ee445..cad0994cc 100644
--- a/sdnr/wt/devicemanager-o-ran-sc/o-ran/ru-fh/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/impl/dom/TestORanNetworkElementFactory.java
+++ b/sdnr/wt/devicemanager-o-ran-sc/o-ran/ru-fh/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/impl/dom/TestORanNetworkElementFactory.java
@@ -17,83 +17,110 @@
*/
package org.onap.ccsdk.features.sdnr.wt.devicemanager.oran.impl.dom;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
+import com.google.common.io.Files;
+import java.io.File;
import java.io.IOException;
+import java.nio.charset.StandardCharsets;
import java.util.Optional;
import org.junit.After;
import org.junit.BeforeClass;
import org.junit.Test;
+import org.onap.ccsdk.features.sdnr.wt.common.configuration.ConfigurationFileRepresentation;
import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.DataProvider;
+import org.onap.ccsdk.features.sdnr.wt.devicemanager.oran.config.ORanDMConfig;
+import org.onap.ccsdk.features.sdnr.wt.devicemanager.oran.util.ORanDeviceManagerQNames;
+import org.onap.ccsdk.features.sdnr.wt.devicemanager.oran.yangspecs.ORANFM;
+import org.onap.ccsdk.features.sdnr.wt.devicemanager.oran.yangspecs.OnapSystem;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.DeviceManagerServiceProvider;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.FaultService;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.VESCollectorService;
import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.Capabilities;
import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfAccessor;
-import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfBindingAccessor;
import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfDomAccessor;
-import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.TransactionUtils;
import org.onap.ccsdk.features.sdnr.wt.websocketmanager.model.WebsocketManagerService;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId;
+import org.opendaylight.yangtools.yang.common.QNameModule;
+import org.opendaylight.yangtools.yang.common.Revision;
+import org.opendaylight.yangtools.yang.common.XMLNamespace;
public class TestORanNetworkElementFactory {
private static String NODEIDSTRING = "nSky";
private static NetconfAccessor accessor;
+ private static NetconfDomAccessor domAccessor;
private static DeviceManagerServiceProvider serviceProvider;
private static Capabilities capabilities;
private static VESCollectorService vesCollectorService;
private static FaultService faultService;
private static WebsocketManagerService notificationService;
private static DataProvider databaseService;
+ private static ORanDMConfig oranDmConfig;
+ private static ConfigurationFileRepresentation oranCfg;
private static NodeId nodeId = new NodeId(NODEIDSTRING);
- @BeforeClass
- public static void init() throws InterruptedException, IOException {
- NetconfBindingAccessor bindingAccessor = mock(NetconfBindingAccessor.class);
- when(bindingAccessor.getTransactionUtils()).thenReturn(mock(TransactionUtils.class));
- when(bindingAccessor.getNodeId()).thenReturn(nodeId);
+ private static String fileName = "test1.properties";
+ // @formatter:off
+ private static final String TESTCONFIG_CONTENT = "[ORAN-SUPERVISION]\n"
+ + "supervision-notification-interval=60\n"
+ + "guard-timer-overhead=10\n"
+ + "";
+ // @formatter:on
- NetconfDomAccessor domAccessor = mock(NetconfDomAccessor.class);
- when(domAccessor.getNodeId()).thenReturn(nodeId);
- capabilities = mock(Capabilities.class);
- //accessor = mock(NetconfBindingAccessor.class);
+ @BeforeClass
+ public static void init() throws InterruptedException, IOException {
accessor = mock(NetconfAccessor.class);
+ domAccessor = mock(NetconfDomAccessor.class);
+ capabilities = mock(Capabilities.class);
serviceProvider = mock(DeviceManagerServiceProvider.class);
vesCollectorService = mock(VESCollectorService.class);
faultService = mock(FaultService.class);
notificationService = mock(WebsocketManagerService.class);
databaseService = mock(DataProvider.class);
+ oranDmConfig = mock(ORanDMConfig.class);
+ when(domAccessor.getCapabilites()).thenReturn(capabilities);
+ when(domAccessor.getNodeId()).thenReturn(nodeId);
when(accessor.getCapabilites()).thenReturn(capabilities);
- when(accessor.getNetconfBindingAccessor()).thenReturn(Optional.of(bindingAccessor));
when(accessor.getNetconfDomAccessor()).thenReturn(Optional.of(domAccessor));
when(serviceProvider.getFaultService()).thenReturn(faultService);
when(serviceProvider.getWebsocketService()).thenReturn(notificationService);
when(serviceProvider.getDataProvider()).thenReturn(databaseService);
when(serviceProvider.getVESCollectorService()).thenReturn(vesCollectorService);
+ when(capabilities.isSupportingNamespaceAndRevision(
+ QNameModule.create(XMLNamespace.of(ORANFM.NAMESPACE), Revision.of("2022-08-15")))).thenReturn(true);
+ when(capabilities.isSupportingNamespaceAndRevision(
+ QNameModule.create(XMLNamespace.of(OnapSystem.NAMESPACE), Revision.of("2022-11-04")))).thenReturn(true);
+ Files.asCharSink(new File(fileName), StandardCharsets.UTF_8).write(TESTCONFIG_CONTENT);
+ oranCfg = new ConfigurationFileRepresentation(fileName);
}
@Test
public void testCreateORANHWComponent() throws Exception {
- when(accessor.getCapabilites().isSupportingNamespace(ORanDeviceManagerQNames.ORAN_HW_COMPONENT)).thenReturn(true);
- ORanNetworkElementFactory factory = new ORanNetworkElementFactory();
+ when(domAccessor.getCapabilites().isSupportingNamespace(ORanDeviceManagerQNames.ORAN_HW_COMPONENT)).thenReturn(true);
+ ORanNetworkElementFactory factory = new ORanNetworkElementFactory(oranCfg, oranDmConfig);
assertTrue((factory.create(accessor, serviceProvider)).isPresent());
}
@Test
public void testCreateNone() throws Exception {
- when(accessor.getCapabilites().isSupportingNamespace(ORanDeviceManagerQNames.ORAN_HW_COMPONENT)).thenReturn(false);
- ORanNetworkElementFactory factory = new ORanNetworkElementFactory();
+ when(domAccessor.getCapabilites().isSupportingNamespace(ORanDeviceManagerQNames.ORAN_HW_COMPONENT)).thenReturn(false);
+ ORanNetworkElementFactory factory = new ORanNetworkElementFactory(oranCfg, oranDmConfig);
assertTrue(!(factory.create(accessor, serviceProvider).isPresent()));
}
@After
public void cleanUp() throws Exception {
+ File file = new File(fileName);
+ if (file.exists()) {
+ System.out.println("File exists, Deleting it");
+ file.delete();
+ }
}
}
diff --git a/sdnr/wt/devicemanager-o-ran-sc/o-ran/ru-fh/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/impl/dom/TestORanRegistrationToVESpnfRegistration.java b/sdnr/wt/devicemanager-o-ran-sc/o-ran/ru-fh/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/impl/dom/TestORanRegistrationToVESpnfRegistration.java
index b46595293..ad1fcede3 100644
--- a/sdnr/wt/devicemanager-o-ran-sc/o-ran/ru-fh/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/impl/dom/TestORanRegistrationToVESpnfRegistration.java
+++ b/sdnr/wt/devicemanager-o-ran-sc/o-ran/ru-fh/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/impl/dom/TestORanRegistrationToVESpnfRegistration.java
@@ -22,12 +22,13 @@
package org.onap.ccsdk.features.sdnr.wt.devicemanager.oran.impl.dom;
import static org.junit.Assert.assertEquals;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
import org.mockito.junit.MockitoJUnitRunner;
+import org.onap.ccsdk.features.sdnr.wt.devicemanager.oran.vesmapper.ORanRegistrationToVESpnfRegistrationMapper;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.VESCollectorCfgService;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.VESCollectorService;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.types.VESCommonEventHeaderPOJO;
diff --git a/sdnr/wt/devicemanager-o-ran-sc/o-ran/ru-fh/provider/src/test/resources/o-ran-fm@2022-08-15.yang b/sdnr/wt/devicemanager-o-ran-sc/o-ran/ru-fh/provider/src/test/resources/o-ran-fm@2022-08-15.yang
new file mode 100644
index 000000000..2abcc1ecc
--- /dev/null
+++ b/sdnr/wt/devicemanager-o-ran-sc/o-ran/ru-fh/provider/src/test/resources/o-ran-fm@2022-08-15.yang
@@ -0,0 +1,153 @@
+module o-ran-fm {
+ yang-version 1.1;
+ namespace "urn:o-ran:fm:1.0";
+ prefix o-ran-fm;
+
+ import ietf-yang-types {
+ prefix yang;
+ revision-date 2013-07-15;
+ }
+
+ organization
+ "O-RAN Alliance";
+ contact
+ "www.o-ran.org";
+ description
+ "This module defines alarm reporting mechanism.
+
+ Copyright 2019 the O-RAN Alliance.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS'
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the above disclaimer.
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the above disclaimer in the documentation
+ and/or other materials provided with the distribution.
+ * Neither the Members of the O-RAN Alliance nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.";
+
+ revision 2022-08-15 {
+ description
+ "version 1.0.0
+
+ 1) imported model from xRAN
+ 2) changed namespace and reference from xran to o-ran";
+ reference
+ "ORAN-WG4.M.0-v01.00";
+ }
+
+ grouping alarm {
+ description
+ "Gropuping which can uniquely identify alarm";
+ leaf fault-id {
+ type uint16;
+ mandatory true;
+ description
+ "Fault specific Id that identifies the fault.";
+ }
+
+ leaf fault-source {
+ type string {
+ length "1..255";
+ }
+ mandatory true;
+ description
+ "Represents the Object or source that is suspected to be faulty.";
+ }
+
+ list affected-objects {
+ min-elements 1;
+ max-elements 100;
+ description
+ "List of affected-objects";
+ leaf name {
+ type string {
+ length "1..255";
+ }
+ mandatory true;
+ description
+ "Represents the Object or source that is suspected to be affected by this fault";
+ }
+ }
+
+ leaf fault-severity {
+ type enumeration {
+ enum "CRITICAL" {
+ description
+ "Critical alarm means that this device is not able to perform any further service";
+ }
+ enum "MAJOR" {
+ description
+ "Major alarm appeared on the device";
+ }
+ enum "MINOR" {
+ description
+ "Minor alarm appeared on the device";
+ }
+ enum "WARNING" {
+ description
+ "Warning is being reported by the device";
+ }
+ }
+ mandatory true;
+ description
+ "Fault severity defines the severity level of the fault. A notification, whose fault severity has the value 'warning',
+ is a special type of an alarm notification. For these alarm notifications,
+ the Master Agent does not expect to receive a clear alarm notification.";
+ }
+
+ leaf is-cleared {
+ type boolean;
+ mandatory true;
+ description
+ "Fault state determines the type of the event. Not used if faultSeverity is WARNING.";
+ }
+
+ leaf fault-text {
+ type string {
+ length "0..255";
+ }
+ description
+ "Textual description of the fault.";
+ }
+
+ leaf event-time {
+ type yang:date-and-time;
+ mandatory true;
+ description
+ "Timestamp to indicate the time when the fault is detected/cleared.";
+ }
+ }
+
+ container active-alarm-list {
+ config false;
+ description
+ "List of currently active alarms. An alarm is removed from this table when the state transitions to clear.";
+ list active-alarms {
+ description
+ "List of currenty active alarms";
+ uses alarm;
+ }
+ }
+
+ notification alarm-notif {
+ description
+ "Notification sent on initial alarm creation, as well as any time the alarm changes state, including clear";
+ uses alarm;
+ }
+} \ No newline at end of file
diff --git a/sdnr/wt/devicemanager-o-ran-sc/o-ran/ru-fh/provider/src/test/resources/oran-fm-active-alarm.xml b/sdnr/wt/devicemanager-o-ran-sc/o-ran/ru-fh/provider/src/test/resources/oran-fm-active-alarm.xml
new file mode 100644
index 000000000..263a75856
--- /dev/null
+++ b/sdnr/wt/devicemanager-o-ran-sc/o-ran/ru-fh/provider/src/test/resources/oran-fm-active-alarm.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<active-alarm-list xmlns="urn:o-ran:fm:1.0">
+ <active-alarms>
+ <fault-id>10001</fault-id>
+ <is-cleared>false</is-cleared>
+ <event-time>2021-03-18T19:51:50.4Z</event-time>
+ <affected-objects>
+ <name>slot0-logical0</name>
+ </affected-objects>
+ <fault-severity>MAJOR</fault-severity>
+ <fault-source>/ietf-hardware:hardware/component[name='slot0-logical0']</fault-source>
+ <fault-text>cpriPortDown</fault-text>
+ </active-alarms>
+ <active-alarms>
+ <fault-id>10002</fault-id>
+ <is-cleared>false</is-cleared>
+ <event-time>2021-03-18T19:52:50.4Z</event-time>
+ <affected-objects>
+ <name>slot2-logical2</name>
+ </affected-objects>
+ <fault-severity>MAJOR</fault-severity>
+ <fault-source>/ietf-hardware:hardware/component[name='slot2-logical2']</fault-source>
+ <fault-text>cpriPortDown</fault-text>
+ </active-alarms>
+</active-alarm-list>