<parent>
<groupId>org.opendaylight.mdsal</groupId>
<artifactId>binding-parent</artifactId>
- <version>10.0.3</version>
+ <version>10.0.5</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.mdsal</groupId>
<artifactId>binding-parent</artifactId>
- <version>10.0.3</version>
+ <version>10.0.5</version>
<relativePath/>
</parent>
<dependency>
<groupId>org.opendaylight.netconf</groupId>
<artifactId>netconf-artifacts</artifactId>
- <version>4.0.3</version>
+ <version>4.0.4</version>
<scope>import</scope>
<type>pom</type>
</dependency>
<parent>
<groupId>org.opendaylight.mdsal</groupId>
<artifactId>binding-parent</artifactId>
- <version>10.0.3</version>
+ <version>10.0.5</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>11.0.2</version>
+ <version>11.0.3</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>11.0.2</version>
+ <version>11.0.3</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>11.0.2</version>
+ <version>11.0.3</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>11.0.2</version>
+ <version>11.0.3</version>
<relativePath/>
</parent>
<name>OpenDaylight :: transportpce :: swagger</name>
<properties>
- <netconf.version>4.0.3</netconf.version>
+ <netconf.version>4.0.4</netconf.version>
<configfile.directory>etc/opendaylight/karaf</configfile.directory>
</properties>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>11.0.2</version>
+ <version>11.0.3</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>11.0.2</version>
+ <version>11.0.3</version>
<relativePath/>
</parent>
<name>OpenDaylight :: transportpce</name>
<properties>
- <netconf.version>4.0.3</netconf.version>
+ <netconf.version>4.0.4</netconf.version>
<transportpce.models.version>17.1.0-SNAPSHOT</transportpce.models.version>
<configfile.directory>etc/opendaylight/karaf</configfile.directory>
</properties>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>11.0.2</version>
+ <version>11.0.3</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.mdsal</groupId>
<artifactId>binding-parent</artifactId>
- <version>10.0.3</version>
+ <version>10.0.5</version>
<relativePath/>
</parent>
<packaging>bundle</packaging>
<properties>
+ <!--
+ FIXME: these versions should be communicated from tpce-models' artifacts pom
+ and then should be imported just like netconf below
+ -->
<transportpce.models.version>17.1.0-SNAPSHOT</transportpce.models.version>
</properties>
<dependency>
<groupId>org.opendaylight.netconf</groupId>
<artifactId>netconf-artifacts</artifactId>
- <version>4.0.1</version>
+ <version>4.0.4</version>
<scope>import</scope>
<type>pom</type>
</dependency>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>karaf4-parent</artifactId>
- <version>11.0.2</version>
+ <version>11.0.3</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.mdsal</groupId>
<artifactId>binding-parent</artifactId>
- <version>10.0.3</version>
+ <version>10.0.5</version>
<relativePath/>
</parent>
*/
package org.opendaylight.transportpce.nbinotifications.listener;
-import java.util.HashMap;
import java.util.Map;
import org.opendaylight.transportpce.nbinotifications.producer.Publisher;
+import org.opendaylight.transportpce.nbinotifications.utils.NbiNotificationsUtils;
import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.NbiNotificationsListener;
import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.NotificationAlarmService;
import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.NotificationAlarmServiceBuilder;
import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.PublishNotificationAlarmService;
import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.PublishNotificationProcessService;
import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.PublishTapiNotificationService;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.notification.tapi.service.AdditionalInfo;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.notification.tapi.service.AdditionalInfoBuilder;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.notification.tapi.service.AdditionalInfoKey;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.notification.tapi.service.AlarmInfoBuilder;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.notification.tapi.service.ChangedAttributes;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.notification.tapi.service.ChangedAttributesBuilder;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.notification.tapi.service.ChangedAttributesKey;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.notification.tapi.service.TargetObjectName;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.notification.tapi.service.TargetObjectNameBuilder;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.notification.tapi.service.TargetObjectNameKey;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.notification.tapi.service.TcaInfoBuilder;
-import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.common.rev181210.global._class.Name;
-import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.common.rev181210.global._class.NameBuilder;
-import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.common.rev181210.global._class.NameKey;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
return;
}
Publisher<NotificationTapiService> publisher = tapiPublisherMap.get(topic);
- publisher.sendEvent(new NotificationTapiServiceBuilder(transformTapiNotification(notification))
- .build(), topic);
- }
-
- private NotificationTapiService transformTapiNotification(PublishTapiNotificationService notification) {
- Map<AdditionalInfoKey, AdditionalInfo> addInfoMap = new HashMap<>();
- if (notification.getAdditionalInfo() != null) {
- for (org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.notification.rev181210.notification.AdditionalInfo
- addInfo:notification.getAdditionalInfo().values()) {
- AdditionalInfo transAddInfo = new AdditionalInfoBuilder(addInfo).build();
- addInfoMap.put(transAddInfo.key(), transAddInfo);
- }
- }
- Map<ChangedAttributesKey, ChangedAttributes> changedAttMap = new HashMap<>();
- if (notification.getChangedAttributes() != null) {
- for (org.opendaylight.yang.gen.v1
- .urn.onf.otcc.yang.tapi.notification.rev181210.notification.ChangedAttributes
- changedAtt:notification.getChangedAttributes().values()) {
- ChangedAttributes transChangedAtt = new ChangedAttributesBuilder(changedAtt).build();
- changedAttMap.put(transChangedAtt.key(), transChangedAtt);
- }
- }
- Map<NameKey, Name> nameMap = new HashMap<>();
- if (notification.getName() != null) {
- for (Name name:notification.getName().values()) {
- Name transName = new NameBuilder(name).build();
- nameMap.put(transName.key(), transName);
- }
- }
- Map<TargetObjectNameKey, TargetObjectName> targetObjNameMap = new HashMap<>();
- if (notification.getTargetObjectName() != null) {
- for (org.opendaylight.yang.gen.v1
- .urn.onf.otcc.yang.tapi.notification.rev181210.notification.TargetObjectName
- targetObjectName:notification.getTargetObjectName().values()) {
- TargetObjectName transTargetObjName = new TargetObjectNameBuilder(targetObjectName).build();
- targetObjNameMap.put(transTargetObjName.key(), transTargetObjName);
- }
- }
- LOG.info("Notification uuid = {}", notification.getUuid());
- return new NotificationTapiServiceBuilder()
- .setAlarmInfo(notification.getAlarmInfo() == null ? null
- : new AlarmInfoBuilder(notification.getAlarmInfo()).build())
- .setAdditionalText(notification.getAdditionalText())
- .setAdditionalInfo(addInfoMap)
- .setNotificationType(notification.getNotificationType())
- .setChangedAttributes(changedAttMap)
- .setEventTimeStamp(notification.getEventTimeStamp())
- .setLayerProtocolName(notification.getLayerProtocolName())
- .setName(nameMap)
- .setSequenceNumber(notification.getSequenceNumber())
- .setSourceIndicator(notification.getSourceIndicator())
- .setTargetObjectIdentifier(notification.getTargetObjectIdentifier())
- .setTargetObjectName(targetObjNameMap)
- .setTargetObjectType(notification.getTargetObjectType())
- .setTcaInfo(notification.getTcaInfo() == null ? null
- : new TcaInfoBuilder(notification.getTcaInfo()).build())
- .setUuid(notification.getUuid())
- .build();
+ publisher.sendEvent(new NotificationTapiServiceBuilder(
+ NbiNotificationsUtils.transformTapiNotification(notification)).build(), topic);
}
public void setPublishersServiceMap(Map<String, Publisher<NotificationProcessService>> publishersServiceMap) {
public void setTapiPublishersMap(Map<String, Publisher<NotificationTapiService>> tapiPublishersMap) {
this.tapiPublisherMap = tapiPublishersMap;
}
+
+ public Publisher<NotificationTapiService> getTapiPublisherFromTopic(String topic) {
+ return this.tapiPublisherMap.get(topic);
+ }
}
import java.io.IOException;
import java.io.InputStream;
+import java.util.Map;
import java.util.Properties;
+import java.util.function.Function;
+import java.util.stream.Collectors;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.NotificationTapiService;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.NotificationTapiServiceBuilder;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.PublishTapiNotificationService;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.notification.tapi.service.AdditionalInfo;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.notification.tapi.service.AdditionalInfoBuilder;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.notification.tapi.service.AdditionalInfoKey;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.notification.tapi.service.AlarmInfoBuilder;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.notification.tapi.service.ChangedAttributes;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.notification.tapi.service.ChangedAttributesBuilder;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.notification.tapi.service.ChangedAttributesKey;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.notification.tapi.service.TargetObjectName;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.notification.tapi.service.TargetObjectNameBuilder;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.notification.tapi.service.TargetObjectNameKey;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.notification.tapi.service.TcaInfoBuilder;
+import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.common.rev181210.global._class.Name;
+import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.common.rev181210.global._class.NameKey;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
}
return props;
}
+
+ public static NotificationTapiService transformTapiNotification(PublishTapiNotificationService notification) {
+ Map<AdditionalInfoKey, AdditionalInfo> addInfoMap = notification.nonnullAdditionalInfo().values().stream()
+ .collect(Collectors.toMap(
+ e -> new AdditionalInfoKey(e.getValueName()),
+ e -> new AdditionalInfoBuilder(e).build()));
+ Map<ChangedAttributesKey, ChangedAttributes> changedAttMap = notification.nonnullChangedAttributes().values()
+ .stream().collect(Collectors.toMap(
+ e -> new ChangedAttributesKey(e.getValueName()),
+ e -> new ChangedAttributesBuilder(e).build()));
+ Map<NameKey, Name> nameMap = notification.nonnullName().values().stream()
+ .collect(Collectors.toMap(Name::key, Function.identity()));
+ Map<TargetObjectNameKey, TargetObjectName> targetObjNameMap = notification.nonnullTargetObjectName().values()
+ .stream().collect(Collectors.toMap(
+ e -> new TargetObjectNameKey(e.getValueName()),
+ e -> new TargetObjectNameBuilder(e).build()));
+ LOG.info("Notification uuid = {}", notification.getUuid());
+ return new NotificationTapiServiceBuilder()
+ .setAlarmInfo(notification.getAlarmInfo() == null ? null
+ : new AlarmInfoBuilder(notification.getAlarmInfo()).build())
+ .setAdditionalText(notification.getAdditionalText())
+ .setAdditionalInfo(addInfoMap)
+ .setNotificationType(notification.getNotificationType())
+ .setChangedAttributes(changedAttMap)
+ .setEventTimeStamp(notification.getEventTimeStamp())
+ .setLayerProtocolName(notification.getLayerProtocolName())
+ .setName(nameMap)
+ .setSequenceNumber(notification.getSequenceNumber())
+ .setSourceIndicator(notification.getSourceIndicator())
+ .setTargetObjectIdentifier(notification.getTargetObjectIdentifier())
+ .setTargetObjectName(targetObjNameMap)
+ .setTargetObjectType(notification.getTargetObjectType())
+ .setTcaInfo(notification.getTcaInfo() == null ? null
+ : new TcaInfoBuilder(notification.getTcaInfo()).build())
+ .setUuid(notification.getUuid())
+ .build();
+ }
}
import org.opendaylight.transportpce.test.AbstractTest;
import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.NotificationAlarmService;
import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.NotificationProcessService;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.NotificationTapiService;
import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.get.notifications.alarm.service.output.NotificationsAlarmService;
import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.get.notifications.process.service.output.NotificationsProcessService;
+import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.notification.rev181210.get.notification.list.output.Notification;
public class SubscriberTest extends AbstractTest {
private static final String TOPIC = "topic";
private static final int PARTITION = 0;
private MockConsumer<String, NotificationsProcessService> mockConsumer;
private MockConsumer<String, NotificationsAlarmService> mockConsumerAlarm;
+ private MockConsumer<String, Notification> mockConsumerTapi;
private Subscriber<NotificationProcessService, NotificationsProcessService> subscriberService;
private Subscriber<NotificationAlarmService, NotificationsAlarmService> subscriberAlarmService;
+ private Subscriber<NotificationTapiService, Notification> subscriberTapiService;
@Before
public void setUp() {
mockConsumer = new MockConsumer<>(OffsetResetStrategy.EARLIEST);
mockConsumerAlarm = new MockConsumer<>(OffsetResetStrategy.EARLIEST);
+ mockConsumerTapi = new MockConsumer<>(OffsetResetStrategy.EARLIEST);
subscriberService = new Subscriber<>(mockConsumer);
subscriberAlarmService = new Subscriber<>(mockConsumerAlarm);
+ subscriberTapiService = new Subscriber<>(mockConsumerTapi);
}
@Test
assertEquals("There should be 1 record", 1, result.size());
assertTrue("Consumer should be closed", mockConsumerAlarm.closed());
}
+
+ @Test
+ public void subscribeTapiAlarmShouldBeSuccessful() {
+ // from https://www.baeldung.com/kafka-mockconsumer
+ ConsumerRecord<String, Notification> record = new ConsumerRecord<>(
+ TOPIC, PARTITION, 0L, "key", NotificationServiceDataUtils.buildReceivedTapiAlarmEvent());
+ mockConsumerTapi.schedulePollTask(() -> {
+ mockConsumerTapi.rebalance(Collections.singletonList(new TopicPartition(TOPIC, PARTITION)));
+ mockConsumerTapi.addRecord(record);
+ });
+
+ Map<TopicPartition, Long> startOffsets = new HashMap<>();
+ TopicPartition tp = new TopicPartition(TOPIC, PARTITION);
+ startOffsets.put(tp, 0L);
+ mockConsumerTapi.updateBeginningOffsets(startOffsets);
+ List<Notification> result = subscriberTapiService.subscribe(TOPIC,
+ NotificationTapiService.QNAME);
+ assertEquals("There should be 1 record", 1, result.size());
+ assertTrue("Consumer should be closed", mockConsumerTapi.closed());
+ }
}
*/
package org.opendaylight.transportpce.nbinotifications.impl;
+import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import com.google.common.util.concurrent.ListenableFuture;
import java.util.concurrent.ExecutionException;
import org.junit.Before;
import org.junit.Test;
-import org.mockito.Mock;
import org.opendaylight.transportpce.common.converter.JsonStringConverter;
import org.opendaylight.transportpce.common.network.NetworkTransactionImpl;
import org.opendaylight.transportpce.common.network.NetworkTransactionService;
import org.opendaylight.transportpce.common.network.RequestProcessor;
+import org.opendaylight.transportpce.nbinotifications.utils.NotificationServiceDataUtils;
import org.opendaylight.transportpce.nbinotifications.utils.TopicManager;
import org.opendaylight.transportpce.test.AbstractTest;
import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev211210.ConnectionType;
import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.NotificationAlarmService;
import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.NotificationProcessService;
import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.NotificationTapiService;
+import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.notification.rev181210.CreateNotificationSubscriptionServiceInputBuilder;
+import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.notification.rev181210.CreateNotificationSubscriptionServiceOutput;
+import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.notification.rev181210.GetNotificationListInputBuilder;
+import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.notification.rev181210.GetNotificationListOutput;
import org.opendaylight.yangtools.yang.common.RpcResult;
public class NbiNotificationsImplTest extends AbstractTest {
private NbiNotificationsImpl nbiNotificationsImpl;
public static NetworkTransactionService networkTransactionService;
-
- @Mock
private TopicManager topicManager;
@Before
- public void setUp() {
+ public void setUp() throws ExecutionException, InterruptedException {
+ topicManager = TopicManager.getInstance();
networkTransactionService = new NetworkTransactionImpl(
new RequestProcessor(getDataStoreContextUtil().getDataBroker()));
JsonStringConverter<NotificationProcessService> converter = new JsonStringConverter<>(
getDataStoreContextUtil().getBindingDOMCodecServices());
JsonStringConverter<NotificationTapiService> converterTapi = new JsonStringConverter<>(
getDataStoreContextUtil().getBindingDOMCodecServices());
+ topicManager.setTapiConverter(converterTapi);
+ NotificationServiceDataUtils.createTapiContext(networkTransactionService);
nbiNotificationsImpl = new NbiNotificationsImpl(converter, converterAlarm, converterTapi,
"localhost:8080", networkTransactionService, topicManager);
nbiNotificationsImpl.getNotificationsAlarmService(builder.build());
assertNull("Should be null", result.get().getResult().getNotificationsAlarmService());
}
+
+ @Test
+ public void createTapiNotificationSubscriptionServiceTest() throws InterruptedException, ExecutionException {
+ CreateNotificationSubscriptionServiceInputBuilder builder
+ = NotificationServiceDataUtils.buildNotificationSubscriptionServiceInputBuilder();
+ ListenableFuture<RpcResult<CreateNotificationSubscriptionServiceOutput>> result =
+ nbiNotificationsImpl.createNotificationSubscriptionService(builder.build());
+ assertNotNull("Should receive UUID for subscription service",
+ result.get().getResult().getSubscriptionService().getUuid().toString());
+ }
+
+ @Test
+ public void getTapiNotificationsServiceTest() throws InterruptedException, ExecutionException {
+ CreateNotificationSubscriptionServiceInputBuilder builder
+ = NotificationServiceDataUtils.buildNotificationSubscriptionServiceInputBuilder();
+ ListenableFuture<RpcResult<CreateNotificationSubscriptionServiceOutput>> result =
+ nbiNotificationsImpl.createNotificationSubscriptionService(builder.build());
+ GetNotificationListInputBuilder builder1 = new GetNotificationListInputBuilder()
+ .setTimePeriod("Time Period")
+ .setSubscriptionIdOrName(result.get().getResult().getSubscriptionService().getUuid().getValue());
+ ListenableFuture<RpcResult<GetNotificationListOutput>> result1 =
+ nbiNotificationsImpl.getNotificationList(builder1.build());
+ assertNull("Should be null", result1.get().getResult().getNotification());
+ }
}
*/
package org.opendaylight.transportpce.nbinotifications.listener;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyString;
+import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
-import java.util.HashMap;
import java.util.Map;
+import java.util.UUID;
+import java.util.concurrent.ExecutionException;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import org.opendaylight.transportpce.nbinotifications.producer.Publisher;
+import org.opendaylight.transportpce.nbinotifications.utils.NotificationServiceDataUtils;
import org.opendaylight.transportpce.test.AbstractTest;
import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev211210.ConnectionType;
import org.opendaylight.yang.gen.v1.http.org.openroadm.common.state.types.rev191129.State;
import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.NotificationAlarmService;
import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.NotificationProcessService;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.NotificationTapiService;
import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.PublishNotificationAlarmService;
import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.PublishNotificationAlarmServiceBuilder;
import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.PublishNotificationProcessService;
import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.PublishNotificationProcessServiceBuilder;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.PublishTapiNotificationService;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.PublishTapiNotificationServiceBuilder;
public class NbiNotificationsListenerImplTest extends AbstractTest {
@Mock
private Publisher<NotificationProcessService> publisherService;
@Mock
private Publisher<NotificationAlarmService> publisherAlarm;
+ @Mock
+ private Publisher<NotificationTapiService> publisherTapiService;
@Before
- public void setUp() {
+ public void setUp() throws ExecutionException, InterruptedException {
MockitoAnnotations.openMocks(this);
}
@Test
public void onPublishNotificationServiceTest() {
NbiNotificationsListenerImpl listener = new NbiNotificationsListenerImpl(Map.of("test", publisherService),
- Map.of("test", publisherAlarm), new HashMap<>());
+ Map.of("test", publisherAlarm), Map.of("test", publisherTapiService));
PublishNotificationProcessService notification = new PublishNotificationProcessServiceBuilder()
.setPublisherName("test")
.setCommonId("commonId")
@Test
public void onPublishNotificationServiceWrongPublisherTest() {
NbiNotificationsListenerImpl listener = new NbiNotificationsListenerImpl(Map.of("test", publisherService),
- Map.of("test", publisherAlarm), new HashMap<>());
+ Map.of("test", publisherAlarm), Map.of("test", publisherTapiService));
PublishNotificationProcessService notification = new PublishNotificationProcessServiceBuilder()
.setPublisherName("wrongPublisher")
.setCommonId("commonId")
@Test
public void onPublishNotificationAlarmServiceTest() {
NbiNotificationsListenerImpl listener = new NbiNotificationsListenerImpl(Map.of("test", publisherService),
- Map.of("test", publisherAlarm), new HashMap<>());
+ Map.of("test", publisherAlarm), Map.of("test", publisherTapiService));
PublishNotificationAlarmService notification = new PublishNotificationAlarmServiceBuilder()
.setPublisherName("test")
.setConnectionType(ConnectionType.Service)
@Test
public void onPublishNotificationAlarmServiceWrongPublisherTest() {
NbiNotificationsListenerImpl listener = new NbiNotificationsListenerImpl(Map.of("test", publisherService),
- Map.of("test", publisherAlarm), new HashMap<>());
+ Map.of("test", publisherAlarm), Map.of("test", publisherTapiService));
PublishNotificationAlarmService notification = new PublishNotificationAlarmServiceBuilder()
.setPublisherName("wrongPublisher")
.setConnectionType(ConnectionType.Service)
listener.onPublishNotificationAlarmService(notification);
verify(publisherAlarm, times(0)).sendEvent(any(), anyString());
}
+
+ @Test
+ public void onPublishTapiNotificationServiceTest() throws ExecutionException, InterruptedException {
+ NbiNotificationsListenerImpl listener = new NbiNotificationsListenerImpl(Map.of("test", publisherService),
+ Map.of("test", publisherAlarm), Map.of("test", publisherTapiService));
+
+ PublishTapiNotificationService notification
+ = new PublishTapiNotificationServiceBuilder(NotificationServiceDataUtils.buildReceivedTapiAlarmEvent())
+ .setTopic("test")
+ .build();
+ listener.onPublishTapiNotificationService(notification);
+ verify(publisherTapiService, times(1)).sendEvent(any(), anyString());
+ }
+
+ @Test
+ public void onPublishTapiNotificationServiceTestWrongPublisherTest() {
+ NbiNotificationsListenerImpl listener = new NbiNotificationsListenerImpl(Map.of("test", publisherService),
+ Map.of("test", publisherAlarm), Map.of("test", publisherTapiService));
+ PublishTapiNotificationService notification
+ = new PublishTapiNotificationServiceBuilder(NotificationServiceDataUtils.buildReceivedTapiAlarmEvent())
+ .setTopic(UUID.randomUUID().toString())
+ .build();
+ listener.onPublishTapiNotificationService(notification);
+ verify(publisherTapiService, times(0)).sendEvent(any(), eq(notification.getTopic()));
+ }
+
+ @Test
+ public void getTapiPublisherFromTopicTest() {
+ NbiNotificationsListenerImpl listener = new NbiNotificationsListenerImpl(Map.of("test", publisherService),
+ Map.of("test", publisherAlarm), Map.of("test", publisherTapiService));
+ assertNull(listener.getTapiPublisherFromTopic("toto"));
+ assertEquals(publisherTapiService, listener.getTapiPublisherFromTopic("test"));
+ }
}
import static org.junit.Assert.assertEquals;
+import com.google.common.util.concurrent.ListenableFuture;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
+import java.util.HashSet;
+import java.util.List;
import java.util.Map;
+import java.util.concurrent.ExecutionException;
import org.apache.kafka.clients.producer.MockProducer;
import org.apache.kafka.common.serialization.StringSerializer;
import org.junit.Before;
import org.junit.Test;
+import org.mockito.MockitoAnnotations;
import org.opendaylight.transportpce.common.converter.JsonStringConverter;
+import org.opendaylight.transportpce.common.network.NetworkTransactionImpl;
+import org.opendaylight.transportpce.common.network.NetworkTransactionService;
+import org.opendaylight.transportpce.common.network.RequestProcessor;
+import org.opendaylight.transportpce.nbinotifications.impl.NbiNotificationsImpl;
import org.opendaylight.transportpce.nbinotifications.serialization.ConfigConstants;
import org.opendaylight.transportpce.nbinotifications.serialization.NotificationAlarmServiceSerializer;
import org.opendaylight.transportpce.nbinotifications.serialization.NotificationServiceSerializer;
+import org.opendaylight.transportpce.nbinotifications.serialization.TapiNotificationSerializer;
+import org.opendaylight.transportpce.nbinotifications.utils.NotificationServiceDataUtils;
+import org.opendaylight.transportpce.nbinotifications.utils.TopicManager;
import org.opendaylight.transportpce.test.AbstractTest;
import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.NotificationAlarmService;
import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.NotificationProcessService;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.NotificationTapiService;
+import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.common.rev181210.Uuid;
+import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.notification.rev181210.CreateNotificationSubscriptionServiceInputBuilder;
+import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.notification.rev181210.CreateNotificationSubscriptionServiceOutput;
+import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.notification.rev181210.create.notification.subscription.service.input.SubscriptionFilter;
+import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.notification.rev181210.create.notification.subscription.service.input.SubscriptionFilterBuilder;
+import org.opendaylight.yangtools.yang.common.RpcResult;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.codec.gson.JSONCodecFactorySupplier;
public class PublisherTest extends AbstractTest {
private JsonStringConverter<NotificationProcessService> converterService;
private JsonStringConverter<NotificationAlarmService> converterAlarm;
+ private JsonStringConverter<NotificationTapiService> converterTapiService;
private Publisher<NotificationProcessService> publisherService;
private Publisher<NotificationAlarmService> publisherAlarm;
+ private Publisher<NotificationTapiService> publisherTapiService;
private MockProducer<String, NotificationProcessService> mockProducer;
private MockProducer<String, NotificationAlarmService> mockAlarmProducer;
+ private MockProducer<String, NotificationTapiService> mockTapiProducer;
+ private NbiNotificationsImpl nbiNotificationsImpl;
+ private TopicManager topicManager;
+
+ public static NetworkTransactionService networkTransactionService;
@Before
- public void setUp() {
+ public void setUp() throws ExecutionException, InterruptedException {
+ topicManager = TopicManager.getInstance();
converterService = new JsonStringConverter<>(getDataStoreContextUtil().getBindingDOMCodecServices());
converterAlarm = new JsonStringConverter<>(getDataStoreContextUtil().getBindingDOMCodecServices());
+ converterTapiService = new JsonStringConverter<>(getDataStoreContextUtil().getBindingDOMCodecServices());
NotificationServiceSerializer serializerService = new NotificationServiceSerializer();
NotificationAlarmServiceSerializer serializerAlarm = new NotificationAlarmServiceSerializer();
+ TapiNotificationSerializer serializerTapi = new TapiNotificationSerializer();
Map<String, Object> properties = Map.of(ConfigConstants.CONVERTER, converterService);
Map<String, Object> propertiesAlarm = Map.of(ConfigConstants.CONVERTER, converterAlarm);
+ Map<String, Object> propertiesTapi = Map.of(ConfigConstants.CONVERTER, converterTapiService);
serializerService.configure(properties, false);
serializerAlarm.configure(propertiesAlarm, false);
+ serializerTapi.configure(propertiesTapi, false);
mockProducer = new MockProducer<>(true, new StringSerializer(), serializerService);
mockAlarmProducer = new MockProducer<>(true, new StringSerializer(), serializerAlarm);
+ mockTapiProducer = new MockProducer<>(true, new StringSerializer(), serializerTapi);
publisherService = new Publisher<>("test", mockProducer);
publisherAlarm = new Publisher<>("test", mockAlarmProducer);
+ publisherTapiService = new Publisher<>("test", mockTapiProducer);
+ MockitoAnnotations.openMocks(this);
+ networkTransactionService = new NetworkTransactionImpl(
+ new RequestProcessor(getDataStoreContextUtil().getDataBroker()));
+ topicManager.setTapiConverter(converterTapiService);
+ NotificationServiceDataUtils.createTapiContext(networkTransactionService);
+ nbiNotificationsImpl = new NbiNotificationsImpl(converterService, converterAlarm, converterTapiService,
+ "localhost:8080", networkTransactionService, topicManager);
}
@Test
assertEquals("We should have one message", 1, mockAlarmProducer.history().size());
assertEquals("Key should be test", "test", mockAlarmProducer.history().get(0).key());
}
+
+ @Test
+ public void sendTapiEventShouldBeSuccessful() throws IOException {
+ CreateNotificationSubscriptionServiceInputBuilder builder
+ = NotificationServiceDataUtils.buildNotificationSubscriptionServiceInputBuilder();
+ SubscriptionFilter subscriptionFilter = new SubscriptionFilterBuilder(builder.getSubscriptionFilter())
+ .setRequestedObjectIdentifier(new HashSet<>(List.of(new Uuid("76d8f07b-ead5-4132-8eb8-cf3fdef7e079"))))
+ .build();
+ builder.setSubscriptionFilter(subscriptionFilter);
+ ListenableFuture<RpcResult<CreateNotificationSubscriptionServiceOutput>> result =
+ nbiNotificationsImpl.createNotificationSubscriptionService(builder.build());
+ String json = Files.readString(Paths.get("src/test/resources/tapi_event.json"));
+ NotificationTapiService notificationTapiService = converterTapiService
+ .createDataObjectFromJsonString(YangInstanceIdentifier.of(NotificationTapiService.QNAME),
+ json, JSONCodecFactorySupplier.RFC7951);
+ publisherTapiService.sendEvent(notificationTapiService, "");
+ assertEquals("We should have one message", 1, mockTapiProducer.history().size());
+ assertEquals("Key should be test", "test", mockTapiProducer.history().get(0).key());
+ }
}
--- /dev/null
+/*
+ * Copyright © 2021 Nokia, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.transportpce.nbinotifications.serialization;
+
+import static org.junit.Assert.assertEquals;
+
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.util.Map;
+import org.junit.Test;
+import org.opendaylight.transportpce.common.converter.JsonStringConverter;
+import org.opendaylight.transportpce.test.AbstractTest;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.NotificationTapiService;
+import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.notification.rev181210.get.notification.list.output.Notification;
+
+public class NotificationTapiServiceDeserializerTest extends AbstractTest {
+
+ @Test
+ public void deserializeTest() throws IOException {
+ JsonStringConverter<NotificationTapiService> converter = new JsonStringConverter<>(
+ getDataStoreContextUtil().getBindingDOMCodecServices());
+ TapiNotificationDeserializer deserializer = new TapiNotificationDeserializer();
+ Map<String, Object> configs = Map.of(ConfigConstants.CONVERTER, converter);
+ deserializer.configure(configs, false);
+ Notification readEvent = deserializer.deserialize("76d8f07b-ead5-4132-8eb8-cf3fdef7e079",
+ Files.readAllBytes(Paths.get("src/test/resources/tapi_event.json")));
+ deserializer.close();
+ assertEquals("Service uuid should be 76d8f07b-ead5-4132-8eb8-cf3fdef7e079",
+ "76d8f07b-ead5-4132-8eb8-cf3fdef7e079", readEvent.getTargetObjectIdentifier().getValue());
+ }
+}
--- /dev/null
+/*
+ * Copyright © 2021 Nokia, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.transportpce.nbinotifications.serialization;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import java.io.IOException;
+import java.nio.charset.StandardCharsets;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.util.Map;
+import org.junit.Test;
+import org.opendaylight.transportpce.common.converter.JsonStringConverter;
+import org.opendaylight.transportpce.test.AbstractTest;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.NotificationTapiService;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
+import org.opendaylight.yangtools.yang.data.codec.gson.JSONCodecFactorySupplier;
+
+public class NotificationTapiServiceSerializerTest extends AbstractTest {
+
+ @Test
+ public void serializeTest() throws IOException {
+ JsonStringConverter<NotificationTapiService> converter =
+ new JsonStringConverter<>(getDataStoreContextUtil().getBindingDOMCodecServices());
+ String json = Files.readString(Paths.get("src/test/resources/tapi_event.json"));
+ NotificationTapiService notificationService = converter
+ .createDataObjectFromJsonString(YangInstanceIdentifier.of(NotificationTapiService.QNAME),
+ json, JSONCodecFactorySupplier.RFC7951);
+ TapiNotificationSerializer serializer = new TapiNotificationSerializer();
+ Map<String, Object> configs = Map.of(ConfigConstants.CONVERTER, converter);
+ serializer.configure(configs, false);
+ byte[] data = serializer.serialize("test", notificationService);
+ serializer.close();
+ assertNotNull("Serialized data should not be null", data);
+ String expectedJson = Files.readString(Paths.get("src/test/resources/expected_tapi_event.json"));
+ // Minify the json string
+ expectedJson = new ObjectMapper().readValue(expectedJson, JsonNode.class).toString();
+ assertEquals("The event should be equals", expectedJson, new String(data, StandardCharsets.UTF_8));
+ }
+}
*/
package org.opendaylight.transportpce.nbinotifications.utils;
+import java.nio.charset.Charset;
+import java.time.OffsetDateTime;
+import java.time.ZoneOffset;
+import java.time.format.DateTimeFormatter;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
import java.util.Map;
+import java.util.UUID;
+import java.util.concurrent.ExecutionException;
+import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
+import org.opendaylight.transportpce.common.network.NetworkTransactionService;
import org.opendaylight.yang.gen.v1.http.org.openroadm.common.node.types.rev210528.NodeIdType;
import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev211210.ConnectionType;
import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev211210.service.endpoint.RxDirection;
import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.get.notifications.process.service.output.NotificationsProcessServiceBuilder;
import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.notification.process.service.ServiceAEndBuilder;
import org.opendaylight.yang.gen.v1.nbi.notifications.rev211013.notification.process.service.ServiceZEndBuilder;
+import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.common.rev181210.AdministrativeState;
+import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.common.rev181210.Context;
+import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.common.rev181210.ContextBuilder;
+import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.common.rev181210.DateAndTime;
+import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.common.rev181210.LayerProtocolName;
+import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.common.rev181210.OperationalState;
+import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.common.rev181210.Uuid;
+import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.common.rev181210.local._class.Name;
+import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.common.rev181210.local._class.NameBuilder;
+import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.connectivity.rev181210.Context1;
+import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.connectivity.rev181210.Context1Builder;
+import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.connectivity.rev181210.context.ConnectivityContextBuilder;
+import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.notification.rev181210.CreateNotificationSubscriptionServiceInputBuilder;
+import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.notification.rev181210.GetNotificationListInputBuilder;
+import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.notification.rev181210.NotificationType;
+import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.notification.rev181210.ObjectType;
+import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.notification.rev181210.SubscriptionState;
+import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.notification.rev181210.context.NotificationContextBuilder;
+import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.notification.rev181210.create.notification.subscription.service.input.SubscriptionFilter;
+import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.notification.rev181210.create.notification.subscription.service.input.SubscriptionFilterBuilder;
+import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.notification.rev181210.get.notification.list.output.Notification;
+import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.notification.rev181210.get.notification.list.output.NotificationBuilder;
+import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.notification.rev181210.notification.ChangedAttributes;
+import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.notification.rev181210.notification.ChangedAttributesBuilder;
+import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.notification.rev181210.notification.TargetObjectName;
+import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.notification.rev181210.notification.TargetObjectNameBuilder;
+import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.context.TopologyContextBuilder;
+import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.topology.context.NwTopologyServiceBuilder;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.opendaylight.yangtools.yang.common.Uint32;
import org.opendaylight.yangtools.yang.common.Uint8;
public final class NotificationServiceDataUtils {
+ public static final String TAPI_CONTEXT = "T-API context";
+
private NotificationServiceDataUtils() {
}
.build();
}
+ public static Notification buildReceivedTapiAlarmEvent() {
+ DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ssxxx");
+ OffsetDateTime offsetDateTime = OffsetDateTime.now(ZoneOffset.UTC);
+ DateAndTime datetime = new DateAndTime(dtf.format(offsetDateTime));
+ Uuid targetObjectId = new Uuid(UUID.randomUUID().toString());
+ TargetObjectName objectName = new TargetObjectNameBuilder()
+ .setValue(targetObjectId.getValue())
+ .setValueName("Connectivity Service Name")
+ .build();
+ ChangedAttributes adminStateChange = new ChangedAttributesBuilder()
+ .setValueName("administrativeState")
+ .setOldValue(AdministrativeState.LOCKED.getName())
+ .setNewValue(AdministrativeState.UNLOCKED.getName())
+ .build();
+ ChangedAttributes operStateChange = new ChangedAttributesBuilder()
+ .setValueName("operationalState")
+ .setOldValue(OperationalState.DISABLED.getName())
+ .setNewValue(OperationalState.ENABLED.getName())
+ .build();
+ return new NotificationBuilder()
+ .setNotificationType(NotificationType.ATTRIBUTEVALUECHANGE)
+ .setLayerProtocolName(LayerProtocolName.ETH)
+ .setTargetObjectType(ObjectType.CONNECTIVITYSERVICE)
+ .setEventTimeStamp(datetime)
+ .setUuid(new Uuid(UUID.randomUUID().toString()))
+ .setTargetObjectIdentifier(targetObjectId)
+ .setTargetObjectName(Map.of(objectName.key(), objectName))
+ .setChangedAttributes(Map.of(adminStateChange.key(), adminStateChange,
+ operStateChange.key(), operStateChange))
+ .build();
+ }
+
public static ServiceAEndBuilder getServiceAEndBuild() {
return new ServiceAEndBuilder()
.setClli("clli")
.setRxDirection(getRxDirection());
}
+ public static CreateNotificationSubscriptionServiceInputBuilder buildNotificationSubscriptionServiceInputBuilder() {
+ Name name = new NameBuilder()
+ .setValue("test subscription")
+ .setValueName("Subscription name")
+ .build();
+ SubscriptionFilter subscriptionFilter = new SubscriptionFilterBuilder()
+ .setRequestedObjectTypes(new HashSet<>(List.of(ObjectType.CONNECTIVITYSERVICE)))
+ .setRequestedNotificationTypes(new HashSet<>(List.of(NotificationType.ALARMEVENT)))
+ .setRequestedLayerProtocols(new HashSet<>(List.of(LayerProtocolName.ETH)))
+ .setRequestedObjectIdentifier(new HashSet<>(List.of(new Uuid(UUID.randomUUID().toString()))))
+ .setIncludeContent(true)
+ .setLocalId("localId")
+ .setName(Map.of(name.key(), name))
+ .build();
+ return new CreateNotificationSubscriptionServiceInputBuilder()
+ .setSubscriptionFilter(subscriptionFilter)
+ .setSubscriptionState(SubscriptionState.ACTIVE);
+ }
+
private static Map<TxDirectionKey, TxDirection> getTxDirection() {
return Map.of(new TxDirectionKey(Uint8.ZERO), new TxDirectionBuilder()
.setPort(new PortBuilder()
.setIndex(Uint8.ZERO)
.build());
}
+
+ public static void createTapiContext(
+ NetworkTransactionService networkTransactionService) throws ExecutionException, InterruptedException {
+ // Augmenting tapi context to include topology and connectivity contexts
+ org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.common.rev181210.global._class.Name contextName
+ = new org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.common.rev181210.global._class.NameBuilder()
+ .setValue(TAPI_CONTEXT).setValueName("TAPI Context Name").build();
+
+ Context1 connectivityContext =
+ new Context1Builder()
+ .setConnectivityContext(
+ new ConnectivityContextBuilder()
+ .setConnection(new HashMap<>())
+ .setConnectivityService(new HashMap<>())
+ .build())
+ .build();
+
+ org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.common.rev181210.global._class.Name nwTopoServiceName =
+ new org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.common.rev181210.global._class.NameBuilder()
+ .setValue("Network Topo Service")
+ .setValueName("Network Topo Service Name")
+ .build();
+
+ org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.Context1 topologyContext
+ = new org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.Context1Builder()
+ .setTopologyContext(new TopologyContextBuilder()
+ .setNwTopologyService(new NwTopologyServiceBuilder()
+ .setTopology(new HashMap<>())
+ .setUuid(
+ new Uuid(
+ UUID.nameUUIDFromBytes("Network Topo Service".getBytes(Charset.forName("UTF-8")))
+ .toString()))
+ .setName(Map.of(nwTopoServiceName.key(), nwTopoServiceName))
+ .build())
+ .setTopology(new HashMap<>())
+ .build())
+ .build();
+
+ org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.notification.rev181210.Context1 notificationContext
+ = new org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.notification.rev181210.Context1Builder()
+ .setNotificationContext(new NotificationContextBuilder()
+ .setNotification(new HashMap<>())
+ .setNotifSubscription(new HashMap<>())
+ .build())
+ .build();
+
+ ContextBuilder contextBuilder = new ContextBuilder()
+ .setName(Map.of(contextName.key(), contextName))
+ .setUuid(
+ new Uuid(UUID.nameUUIDFromBytes(TAPI_CONTEXT.getBytes(Charset.forName("UTF-8"))).toString()))
+ .setServiceInterfacePoint(new HashMap<>())
+ .addAugmentation(connectivityContext)
+ .addAugmentation(topologyContext)
+ .addAugmentation(notificationContext);
+
+ // todo: add notification context
+ InstanceIdentifier<Context> contextIID = InstanceIdentifier.builder(Context.class).build();
+ // put in datastore
+ networkTransactionService.put(LogicalDatastoreType.OPERATIONAL, contextIID, contextBuilder.build());
+ networkTransactionService.commit().get();
+ }
+
+ public static GetNotificationListInputBuilder buildGetNotificationListInputBuilder(String subscriptionUuid) {
+ return new GetNotificationListInputBuilder()
+ .setSubscriptionIdOrName(subscriptionUuid)
+ .setTimePeriod("some string");
+ }
}
--- /dev/null
+{
+ "nbi-notifications:notification-tapi-service": {
+ "layer-protocol-name": "ETH",
+ "notification-type": "ATTRIBUTE_VALUE_CHANGE",
+ "changed-attributes": [
+ {
+ "value-name": "administrativeState",
+ "old-value": "LOCKED",
+ "new-value": "UNLOCKED"
+ },
+ {
+ "value-name": "operationalState",
+ "old-value": "DISABLED",
+ "new-value": "ENABLED"
+ }
+ ],
+ "target-object-name": [
+ {
+ "value-name": "Connectivity Service Name",
+ "value": "76d8f07b-ead5-4132-8eb8-cf3fdef7e079"
+ }
+ ],
+ "uuid": "6ae49721-7f96-4924-b23b-31e5bee4946b",
+ "target-object-type": "CONNECTIVITY_SERVICE",
+ "event-time-stamp": "2022-04-06T09:06:01+00:00",
+ "target-object-identifier": "76d8f07b-ead5-4132-8eb8-cf3fdef7e079"
+ }
+}
\ No newline at end of file
--- /dev/null
+{
+ "nbi-notifications:notification-tapi-service": {
+ "layer-protocol-name": "ETH",
+ "notification-type": "ATTRIBUTE_VALUE_CHANGE",
+ "changed-attributes": [
+ {
+ "value-name": "administrativeState",
+ "old-value": "LOCKED",
+ "new-value": "UNLOCKED"
+ },
+ {
+ "value-name": "operationalState",
+ "old-value": "DISABLED",
+ "new-value": "ENABLED"
+ }
+ ],
+ "target-object-name": [
+ {
+ "value-name": "Connectivity Service Name",
+ "value": "76d8f07b-ead5-4132-8eb8-cf3fdef7e079"
+ }
+ ],
+ "uuid": "6ae49721-7f96-4924-b23b-31e5bee4946b",
+ "target-object-type": "CONNECTIVITY_SERVICE",
+ "event-time-stamp": "2022-04-06T09:06:01+00:00",
+ "target-object-identifier": "76d8f07b-ead5-4132-8eb8-cf3fdef7e079"
+ }
+}
\ No newline at end of file
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>bundle-parent</artifactId>
- <version>11.0.2</version>
+ <version>11.0.3</version>
<relativePath/>
</parent>
<dependency>
<groupId>org.opendaylight.yangtools</groupId>
<artifactId>yangtools-artifacts</artifactId>
- <version>9.0.2</version>
+ <version>9.0.5</version>
<scope>import</scope>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.opendaylight.mdsal</groupId>
<artifactId>mdsal-artifacts</artifactId>
- <version>10.0.3</version>
+ <version>10.0.5</version>
<scope>import</scope>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.opendaylight.netconf</groupId>
<artifactId>netconf-artifacts</artifactId>
- <version>4.0.3</version>
+ <version>4.0.4</version>
<scope>import</scope>
<type>pom</type>
</dependency>
<parent>
<groupId>org.opendaylight.mdsal</groupId>
<artifactId>binding-parent</artifactId>
- <version>10.0.3</version>
+ <version>10.0.5</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.mdsal</groupId>
<artifactId>binding-parent</artifactId>
- <version>10.0.3</version>
+ <version>10.0.5</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent</artifactId>
- <version>11.0.2</version>
+ <version>11.0.3</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.mdsal</groupId>
<artifactId>binding-parent</artifactId>
- <version>10.0.3</version>
+ <version>10.0.5</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.mdsal</groupId>
<artifactId>binding-parent</artifactId>
- <version>10.0.3</version>
+ <version>10.0.5</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.mdsal</groupId>
<artifactId>binding-parent</artifactId>
- <version>10.0.3</version>
+ <version>10.0.5</version>
<relativePath/>
</parent>
<dependency>
<groupId>org.opendaylight.netconf</groupId>
<artifactId>netconf-artifacts</artifactId>
- <version>4.0.3</version>
+ <version>4.0.4</version>
<scope>import</scope>
<type>pom</type>
</dependency>
<parent>
<groupId>org.opendaylight.mdsal</groupId>
<artifactId>binding-parent</artifactId>
- <version>10.0.3</version>
+ <version>10.0.5</version>
<relativePath/>
</parent>
<dependency>
<groupId>org.opendaylight.netconf</groupId>
<artifactId>netconf-artifacts</artifactId>
- <version>4.0.3</version>
+ <version>4.0.4</version>
<scope>import</scope>
<type>pom</type>
</dependency>
RESTCONF_PORT = 8181
RESTCONF_PATH_PREFIX = {'rfc8040': '/rests',
- 'lighty': '/restconf',
'draft-bierman02': '/restconf'}
+if 'USE_LIGHTY' in os.environ and os.environ['USE_LIGHTY'] == 'True':
+ RESTCONF_PATH_PREFIX['rfc8040'] = '/restconf'
+
if 'USE_ODL_RESTCONF_VERSION' in os.environ:
RESTCONF_VERSION = os.environ['USE_ODL_RESTCONF_VERSION']
if RESTCONF_VERSION not in RESTCONF_PATH_PREFIX:
def mount_device(node: str, sim: str):
url = {'rfc8040': '{}/data/network-topology:network-topology/topology=topology-netconf/node={}',
- 'lighty': '{}/data/network-topology:network-topology/topology=topology-netconf/node={}',
'draft-bierman02': '{}/config/network-topology:network-topology/topology/topology-netconf/node/{}'}
body = {'node': [{
'node-id': node,
def unmount_device(node: str):
url = {'rfc8040': '{}/data/network-topology:network-topology/topology=topology-netconf/node={}',
- 'lighty': '{}/data/network-topology:network-topology/topology=topology-netconf/node={}',
'draft-bierman02': '{}/config/network-topology:network-topology/topology/topology-netconf/node/{}'}
response = delete_request(url[RESTCONF_VERSION].format('{}', node))
if wait_until_log_contains(TPCE_LOG, re.escape("onDeviceDisConnected: " + node), 180):
def check_device_connection(node: str):
url = {'rfc8040': '{}/data/network-topology:network-topology/topology=topology-netconf/node={}?content=nonconfig',
- 'lighty': '{}/data/network-topology:network-topology/topology=topology-netconf/node={}?content=nonconfig',
'draft-bierman02': '{}/operational/network-topology:network-topology/topology/topology-netconf/node/{}'}
response = get_request(url[RESTCONF_VERSION].format('{}', node))
res = response.json()
return_key = {'rfc8040': 'network-topology:node',
- 'lighty': 'network-topology:node',
'draft-bierman02': 'node'}
if return_key[RESTCONF_VERSION] in res.keys():
connection_status = res[return_key[RESTCONF_VERSION]][0]['netconf-node-topology:connection-status']
def check_node_request(node: str):
# pylint: disable=line-too-long
url = {'rfc8040': '{}/data/network-topology:network-topology/topology=topology-netconf/node={}/yang-ext:mount/org-openroadm-device:org-openroadm-device?content=config', # nopep8
- 'lighty': '{}/data/network-topology:network-topology/topology=topology-netconf/node={}/yang-ext:mount/org-openroadm-device:org-openroadm-device?content=config', # nopep8
'draft-bierman02': '{}/config/network-topology:network-topology/topology/topology-netconf/node/{}/yang-ext:mount/org-openroadm-device:org-openroadm-device'} # nopep8
response = get_request(url[RESTCONF_VERSION].format('{}', node))
res = response.json()
return_key = {'rfc8040': 'org-openroadm-device:org-openroadm-device',
- 'lighty': 'org-openroadm-device:org-openroadm-device',
'draft-bierman02': 'org-openroadm-device'}
if return_key[RESTCONF_VERSION] in res.keys():
response_attribute = res[return_key[RESTCONF_VERSION]]
def check_node_attribute_request(node: str, attribute: str, attribute_value: str):
# pylint: disable=line-too-long
url = {'rfc8040': '{}/data/network-topology:network-topology/topology=topology-netconf/node={}/yang-ext:mount/org-openroadm-device:org-openroadm-device/{}={}?content=nonconfig', # nopep8
- 'lighty': '{}/data/network-topology:network-topology/topology=topology-netconf/node={}/yang-ext:mount/org-openroadm-device:org-openroadm-device/{}={}?content=nonconfig', # nopep8
'draft-bierman02': '{}/operational/network-topology:network-topology/topology/topology-netconf/node/{}/yang-ext:mount/org-openroadm-device:org-openroadm-device/{}/{}'} # nopep8
response = get_request(url[RESTCONF_VERSION].format('{}', node, attribute, attribute_value))
res = response.json()
return_key = {'rfc8040': 'org-openroadm-device:' + attribute,
- 'lighty': 'org-openroadm-device:' + attribute,
'draft-bierman02': attribute}
if return_key[RESTCONF_VERSION] in res.keys():
response_attribute = res[return_key[RESTCONF_VERSION]]
def check_node_attribute2_request(node: str, attribute: str, attribute_value: str, attribute2: str):
# pylint: disable=line-too-long
url = {'rfc8040': '{}/data/network-topology:network-topology/topology=topology-netconf/node={}/yang-ext:mount/org-openroadm-device:org-openroadm-device/{}={}/{}?content=config', # nopep8
- 'lighty': '{}/data/network-topology:network-topology/topology=topology-netconf/node={}/yang-ext:mount/org-openroadm-device:org-openroadm-device/{}={}/{}?content=config', # nopep8
'draft-bierman02': '{}/config/network-topology:network-topology/topology/topology-netconf/node/{}/yang-ext:mount/org-openroadm-device:org-openroadm-device/{}/{}/{}'} # nopep8
response = get_request(url[RESTCONF_VERSION].format('{}', node, attribute, attribute_value, attribute2))
res = response.json()
def del_node_attribute_request(node: str, attribute: str, attribute_value: str):
# pylint: disable=line-too-long
url = {'rfc8040': '{}/data/network-topology:network-topology/topology=topology-netconf/node={}/yang-ext:mount/org-openroadm-device:org-openroadm-device/{}={}', # nopep8
- 'lighty': '{}/data/network-topology:network-topology/topology=topology-netconf/node={}/yang-ext:mount/org-openroadm-device:org-openroadm-device/{}={}', # nopep8
'draft-bierman02': '{}/config/network-topology:network-topology/topology/topology-netconf/node/{}/yang-ext:mount/org-openroadm-device:org-openroadm-device/{}/{}'} # nopep8
response = delete_request(url[RESTCONF_VERSION].format('{}', node, attribute, attribute_value))
return response
def post_portmapping(payload: str):
url = {'rfc8040': '{}/data/transportpce-portmapping:network',
- 'lighty': '{}/data/transportpce-portmapping:network',
'draft-bierman02': '{}/config/transportpce-portmapping:network'}
json_payload = json.loads(payload)
response = post_request(url[RESTCONF_VERSION].format('{}'), json_payload)
def del_portmapping():
url = {'rfc8040': '{}/data/transportpce-portmapping:network',
- 'lighty': '{}/data/transportpce-portmapping:network',
'draft-bierman02': '{}/config/transportpce-portmapping:network'}
response = delete_request(url[RESTCONF_VERSION].format('{}'))
return {'status_code': response.status_code}
def get_portmapping_node_attr(node: str, attr: str, value: str):
# pylint: disable=consider-using-f-string
url = {'rfc8040': '{}/data/transportpce-portmapping:network/nodes={}',
- 'lighty': '{}/data/transportpce-portmapping:network/nodes={}',
'draft-bierman02': '{}/config/transportpce-portmapping:network/nodes/{}'}
target_url = url[RESTCONF_VERSION].format('{}', node)
if attr is not None:
target_url = (target_url + '/{}').format('{}', attr)
if value is not None:
- suffix = {'rfc8040': '={}', 'lighty': '={}', 'draft-bierman02': '/{}'}
+ suffix = {'rfc8040': '={}', 'draft-bierman02': '/{}'}
target_url = (target_url + suffix[RESTCONF_VERSION]).format('{}', value)
else:
attr = 'nodes'
response = get_request(target_url)
res = response.json()
return_key = {'rfc8040': 'transportpce-portmapping:' + attr,
- 'lighty': 'transportpce-portmapping:' + attr,
'draft-bierman02': attr}
if return_key[RESTCONF_VERSION] in res.keys():
return_output = res[return_key[RESTCONF_VERSION]]
def get_ietf_network_request(network: str, content: str):
url = {'rfc8040': '{}/data/ietf-network:networks/network={}?content={}',
- 'lighty': '{}/data/ietf-network:networks/network={}?content={}',
'draft-bierman02': '{}/{}/ietf-network:networks/network/{}'}
- if RESTCONF_VERSION in ('rfc8040', 'lighty'):
+ if RESTCONF_VERSION in ('rfc8040'):
format_args = ('{}', network, content)
elif content == 'config':
format_args = ('{}', content, network)
if bool(response):
res = response.json()
return_key = {'rfc8040': 'ietf-network:network',
- 'lighty': 'ietf-network:network',
'draft-bierman02': 'network'}
networks = res[return_key[RESTCONF_VERSION]]
else:
def put_ietf_network(network: str, payload: str):
url = {'rfc8040': '{}/data/ietf-network:networks/network={}',
- 'lighty': '{}/data/ietf-network:networks/network={}',
'draft-bierman02': '{}/config/ietf-network:networks/network/{}'}
json_payload = json.loads(payload)
response = put_request(url[RESTCONF_VERSION].format('{}', network), json_payload)
def del_ietf_network(network: str):
url = {'rfc8040': '{}/data/ietf-network:networks/network={}',
- 'lighty': '{}/data/ietf-network:networks/network={}',
'draft-bierman02': '{}/config/ietf-network:networks/network/{}'}
response = delete_request(url[RESTCONF_VERSION].format('{}', network))
return {'status_code': response.status_code}
def get_ietf_network_link_request(network: str, link: str, content: str):
url = {'rfc8040': '{}/data/ietf-network:networks/network={}/ietf-network-topology:link={}?content={}',
- 'lighty': '{}/data/ietf-network:networks/network={}/ietf-network-topology:link={}?content={}',
'draft-bierman02': '{}/{}/ietf-network:networks/network/{}/ietf-network-topology:link/{}'}
- if RESTCONF_VERSION in ('rfc8040', 'lighty'):
+ if RESTCONF_VERSION in ('rfc8040'):
format_args = ('{}', network, link, content)
elif content == 'config':
format_args = ('{}', content, network, link)
response = get_request(url[RESTCONF_VERSION].format(*format_args))
res = response.json()
return_key = {'rfc8040': 'ietf-network-topology:link',
- 'lighty': 'ietf-network-topology:link',
'draft-bierman02': 'ietf-network-topology:link'}
link = res[return_key[RESTCONF_VERSION]][0]
return {'status_code': response.status_code,
def del_ietf_network_link_request(network: str, link: str, content: str):
url = {'rfc8040': '{}/data/ietf-network:networks/network={}/ietf-network-topology:link={}?content={}',
- 'lighty': '{}/data/ietf-network:networks/network={}/ietf-network-topology:link={}?content={}',
'draft-bierman02': '{}/{}/ietf-network:networks/network/{}/ietf-network-topology:link/{}'}
- if RESTCONF_VERSION in ('rfc8040', 'lighty'):
+ if RESTCONF_VERSION in ('rfc8040'):
format_args = ('{}', network, link, content)
elif content == 'config':
format_args = ('{}', content, network, link)
def add_oms_attr_request(link: str, oms_attr: str):
url = {'rfc8040': '{}/data/ietf-network:networks/network={}/ietf-network-topology:link={}',
- 'lighty': '{}/data/ietf-network:networks/network={}/ietf-network-topology:link={}',
'draft-bierman02': '{}/config/ietf-network:networks/network/{}/ietf-network-topology:link/{}'}
url2 = url[RESTCONF_VERSION] + '/org-openroadm-network-topology:OMS-attributes/span'
network = 'openroadm-topology'
def del_oms_attr_request(link: str,):
url = {'rfc8040': '{}/data/ietf-network:networks/network={}/ietf-network-topology:link={}',
- 'lighty': '{}/data/ietf-network:networks/network={}/ietf-network-topology:link={}',
'draft-bierman02': '{}/config/ietf-network:networks/network/{}/ietf-network-topology:link/{}'}
url2 = url[RESTCONF_VERSION] + '/org-openroadm-network-topology:OMS-attributes/span'
network = 'openroadm-topology'
def get_ietf_network_node_request(network: str, node: str, content: str):
url = {'rfc8040': '{}/data/ietf-network:networks/network={}/node={}?content={}',
- 'lighty': '{}/data/ietf-network:networks/network={}/node={}?content={}',
'draft-bierman02': '{}/{}/ietf-network:networks/network/{}/node/{}'}
- if RESTCONF_VERSION in ('rfc8040', 'lighty'):
+ if RESTCONF_VERSION in ('rfc8040'):
format_args = ('{}', network, node, content)
elif content == 'config':
format_args = ('{}', content, network, node)
if bool(response):
res = response.json()
return_key = {'rfc8040': 'ietf-network:node',
- 'lighty': 'ietf-network:node',
'draft-bierman02': 'node'}
node = res[return_key[RESTCONF_VERSION]][0]
else:
def del_ietf_network_node_request(network: str, node: str, content: str):
url = {'rfc8040': '{}/data/ietf-network:networks/network={}/node={}?content={}',
- 'lighty': '{}/data/ietf-network:networks/network={}/node={}?content={}',
'draft-bierman02': '{}/{}/ietf-network:networks/network/{}/node/{}'}
- if RESTCONF_VERSION in ('rfc8040', 'lighty'):
+ if RESTCONF_VERSION in ('rfc8040'):
format_args = ('{}', network, node, content)
elif content == 'config':
format_args = ('{}', content, network, node)
def get_ordm_serv_list_request():
url = {'rfc8040': '{}/data/org-openroadm-service:service-list?content=nonconfig',
- 'lighty': '{}/data/org-openroadm-service:service-list?content=nonconfig',
'draft-bierman02': '{}/operational/org-openroadm-service:service-list/'}
response = get_request(url[RESTCONF_VERSION])
res = response.json()
return_key = {'rfc8040': 'org-openroadm-service:service-list',
- 'lighty': 'org-openroadm-service:service-list',
'draft-bierman02': 'service-list'}
if return_key[RESTCONF_VERSION] in res.keys():
response_attribute = res[return_key[RESTCONF_VERSION]]
def get_ordm_serv_list_attr_request(attribute: str, value: str):
url = {'rfc8040': '{}/data/org-openroadm-service:service-list/{}={}?content=nonconfig',
- 'lighty': '{}/data/org-openroadm-service:service-list/{}={}?content=nonconfig',
'draft-bierman02': '{}/operational/org-openroadm-service:service-list/{}/{}'}
format_args = ('{}', attribute, value)
response = get_request(url[RESTCONF_VERSION].format(*format_args))
res = response.json()
return_key = {'rfc8040': 'org-openroadm-service:' + attribute,
- 'lighty': 'org-openroadm-service:' + attribute,
'draft-bierman02': attribute}
if return_key[RESTCONF_VERSION] in res.keys():
response_attribute = res[return_key[RESTCONF_VERSION]]
def get_serv_path_list_attr(attribute: str, value: str):
url = {'rfc8040': '{}/data/transportpce-service-path:service-path-list/{}={}?content=nonconfig',
- 'lighty': '{}/data/transportpce-service-path:service-path-list/{}={}?content=nonconfig',
'draft-bierman02': '{}/operational/transportpce-service-path:service-path-list/{}/{}'}
response = get_request(url[RESTCONF_VERSION].format('{}', attribute, value))
res = response.json()
return_key = {'rfc8040': 'transportpce-service-path:' + attribute,
- 'lighty': 'transportpce-service-path:' + attribute,
'draft-bierman02': attribute}
if return_key[RESTCONF_VERSION] in res.keys():
response_attribute = res[return_key[RESTCONF_VERSION]]
else:
res = response.json()
return_key = {'rfc8040': api_module + ':output',
- 'lighty': api_module + ':output',
'draft-bierman02': 'output'}
if response.status_code == requests.codes.internal_server_error:
return_output = res
response['output']['service']['end-point'][0]['name'][0])
self.assertDictEqual(dict(input_dict_3, **response['output']['service']['end-point'][1]['name'][0]),
response['output']['service']['end-point'][1]['name'][0])
- # If the gate fails is because of the waiting time not being enough
- time.sleep(self.WAITING)
def test_12_get_service_Ethernet(self):
response = test_utils.get_ordm_serv_list_attr_request("services", str(self.uuid_services.eth))
response = test_utils.transportpce_api_rpc_request(
'tapi-notification', 'get-notification-list', self.cr_get_notif_list_input_data)
self.assertEqual(response['status_code'], requests.codes.ok)
- self.assertEqual(response['output']['notification'][1]['target-object-identifier'], str(self.uuid_services.eth))
- self.assertEqual(response['output']['notification'][1]['target-object-type'], 'CONNECTIVITY_SERVICE')
- self.assertEqual(response['output']['notification'][1]['changed-attributes'][0]['new-value'], 'UNLOCKED')
- self.assertEqual(response['output']['notification'][1]['changed-attributes'][1]['new-value'], 'ENABLED')
+ self.assertEqual(response['output']['notification'][0]['target-object-identifier'], str(self.uuid_services.eth))
+ self.assertEqual(response['output']['notification'][0]['target-object-type'], 'CONNECTIVITY_SERVICE')
+ self.assertEqual(response['output']['notification'][0]['changed-attributes'][0]['new-value'], 'UNLOCKED')
+ self.assertEqual(response['output']['notification'][0]['changed-attributes'][1]['new-value'], 'ENABLED')
time.sleep(2)
def test_19_delete_connectivity_service_Ethernet(self):
setenv =
PIP_EXTRA_INDEX_URL = https://gitlab.com/api/v4/projects/33090323/packages/pypi/simple
USE_LIGHTY=True
- USE_ODL_RESTCONF_VERSION=lighty
+# USE_ODL_RESTCONF_VERSION=draft-bierman02
deps =
-r{toxinidir}/tests/requirements.txt
-r{toxinidir}/tests/test-requirements.txt
passenv = LAUNCHER USE_LIGHTY USE_ODL_RESTCONF_VERSION
setenv =
USE_LIGHTY=True
- USE_ODL_RESTCONF_VERSION=lighty
+# USE_ODL_RESTCONF_VERSION=draft-bierman02
USE_ODL_ALT_KARAF_ENV=./karaf121.env
USE_ODL_ALT_KARAF_INSTALL_DIR=karaf121
commands =
passenv = LAUNCHER USE_LIGHTY USE_ODL_RESTCONF_VERSION
setenv =
USE_LIGHTY=True
- USE_ODL_RESTCONF_VERSION=lighty
+# USE_ODL_RESTCONF_VERSION=draft-bierman02
USE_ODL_ALT_KARAF_ENV=./karaf221.env
USE_ODL_ALT_KARAF_INSTALL_DIR=karaf221
commands =
passenv = LAUNCHER USE_LIGHTY USE_ODL_RESTCONF_VERSION
setenv =
USE_LIGHTY=True
- USE_ODL_RESTCONF_VERSION=lighty
+# USE_ODL_RESTCONF_VERSION=draft-bierman02
USE_ODL_ALT_KARAF_ENV=./karaf71.env
USE_ODL_ALT_KARAF_INSTALL_DIR=karaf71
commands =
passenv = LAUNCHER USE_LIGHTY USE_ODL_RESTCONF_VERSION
setenv =
USE_LIGHTY=True
- USE_ODL_RESTCONF_VERSION=lighty
+# USE_ODL_RESTCONF_VERSION=draft-bierman02
USE_ODL_ALT_KARAF_ENV=./karaf121.env
USE_ODL_ALT_KARAF_INSTALL_DIR=karaf_hybrid
commands =
passenv = LAUNCHER USE_LIGHTY OLM_TIMER1 OLM_TIMER2 USE_ODL_RESTCONF_VERSION
setenv =
USE_LIGHTY=True
- USE_ODL_RESTCONF_VERSION=lighty
+# USE_ODL_RESTCONF_VERSION=draft-bierman02
USE_ODL_ALT_KARAF_ENV=./karaf221.env
USE_ODL_ALT_KARAF_INSTALL_DIR=karaf221
INSTALL_TAPI=True
OLM_TIMER2=2000
INSTALL_TAPI=True
INSTALL_NBINOTIFICATIONS=True
- USE_ODL_RESTCONF_VERSION=lighty
+# USE_ODL_RESTCONF_VERSION=draft-bierman02
commands =
./dockercmd.sh run -d -p 2181:2181 -p 9092:9092 --env ADVERTISED_LISTENERS=PLAINTEXT://localhost:9092 --name tpce_kafka1 teivah/kafka:2.0.0