RIC-193 - Setup from RAN: set connection status to CONNECTED in case RM failure 51/3151/1
authorns019t <ns019t@intl.att.com>
Sun, 5 Apr 2020 15:30:38 +0000 (18:30 +0300)
committerns019t <ns019t@intl.att.com>
Sun, 5 Apr 2020 15:30:52 +0000 (18:30 +0300)
Change-Id: Ifaa42f7916f0ca99dd21c50983d158e628791666
Signed-off-by: ns019t <ns019t@intl.att.com>
E2Manager/handlers/rmrmsghandlers/e2_setup_request_notification_handler.go
E2Manager/handlers/rmrmsghandlers/e2_setup_request_notification_handler_test.go

index 405d30d..8271e64 100644 (file)
@@ -113,6 +113,10 @@ func (h E2SetupRequestNotificationHandler) Handle(request *models.NotificationRe
        err = h.e2tAssociationManager.AssociateRan(e2tIpAddress, nodebInfo)
        if err != nil{
                h.logger.Errorf("#E2SetupRequestNotificationHandler.Handle - RAN name: %s - failed to associate E2T to nodeB entity. Error: %s", ranName, err)
+               err = h.rNibDataService.UpdateNodebInfo(nodebInfo)
+               if err != nil {
+                       h.logger.Errorf("#E2SetupRequestNotificationHandler.Handle - RAN name: %s - Failed to update nodebInfo entity. Error: %s", ranName, err)
+               }
                return
        }
 
index f1d73e1..6421bf9 100644 (file)
@@ -304,6 +304,7 @@ func TestE2SetupRequestNotificationHandler_HandleAssociationError(t *testing.T)
        var gnb *entities.NodebInfo
        readerMock.On("GetNodeb", mock.Anything).Return(gnb, common.NewResourceNotFoundError("Not found"))
        writerMock.On("SaveNodeb", mock.Anything, mock.Anything).Return(nil)
+       writerMock.On("UpdateNodebInfo", mock.Anything).Return(nil)
        routingManagerClientMock.On("AssociateRanToE2TInstance", e2tInstanceFullAddress, mock.Anything).Return(errors.New("association error"))
 
        prefBytes := []byte(prefix)
@@ -313,7 +314,7 @@ func TestE2SetupRequestNotificationHandler_HandleAssociationError(t *testing.T)
        e2tInstancesManagerMock.AssertCalled(t, "GetE2TInstance", e2tInstanceFullAddress)
        writerMock.AssertCalled(t, "SaveNodeb", mock.Anything, mock.Anything)
        routingManagerClientMock.AssertCalled(t, "AssociateRanToE2TInstance", e2tInstanceFullAddress, mock.Anything)
-       writerMock.AssertNotCalled(t, "UpdateNodebInfo", mock.Anything)
+       writerMock.AssertCalled(t, "UpdateNodebInfo", mock.Anything)
        e2tInstancesManagerMock.AssertNotCalled(t, "AddRansToInstance", mock.Anything, mock.Anything)
        rmrMessengerMock.AssertNotCalled(t, "SendMsg", mock.Anything, mock.Anything)
 }