[RIC-432] - Support Update eNB REST API - use RanListManager in red buttom and get nodeb id list
Change-Id: I105b9145cfc6a71bd419a5b8809080f1d9c77a19
Signed-off-by: Irina <ib565x@intl.att.com>
diff --git a/E2Manager/container-tag.yaml b/E2Manager/container-tag.yaml
index d09274c..06fe115 100644
--- a/E2Manager/container-tag.yaml
+++ b/E2Manager/container-tag.yaml
@@ -1,4 +1,4 @@
# The Jenkins job requires a tag to build the Docker image.
# Global-JJB script assumes this file is in the repo root.
---
-tag: 5.2.15
+tag: 5.2.16
diff --git a/E2Manager/controllers/nodeb_controller_test.go b/E2Manager/controllers/nodeb_controller_test.go
index a872777..eb7b917 100644
--- a/E2Manager/controllers/nodeb_controller_test.go
+++ b/E2Manager/controllers/nodeb_controller_test.go
@@ -302,7 +302,7 @@
return ret
}
-func setupControllerTest(t *testing.T) (*NodebController, *mocks.RnibReaderMock, *mocks.RnibWriterMock, *mocks.RmrMessengerMock, *mocks.E2TInstancesManagerMock) {
+func setupControllerTest(t *testing.T) (*NodebController, *mocks.RnibReaderMock, *mocks.RnibWriterMock, *mocks.RmrMessengerMock, *mocks.E2TInstancesManagerMock, managers.RanListManager) {
log := initLog(t)
config := configuration.ParseConfiguration()
@@ -324,11 +324,11 @@
handlerProvider := httpmsghandlerprovider.NewIncomingRequestHandlerProvider(log, rmrSender, config, rnibDataService, e2tInstancesManager, rmClient, ranConnectStatusChangeManager, nodebValidator, updateEnbManager, ranListManager)
controller := NewNodebController(log, handlerProvider)
- return controller, readerMock, writerMock, rmrMessengerMock, e2tInstancesManager
+ return controller, readerMock, writerMock, rmrMessengerMock, e2tInstancesManager, ranListManager
}
func TestShutdownHandlerRnibError(t *testing.T) {
- controller, _, _, _, e2tInstancesManagerMock := setupControllerTest(t)
+ controller, _, _, _, e2tInstancesManagerMock, _ := setupControllerTest(t)
e2tInstancesManagerMock.On("GetE2TAddresses").Return([]string{}, e2managererrors.NewRnibDbError())
writer := httptest.NewRecorder()
@@ -342,7 +342,7 @@
}
func TestSetGeneralConfigurationHandlerRnibError(t *testing.T) {
- controller, readerMock, _, _, _ := setupControllerTest(t)
+ controller, readerMock, _, _, _ , _:= setupControllerTest(t)
configuration := &entities.GeneralConfiguration{}
readerMock.On("GetGeneralConfiguration").Return(configuration, e2managererrors.NewRnibDbError())
@@ -360,7 +360,7 @@
}
func TestSetGeneralConfigurationInvalidJson(t *testing.T) {
- controller, _, _, _, _ := setupControllerTest(t)
+ controller, _, _, _, _, _ := setupControllerTest(t)
writer := httptest.NewRecorder()
@@ -375,7 +375,7 @@
}
func controllerGetNodebTestExecuter(t *testing.T, context *controllerGetNodebTestContext) {
- controller, readerMock, _, _, _ := setupControllerTest(t)
+ controller, readerMock, _, _, _, _ := setupControllerTest(t)
writer := httptest.NewRecorder()
readerMock.On("GetNodeb", context.ranName).Return(context.nodebInfo, context.rnibError)
req, _ := http.NewRequest(http.MethodGet, "/nodeb", nil)
@@ -387,10 +387,16 @@
}
func controllerGetNodebIdListTestExecuter(t *testing.T, context *controllerGetNodebIdListTestContext) {
- controller, readerMock, _, _, _ := setupControllerTest(t)
+ controller, readerMock, _, _, _, ranListManager := setupControllerTest(t)
writer := httptest.NewRecorder()
readerMock.On("GetListNodebIds").Return(context.nodebIdList, context.rnibError)
- req, _ := http.NewRequest(http.MethodGet, "/nodeb/ids", nil)
+
+ err := ranListManager.InitNbIdentityMap()
+ if err != nil {
+ t.Errorf("Error cannot init identity")
+ }
+
+ req, _ := http.NewRequest(http.MethodGet, "/nodeb/states", nil)
controller.GetNodebIdList(writer, req)
assert.Equal(t, context.expectedStatusCode, writer.Result().StatusCode)
bodyBytes, _ := ioutil.ReadAll(writer.Body)
@@ -491,7 +497,7 @@
}
func controllerUpdateEnbTestExecuter(t *testing.T, context *controllerUpdateEnbTestContext) {
- controller, readerMock, writerMock, _, _ := setupControllerTest(t)
+ controller, readerMock, writerMock, _, _, _ := setupControllerTest(t)
writer := httptest.NewRecorder()
r := buildUpdateEnbRequest(context)
@@ -510,7 +516,7 @@
}
func controllerUpdateGnbTestExecuter(t *testing.T, context *controllerUpdateGnbTestContext) {
- controller, readerMock, writerMock, _, _ := setupControllerTest(t)
+ controller, readerMock, writerMock, _, _, _ := setupControllerTest(t)
writer := httptest.NewRecorder()
activateControllerUpdateGnbMocks(context, readerMock, writerMock)
@@ -545,7 +551,7 @@
}
func controllerAddEnbTestExecuter(t *testing.T, context *controllerAddEnbTestContext) {
- controller, readerMock, writerMock, _, _ := setupControllerTest(t)
+ controller, readerMock, writerMock, _, _, _ := setupControllerTest(t)
writer := httptest.NewRecorder()
r := buildAddEnbRequest(context)
body, _ := ioutil.ReadAll(io.LimitReader(r.Body, LimitRequest))
@@ -561,7 +567,7 @@
}
func controllerDeleteEnbTestExecuter(t *testing.T, context *controllerDeleteEnbTestContext) {
- controller, readerMock, writerMock, _, _ := setupControllerTest(t)
+ controller, readerMock, writerMock, _, _, _ := setupControllerTest(t)
readerMock.On("GetNodeb", RanName).Return(context.getNodebInfoResult.nodebInfo, context.getNodebInfoResult.rnibError)
if context.getNodebInfoResult.rnibError == nil && context.getNodebInfoResult.nodebInfo.GetNodeType() == entities.Node_ENB {
writerMock.On("RemoveEnb", context.getNodebInfoResult.nodebInfo).Return(nil)
@@ -861,7 +867,7 @@
}
func TestControllerUpdateEnbInvalidRequest(t *testing.T) {
- controller, _, _, _, _ := setupControllerTest(t)
+ controller, _, _, _, _, _ := setupControllerTest(t)
writer := httptest.NewRecorder()
invalidJson := strings.NewReader("{enb:\"whatever\"")
@@ -1120,7 +1126,7 @@
}
func TestControllerAddEnbInvalidRequest(t *testing.T) {
- controller, _, _, _, _ := setupControllerTest(t)
+ controller, _, _, _, _, _ := setupControllerTest(t)
writer := httptest.NewRecorder()
// Invalid json: attribute name without quotes (should be "cause":).
@@ -1365,20 +1371,8 @@
controllerGetNodebIdListTestExecuter(t, &context)
}
-func TestControllerGetNodebIdListInternal(t *testing.T) {
- var nodebIdList []*entities.NbIdentity
- context := controllerGetNodebIdListTestContext{
- nodebIdList: nodebIdList,
- rnibError: common.NewInternalError(errors.New("#reader.GetNodeb - Internal Error")),
- expectedStatusCode: http.StatusInternalServerError,
- expectedJsonResponse: RnibErrorJson,
- }
-
- controllerGetNodebIdListTestExecuter(t, &context)
-}
-
func TestHeaderValidationFailed(t *testing.T) {
- controller, _, _, _, _ := setupControllerTest(t)
+ controller, _, _, _, _, _ := setupControllerTest(t)
writer := httptest.NewRecorder()
@@ -1395,7 +1389,7 @@
}
func TestShutdownStatusNoContent(t *testing.T) {
- controller, readerMock, _, _, e2tInstancesManagerMock := setupControllerTest(t)
+ controller, readerMock, _, _, e2tInstancesManagerMock, _ := setupControllerTest(t)
e2tInstancesManagerMock.On("GetE2TAddresses").Return([]string{}, nil)
readerMock.On("GetListNodebIds").Return([]*entities.NbIdentity{}, nil)
@@ -1406,7 +1400,7 @@
}
func TestHandleInternalError(t *testing.T) {
- controller, _, _, _, _ := setupControllerTest(t)
+ controller, _, _, _, _, _ := setupControllerTest(t)
writer := httptest.NewRecorder()
err := e2managererrors.NewInternalError()
@@ -1420,7 +1414,7 @@
}
func TestHandleCommandAlreadyInProgressError(t *testing.T) {
- controller, _, _, _, _ := setupControllerTest(t)
+ controller, _, _, _, _, _ := setupControllerTest(t)
writer := httptest.NewRecorder()
err := e2managererrors.NewCommandAlreadyInProgressError()
@@ -1433,7 +1427,7 @@
}
func TestHandleRoutingManagerError(t *testing.T) {
- controller, _, _, _, _ := setupControllerTest(t)
+ controller, _, _, _, _, _ := setupControllerTest(t)
writer := httptest.NewRecorder()
err := e2managererrors.NewRoutingManagerError()
@@ -1446,7 +1440,7 @@
}
func TestHandleE2TInstanceAbsenceError(t *testing.T) {
- controller, _, _, _, _ := setupControllerTest(t)
+ controller, _, _, _, _, _ := setupControllerTest(t)
writer := httptest.NewRecorder()
err := e2managererrors.NewE2TInstanceAbsenceError()
@@ -1460,7 +1454,7 @@
}
func TestValidateHeaders(t *testing.T) {
- controller, _, _, _, _ := setupControllerTest(t)
+ controller, _, _, _, _, _ := setupControllerTest(t)
header := http.Header{}
header.Set("Content-Type", "application/json")
@@ -1490,7 +1484,7 @@
}
func TestX2ResetHandleSuccessfulRequestedCause(t *testing.T) {
- controller, readerMock, _, rmrMessengerMock, _ := setupControllerTest(t)
+ controller, readerMock, _, rmrMessengerMock, _, _ := setupControllerTest(t)
ranName := "test1"
payload := []byte{0x00, 0x07, 0x00, 0x08, 0x00, 0x00, 0x01, 0x00, 0x05, 0x40, 0x01, 0x40}
@@ -1516,7 +1510,7 @@
}
func TestX2ResetHandleSuccessfulRequestedDefault(t *testing.T) {
- controller, readerMock, _, rmrMessengerMock, _ := setupControllerTest(t)
+ controller, readerMock, _, rmrMessengerMock, _, _ := setupControllerTest(t)
ranName := "test1"
// o&m intervention
@@ -1543,7 +1537,7 @@
}
func TestX2ResetHandleFailureInvalidBody(t *testing.T) {
- controller, _, _, _, _ := setupControllerTest(t)
+ controller, _, _, _, _, _ := setupControllerTest(t)
ranName := "test1"
@@ -1560,7 +1554,7 @@
}
func TestHandleErrorResponse(t *testing.T) {
- controller, _, _, _, _ := setupControllerTest(t)
+ controller, _, _, _, _, _ := setupControllerTest(t)
writer := httptest.NewRecorder()
controller.handleErrorResponse(e2managererrors.NewRnibDbError(), writer)
diff --git a/E2Manager/handlers/httpmsghandlers/delete_all_request_handler.go b/E2Manager/handlers/httpmsghandlers/delete_all_request_handler.go
index 4e4142e..80f1a04 100644
--- a/E2Manager/handlers/httpmsghandlers/delete_all_request_handler.go
+++ b/E2Manager/handlers/httpmsghandlers/delete_all_request_handler.go
@@ -43,11 +43,12 @@
e2tInstancesManager managers.IE2TInstancesManager
rmClient clients.IRoutingManagerClient
ranConnectStatusChangeManager managers.IRanConnectStatusChangeManager
+ ranListManager managers.RanListManager
}
const PartialSuccessDueToRmErrorMessage = "Operation succeeded except for routing manager outbound call"
-func NewDeleteAllRequestHandler(logger *logger.Logger, rmrSender *rmrsender.RmrSender, config *configuration.Configuration, rnibDataService services.RNibDataService, e2tInstancesManager managers.IE2TInstancesManager, rmClient clients.IRoutingManagerClient, ranConnectStatusChangeManager managers.IRanConnectStatusChangeManager) *DeleteAllRequestHandler {
+func NewDeleteAllRequestHandler(logger *logger.Logger, rmrSender *rmrsender.RmrSender, config *configuration.Configuration, rnibDataService services.RNibDataService, e2tInstancesManager managers.IE2TInstancesManager, rmClient clients.IRoutingManagerClient, ranConnectStatusChangeManager managers.IRanConnectStatusChangeManager, ranListManager managers.RanListManager) *DeleteAllRequestHandler {
return &DeleteAllRequestHandler{
logger: logger,
rnibDataService: rnibDataService,
@@ -56,6 +57,7 @@
e2tInstancesManager: e2tInstancesManager,
rmClient: rmClient,
ranConnectStatusChangeManager: ranConnectStatusChangeManager,
+ ranListManager: ranListManager,
}
}
@@ -127,13 +129,7 @@
}
func (h *DeleteAllRequestHandler) updateNodebs(updateCb func(node *entities.NodebInfo) (error, bool)) (error, bool) {
- nbIdentityList, err := h.rnibDataService.GetListNodebIds()
-
- if err != nil {
- h.logger.Errorf("#DeleteAllRequestHandler.updateNodebs - failed to get nodes list from rNib. Error: %s", err)
- return e2managererrors.NewRnibDbError(), false
- }
-
+ nbIdentityList := h.ranListManager.GetNbIdentityList()
updatedAtLeastOnce := false
for _, nbIdentity := range nbIdentityList {
diff --git a/E2Manager/handlers/httpmsghandlers/delete_all_request_handler_test.go b/E2Manager/handlers/httpmsghandlers/delete_all_request_handler_test.go
index ef9a765..58971bd 100644
--- a/E2Manager/handlers/httpmsghandlers/delete_all_request_handler_test.go
+++ b/E2Manager/handlers/httpmsghandlers/delete_all_request_handler_test.go
@@ -45,9 +45,9 @@
const E2TAddress = "10.0.2.15:8989"
const BaseRMUrl = "http://10.10.2.15:12020/routingmanager"
-func setupDeleteAllRequestHandlerTest(t *testing.T) (*DeleteAllRequestHandler, *mocks.RnibReaderMock, *mocks.RnibWriterMock, *mocks.RmrMessengerMock, *mocks.HttpClientMock) {
+func setupDeleteAllRequestHandlerTest(t *testing.T) (*DeleteAllRequestHandler, *mocks.RnibReaderMock, *mocks.RnibWriterMock, *mocks.RmrMessengerMock, *mocks.HttpClientMock, managers.RanListManager) {
log := initLog(t)
- config := &configuration.Configuration{RnibWriter: configuration.RnibWriterConfig{ StateChangeMessageChannel: "RAN_CONNECTION_STATUS_CHANGE"}}
+ config := &configuration.Configuration{RnibWriter: configuration.RnibWriterConfig{StateChangeMessageChannel: "RAN_CONNECTION_STATUS_CHANGE"}}
config.BigRedButtonTimeoutSec = 1
config.RoutingManager.BaseUrl = BaseRMUrl
@@ -64,10 +64,10 @@
ranListManager := managers.NewRanListManager(log, rnibDataService)
ranAlarmService := services.NewRanAlarmService(log, config)
- ranConnectStatusChangeManager := managers.NewRanConnectStatusChangeManager(log, rnibDataService,ranListManager, ranAlarmService)
+ ranConnectStatusChangeManager := managers.NewRanConnectStatusChangeManager(log, rnibDataService, ranListManager, ranAlarmService)
- handler := NewDeleteAllRequestHandler(log, rmrSender, config, rnibDataService, e2tInstancesManager, rmClient, ranConnectStatusChangeManager)
- return handler, readerMock, writerMock, rmrMessengerMock, httpClientMock
+ handler := NewDeleteAllRequestHandler(log, rmrSender, config, rnibDataService, e2tInstancesManager, rmClient, ranConnectStatusChangeManager, ranListManager)
+ return handler, readerMock, writerMock, rmrMessengerMock, httpClientMock, ranListManager
}
func mapE2TAddressesToE2DataList(e2tAddresses []string) models.RoutingManagerE2TDataList {
@@ -97,7 +97,7 @@
}
func TestGetE2TAddressesFailure(t *testing.T) {
- h, readerMock, _, _, _ := setupDeleteAllRequestHandlerTest(t)
+ h, readerMock, _, _, _ , _:= setupDeleteAllRequestHandlerTest(t)
readerMock.On("GetE2TAddresses").Return([]string{}, common.NewInternalError(errors.New("error")))
_, err := h.Handle(nil)
assert.IsType(t, &e2managererrors.RnibDbError{}, err)
@@ -105,25 +105,39 @@
}
func TestOneRanGetE2TAddressesEmptyList(t *testing.T) {
- h, readerMock, writerMock, _, _ := setupDeleteAllRequestHandlerTest(t)
- readerMock.On("GetE2TAddresses").Return([]string{}, nil)
+ h, readerMock, writerMock, _, _, ranListManager:= setupDeleteAllRequestHandlerTest(t)
+
nbIdentityList := []*entities.NbIdentity{{InventoryName: "RanName_1"}}
readerMock.On("GetListNodebIds").Return(nbIdentityList, nil)
+
+ err := ranListManager.InitNbIdentityMap()
+ if err != nil {
+ t.Errorf("Error cannot init identity")
+ }
+
+ readerMock.On("GetE2TAddresses").Return([]string{}, nil)
nb1 := &entities.NodebInfo{RanName: "RanName_1", ConnectionStatus: entities.ConnectionStatus_DISCONNECTED,}
readerMock.On("GetNodeb", "RanName_1").Return(nb1, nil)
updatedNb1 := &entities.NodebInfo{RanName: "RanName_1", ConnectionStatus: entities.ConnectionStatus_SHUT_DOWN,}
writerMock.On("UpdateNodebInfo", updatedNb1).Return(nil)
- _, err := h.Handle(nil)
+ _, err = h.Handle(nil)
assert.Nil(t, err)
readerMock.AssertExpectations(t)
writerMock.AssertExpectations(t)
}
func TestTwoRansGetE2TAddressesEmptyListOneGetNodebFailure(t *testing.T) {
- h, readerMock, writerMock, _, _ := setupDeleteAllRequestHandlerTest(t)
+ h, readerMock, writerMock, _, _ , ranListManager := setupDeleteAllRequestHandlerTest(t)
+
readerMock.On("GetE2TAddresses").Return([]string{}, nil)
nbIdentityList := []*entities.NbIdentity{{InventoryName: "RanName_1"}, {InventoryName: "RanName_2"}}
readerMock.On("GetListNodebIds").Return(nbIdentityList, nil)
+
+ err := ranListManager.InitNbIdentityMap()
+ if err != nil {
+ t.Errorf("Error cannot init identity")
+ }
+
nb1 := &entities.NodebInfo{RanName: "RanName_1", ConnectionStatus: entities.ConnectionStatus_DISCONNECTED,}
readerMock.On("GetNodeb", "RanName_1").Return(nb1, nil)
@@ -136,18 +150,25 @@
var nb2 *entities.NodebInfo
readerMock.On("GetNodeb", "RanName_2").Return(nb2, common.NewInternalError(errors.New("error")))
- _, err := h.Handle(nil)
- assert.IsType(t,&e2managererrors.RnibDbError{}, err)
+ _, err = h.Handle(nil)
+ assert.IsType(t, &e2managererrors.RnibDbError{}, err)
writerMock.AssertNumberOfCalls(t, "UpdateNodebInfo", 2)
writerMock.AssertNumberOfCalls(t, "UpdateNodebInfoOnConnectionStatusInversion", 0)
readerMock.AssertExpectations(t)
}
func TestUpdateNodebInfoOnConnectionStatusInversionFailure(t *testing.T) {
- h, readerMock, writerMock, _, _ := setupDeleteAllRequestHandlerTest(t)
+ h, readerMock, writerMock, _, _ , ranListManager := setupDeleteAllRequestHandlerTest(t)
+
readerMock.On("GetE2TAddresses").Return([]string{}, nil)
nbIdentityList := []*entities.NbIdentity{{InventoryName: "RanName_1"}, {InventoryName: "RanName_2"}}
readerMock.On("GetListNodebIds").Return(nbIdentityList, nil)
+
+ err := ranListManager.InitNbIdentityMap()
+ if err != nil {
+ t.Errorf("Error cannot init identity")
+ }
+
nb1 := &entities.NodebInfo{RanName: "RanName_1", ConnectionStatus: entities.ConnectionStatus_CONNECTED}
readerMock.On("GetNodeb", "RanName_1").Return(nb1, nil)
@@ -155,20 +176,26 @@
updatedNb1.ConnectionStatus = entities.ConnectionStatus_SHUT_DOWN
writerMock.On("UpdateNodebInfoOnConnectionStatusInversion", &updatedNb1, "RanName_1_DISCONNECTED").Return(common.NewInternalError(errors.New("error")))
- _, err := h.Handle(nil)
+ _, err = h.Handle(nil)
- assert.IsType(t,&e2managererrors.RnibDbError{}, err)
+ assert.IsType(t, &e2managererrors.RnibDbError{}, err)
writerMock.AssertNumberOfCalls(t, "UpdateNodebInfo", 0)
writerMock.AssertNumberOfCalls(t, "UpdateNodebInfoOnConnectionStatusInversion", 1)
readerMock.AssertExpectations(t)
}
func TestTwoRansGetE2TAddressesEmptyListOneUpdateNodebInfoFailure(t *testing.T) {
- h, readerMock, writerMock, _, _ := setupDeleteAllRequestHandlerTest(t)
+ h, readerMock, writerMock, _, _, ranListManager := setupDeleteAllRequestHandlerTest(t)
+
readerMock.On("GetE2TAddresses").Return([]string{}, nil)
nbIdentityList := []*entities.NbIdentity{{InventoryName: "RanName_1"}, {InventoryName: "RanName_2"}}
readerMock.On("GetListNodebIds").Return(nbIdentityList, nil)
+ err := ranListManager.InitNbIdentityMap()
+ if err != nil {
+ t.Errorf("Error cannot init identity")
+ }
+
nb1 := &entities.NodebInfo{RanName: "RanName_1", ConnectionStatus: entities.ConnectionStatus_DISCONNECTED,}
readerMock.On("GetNodeb", "RanName_1").Return(nb1, nil)
updatedNb1 := &entities.NodebInfo{RanName: "RanName_1", ConnectionStatus: entities.ConnectionStatus_SHUT_DOWN,}
@@ -178,47 +205,25 @@
readerMock.On("GetNodeb", "RanName_2").Return(nb2, nil)
updatedNb2 := &entities.NodebInfo{RanName: "RanName_2", ConnectionStatus: entities.ConnectionStatus_SHUT_DOWN,}
writerMock.On("UpdateNodebInfo", updatedNb2).Return(common.NewInternalError(errors.New("error")))
- _, err := h.Handle(nil)
- assert.IsType(t,&e2managererrors.RnibDbError{}, err)
- readerMock.AssertExpectations(t)
- writerMock.AssertExpectations(t)
-}
-
-func TestOneRanDissociateSucceedsTryShuttingDownFailure(t *testing.T) {
- h, readerMock, writerMock, _, httpClientMock := setupDeleteAllRequestHandlerTest(t)
- e2tAddresses := []string{E2TAddress}
- readerMock.On("GetE2TAddresses").Return(e2tAddresses, nil)
- mockHttpClientDissociateAllRans(httpClientMock, e2tAddresses, true)
- nbIdentityList := []*entities.NbIdentity{}
- readerMock.On("GetListNodebIds").Return(nbIdentityList, common.NewInternalError(errors.New("error")))
- _, err := h.Handle(nil)
- assert.IsType(t, &e2managererrors.RnibDbError{}, err)
- readerMock.AssertExpectations(t)
- writerMock.AssertExpectations(t)
-}
-
-func TestOneRanDissociateFailsTryShuttingDownFailure(t *testing.T) {
- h, readerMock, writerMock, _, httpClientMock := setupDeleteAllRequestHandlerTest(t)
- e2tAddresses := []string{E2TAddress}
-
- readerMock.On("GetE2TAddresses").Return(e2tAddresses, nil)
- mockHttpClientDissociateAllRans(httpClientMock, e2tAddresses, false)
- nbIdentityList := []*entities.NbIdentity{}
- readerMock.On("GetListNodebIds").Return(nbIdentityList, common.NewInternalError(errors.New("error")))
- _, err := h.Handle(nil)
+ _, err = h.Handle(nil)
assert.IsType(t, &e2managererrors.RnibDbError{}, err)
readerMock.AssertExpectations(t)
writerMock.AssertExpectations(t)
}
func TestOneRanWithStateShutDown(t *testing.T) {
- h, readerMock, writerMock, rmrMessengerMock, httpClientMock := setupDeleteAllRequestHandlerTest(t)
+ h, readerMock, writerMock, rmrMessengerMock, httpClientMock, ranListManager := setupDeleteAllRequestHandlerTest(t)
e2tAddresses := []string{E2TAddress}
readerMock.On("GetE2TAddresses").Return(e2tAddresses, nil)
mockHttpClientDissociateAllRans(httpClientMock, e2tAddresses, true)
nbIdentityList := []*entities.NbIdentity{{InventoryName: "RanName_1"}}
readerMock.On("GetListNodebIds").Return(nbIdentityList, nil)
+ err := ranListManager.InitNbIdentityMap()
+ if err != nil {
+ t.Errorf("Error cannot init identity")
+ }
+
nb1 := &entities.NodebInfo{RanName: "RanName_1", ConnectionStatus: entities.ConnectionStatus_SHUT_DOWN}
readerMock.On("GetNodeb", "RanName_1").Return(nb1, nil)
readerMock.On("GetE2TAddresses").Return([]string{E2TAddress}, nil)
@@ -233,7 +238,7 @@
mbuf := rmrCgo.NewMBuf(rmrMessage.MsgType, len(rmrMessage.Payload), rmrMessage.RanName, &rmrMessage.Payload, &rmrMessage.XAction, rmrMessage.GetMsgSrc())
rmrMessengerMock.On("SendMsg", mbuf, true).Return(mbuf, nil)
- _, err := h.Handle(nil)
+ _, err = h.Handle(nil)
assert.Nil(t, err)
rmrMessengerMock.AssertCalled(t, "SendMsg", mbuf, true)
@@ -242,13 +247,18 @@
}
func TestOneRanShutDown(t *testing.T) {
- h, readerMock, writerMock, _, httpClientMock := setupDeleteAllRequestHandlerTest(t)
+ h, readerMock, writerMock, _, httpClientMock, ranListManager := setupDeleteAllRequestHandlerTest(t)
e2tAddresses := []string{}
readerMock.On("GetE2TAddresses").Return(e2tAddresses, nil)
mockHttpClientDissociateAllRans(httpClientMock, e2tAddresses, true)
nbIdentityList := []*entities.NbIdentity{{InventoryName: "RanName_1"}}
readerMock.On("GetListNodebIds").Return(nbIdentityList, nil)
+ err := ranListManager.InitNbIdentityMap()
+ if err != nil {
+ t.Errorf("Error cannot init identity")
+ }
+
nb1 := &entities.NodebInfo{RanName: "RanName_1", ConnectionStatus: entities.ConnectionStatus_SHUTTING_DOWN}
readerMock.On("GetNodeb", "RanName_1").Return(nb1, nil)
@@ -257,7 +267,7 @@
readerMock.On("GetE2TAddresses").Return([]string{E2TAddress}, nil)
- _, err := h.Handle(nil)
+ _, err = h.Handle(nil)
assert.Nil(t, err)
readerMock.AssertExpectations(t)
@@ -265,13 +275,19 @@
}
func TestOneRanTryShuttingDownSucceedsClearFails(t *testing.T) {
- h, readerMock, writerMock, _, httpClientMock := setupDeleteAllRequestHandlerTest(t)
+ h, readerMock, writerMock, _, httpClientMock, ranListManager := setupDeleteAllRequestHandlerTest(t)
+
e2tAddresses := []string{E2TAddress}
readerMock.On("GetE2TAddresses").Return(e2tAddresses, nil)
mockHttpClientDissociateAllRans(httpClientMock, e2tAddresses, true)
nbIdentityList := []*entities.NbIdentity{{InventoryName: "RanName_1"}}
readerMock.On("GetListNodebIds").Return(nbIdentityList, nil)
+ err := ranListManager.InitNbIdentityMap()
+ if err != nil {
+ t.Errorf("Error cannot init identity")
+ }
+
nb1 := &entities.NodebInfo{RanName: "RanName_1", ConnectionStatus: entities.ConnectionStatus_CONNECTED, AssociatedE2TInstanceAddress: E2TAddress}
readerMock.On("GetNodeb", "RanName_1").Return(nb1, nil)
@@ -284,20 +300,26 @@
readerMock.On("GetE2TAddresses").Return([]string{E2TAddress}, nil)
readerMock.On("GetE2TInstances", []string{E2TAddress}).Return([]*entities.E2TInstance{}, common.NewInternalError(errors.New("error")))
- _, err := h.Handle(nil)
+ _, err = h.Handle(nil)
assert.IsType(t, &e2managererrors.RnibDbError{}, err)
readerMock.AssertExpectations(t)
writerMock.AssertExpectations(t)
}
func TestOneRanTryShuttingDownUpdateNodebError(t *testing.T) {
- h, readerMock, writerMock, _, httpClientMock := setupDeleteAllRequestHandlerTest(t)
+ h, readerMock, writerMock, _, httpClientMock, ranListManager := setupDeleteAllRequestHandlerTest(t)
+
e2tAddresses := []string{E2TAddress}
readerMock.On("GetE2TAddresses").Return(e2tAddresses, nil)
mockHttpClientDissociateAllRans(httpClientMock, e2tAddresses, true)
nbIdentityList := []*entities.NbIdentity{{InventoryName: "RanName_1"}}
readerMock.On("GetListNodebIds").Return(nbIdentityList, nil)
+ err := ranListManager.InitNbIdentityMap()
+ if err != nil {
+ t.Errorf("Error cannot init identity")
+ }
+
nb1 := &entities.NodebInfo{RanName: "RanName_1", ConnectionStatus: entities.ConnectionStatus_CONNECTED, AssociatedE2TInstanceAddress: E2TAddress}
readerMock.On("GetNodeb", "RanName_1").Return(nb1, nil)
@@ -308,7 +330,7 @@
nodeb1NotAssociated := &entities.NodebInfo{RanName: "RanName_1", ConnectionStatus: entities.ConnectionStatus_SHUTTING_DOWN,}
writerMock.On("UpdateNodebInfo", nodeb1NotAssociated).Return(common.NewInternalError(errors.New("error")))
- _, err := h.Handle(nil)
+ _, err = h.Handle(nil)
assert.IsType(t, &e2managererrors.RnibDbError{}, err)
readerMock.AssertExpectations(t)
@@ -316,12 +338,19 @@
}
func TestOneRanTryShuttingDownSucceedsClearSucceedsRmrSendFails(t *testing.T) {
- h, readerMock, writerMock, rmrMessengerMock, httpClientMock := setupDeleteAllRequestHandlerTest(t)
+ h, readerMock, writerMock, rmrMessengerMock, httpClientMock, ranListManager := setupDeleteAllRequestHandlerTest(t)
+
e2tAddresses := []string{E2TAddress}
readerMock.On("GetE2TAddresses").Return(e2tAddresses, nil)
mockHttpClientDissociateAllRans(httpClientMock, e2tAddresses, true)
nbIdentityList := []*entities.NbIdentity{{InventoryName: "RanName_1"}}
readerMock.On("GetListNodebIds").Return(nbIdentityList, nil)
+
+ err := ranListManager.InitNbIdentityMap()
+ if err != nil {
+ t.Errorf("Error cannot init identity")
+ }
+
nb1 := &entities.NodebInfo{RanName: "RanName_1", ConnectionStatus: entities.ConnectionStatus_CONNECTED, AssociatedE2TInstanceAddress: E2TAddress}
readerMock.On("GetNodeb", "RanName_1").Return(nb1, nil)
@@ -342,7 +371,7 @@
rmrMessage := models.RmrMessage{MsgType: rmrCgo.RIC_SCTP_CLEAR_ALL}
mbuf := rmrCgo.NewMBuf(rmrMessage.MsgType, len(rmrMessage.Payload), rmrMessage.RanName, &rmrMessage.Payload, &rmrMessage.XAction, rmrMessage.GetMsgSrc())
rmrMessengerMock.On("SendMsg", mbuf, true).Return(mbuf, e2managererrors.NewRmrError())
- _, err := h.Handle(nil)
+ _, err = h.Handle(nil)
assert.IsType(t, &e2managererrors.RmrError{}, err)
rmrMessengerMock.AssertCalled(t, "SendMsg", mbuf, true)
readerMock.AssertExpectations(t)
@@ -350,12 +379,19 @@
}
func testTwoRansTryShuttingDownSucceedsClearSucceedsRmrSucceedsAllRansAreShutdown(t *testing.T, partial bool) {
- h, readerMock, writerMock, rmrMessengerMock, httpClientMock := setupDeleteAllRequestHandlerTest(t)
+ h, readerMock, writerMock, rmrMessengerMock, httpClientMock, ranListManager := setupDeleteAllRequestHandlerTest(t)
+
e2tAddresses := []string{E2TAddress}
readerMock.On("GetE2TAddresses").Return(e2tAddresses, nil)
mockHttpClientDissociateAllRans(httpClientMock, e2tAddresses, !partial)
nbIdentityList := []*entities.NbIdentity{{InventoryName: "RanName_1"}, {InventoryName: "RanName_2"}}
readerMock.On("GetListNodebIds").Return(nbIdentityList, nil)
+
+ err := ranListManager.InitNbIdentityMap()
+ if err != nil {
+ t.Errorf("Error cannot init identity")
+ }
+
nb1 := &entities.NodebInfo{RanName: "RanName_1", ConnectionStatus: entities.ConnectionStatus_SHUT_DOWN}
nb2 := &entities.NodebInfo{RanName: "RanName_2", ConnectionStatus: entities.ConnectionStatus_SHUT_DOWN}
readerMock.On("GetNodeb", "RanName_1").Return(nb1, nil)
@@ -393,13 +429,18 @@
}
func TestOneRanTryShuttingDownSucceedsClearSucceedsRmrSucceedsRanStatusIsShuttingDownUpdateFailure(t *testing.T) {
- h, readerMock, writerMock, rmrMessengerMock, httpClientMock := setupDeleteAllRequestHandlerTest(t)
+ h, readerMock, writerMock, rmrMessengerMock, httpClientMock, ranListManager := setupDeleteAllRequestHandlerTest(t)
e2tAddresses := []string{E2TAddress}
readerMock.On("GetE2TAddresses").Return(e2tAddresses, nil)
mockHttpClientDissociateAllRans(httpClientMock, e2tAddresses, true)
nbIdentityList := []*entities.NbIdentity{{InventoryName: "RanName_1"}}
readerMock.On("GetListNodebIds").Return(nbIdentityList, nil)
+ err := ranListManager.InitNbIdentityMap()
+ if err != nil {
+ t.Errorf("Error cannot init identity")
+ }
+
nb1 := &entities.NodebInfo{RanName: "RanName_1", ConnectionStatus: entities.ConnectionStatus_SHUTTING_DOWN, AssociatedE2TInstanceAddress: E2TAddress}
readerMock.On("GetNodeb", "RanName_1").Return(nb1, nil)
@@ -425,12 +466,12 @@
readerMock.On("GetListNodebIds").Return(nbIdentityList, nil)
readerMock.On("GetNodeb", "RanName_1").Return(updatedNb1, nil)
- updatedNb2 := *nb1//&entities.NodebInfo{RanName: "RanName_1", ConnectionStatus: entities.ConnectionStatus_SHUT_DOWN,}
+ updatedNb2 := *nb1 //&entities.NodebInfo{RanName: "RanName_1", ConnectionStatus: entities.ConnectionStatus_SHUT_DOWN,}
updatedNb2.ConnectionStatus = entities.ConnectionStatus_SHUT_DOWN
updatedNb2.AssociatedE2TInstanceAddress = ""
writerMock.On("UpdateNodebInfo", &updatedNb2).Return(common.NewInternalError(errors.New("error")))
- _, err := h.Handle(nil)
+ _, err = h.Handle(nil)
assert.IsType(t, &e2managererrors.RnibDbError{}, err)
rmrMessengerMock.AssertCalled(t, "SendMsg", mbuf, true)
@@ -439,12 +480,18 @@
}
func testOneRanTryShuttingDownSucceedsClearSucceedsRmrSucceedsRanStatusIsShuttingDown(t *testing.T, partial bool) {
- h, readerMock, writerMock, rmrMessengerMock, httpClientMock := setupDeleteAllRequestHandlerTest(t)
+ h, readerMock, writerMock, rmrMessengerMock, httpClientMock, ranListManager := setupDeleteAllRequestHandlerTest(t)
e2tAddresses := []string{E2TAddress}
readerMock.On("GetE2TAddresses").Return(e2tAddresses, nil)
mockHttpClientDissociateAllRans(httpClientMock, e2tAddresses, !partial)
nbIdentityList := []*entities.NbIdentity{{InventoryName: "RanName_1"}}
readerMock.On("GetListNodebIds").Return(nbIdentityList, nil)
+
+ err := ranListManager.InitNbIdentityMap()
+ if err != nil {
+ t.Errorf("Error cannot init identity")
+ }
+
updatedNb1 := &entities.NodebInfo{RanName: "RanName_1", ConnectionStatus: entities.ConnectionStatus_SHUTTING_DOWN,}
writerMock.On("UpdateNodebInfo", updatedNb1).Return(nil)
readerMock.On("GetE2TAddresses").Return([]string{E2TAddress}, nil)
@@ -462,7 +509,7 @@
readerMock.On("GetNodeb", "RanName_1").Return(updatedNb1, nil)
updatedNb2 := &entities.NodebInfo{RanName: "RanName_1", ConnectionStatus: entities.ConnectionStatus_SHUT_DOWN,}
writerMock.On("UpdateNodebInfo", updatedNb2).Return(nil)
- _, err := h.Handle(nil)
+ _, err = h.Handle(nil)
assert.Nil(t, err)
rmrMessengerMock.AssertCalled(t, "SendMsg", mbuf, true)
readerMock.AssertExpectations(t)
@@ -470,22 +517,27 @@
writerMock.AssertNumberOfCalls(t, "UpdateNodebInfo", 3)
}
-func TestOneRanTryShuttingDownSucceedsClearSucceedsRmrSucceedsRanStatusIsShuttingDownSuccess (t *testing.T) {
+func TestOneRanTryShuttingDownSucceedsClearSucceedsRmrSucceedsRanStatusIsShuttingDownSuccess(t *testing.T) {
testOneRanTryShuttingDownSucceedsClearSucceedsRmrSucceedsRanStatusIsShuttingDown(t, false)
}
-func TestOneRanTryShuttingDownSucceedsClearSucceedsRmrSucceedsRanStatusIsShuttingDownPartialSuccess (t *testing.T) {
+func TestOneRanTryShuttingDownSucceedsClearSucceedsRmrSucceedsRanStatusIsShuttingDownPartialSuccess(t *testing.T) {
testOneRanTryShuttingDownSucceedsClearSucceedsRmrSucceedsRanStatusIsShuttingDown(t, true)
}
func TestSuccessTwoE2TInstancesSixRans(t *testing.T) {
- h, readerMock, writerMock, rmrMessengerMock, httpClientMock := setupDeleteAllRequestHandlerTest(t)
+ h, readerMock, writerMock, rmrMessengerMock, httpClientMock, ranListManager := setupDeleteAllRequestHandlerTest(t)
e2tAddresses := []string{E2TAddress, E2TAddress2}
readerMock.On("GetE2TAddresses").Return(e2tAddresses, nil)
mockHttpClientDissociateAllRans(httpClientMock, e2tAddresses, true)
nbIdentityList := []*entities.NbIdentity{{InventoryName: "RanName_1"}, {InventoryName: "RanName_2"}, {InventoryName: "RanName_3"}, {InventoryName: "RanName_4"}, {InventoryName: "RanName_5"}, {InventoryName: "RanName_6"}}
readerMock.On("GetListNodebIds").Return(nbIdentityList, nil)
+ err := ranListManager.InitNbIdentityMap()
+ if err != nil {
+ t.Errorf("Error cannot init identity")
+ }
+
updatedNb1 := &entities.NodebInfo{RanName: "RanName_1", ConnectionStatus: entities.ConnectionStatus_SHUTTING_DOWN,}
writerMock.On("UpdateNodebInfo", updatedNb1).Return(nil)
updatedNb2 := &entities.NodebInfo{RanName: "RanName_2", ConnectionStatus: entities.ConnectionStatus_SHUTTING_DOWN,}
@@ -540,7 +592,7 @@
updatedNb6AfterTimer := *updatedNb6
updatedNb6AfterTimer.ConnectionStatus = entities.ConnectionStatus_SHUT_DOWN
writerMock.On("UpdateNodebInfo", &updatedNb6AfterTimer).Return(nil)
- _, err := h.Handle(nil)
+ _, err = h.Handle(nil)
assert.Nil(t, err)
rmrMessengerMock.AssertCalled(t, "SendMsg", mbuf, true)
readerMock.AssertExpectations(t)
diff --git a/E2Manager/handlers/httpmsghandlers/get_nodeb_id_list_request_handler.go b/E2Manager/handlers/httpmsghandlers/get_nodeb_id_list_request_handler.go
index 0ab1f74..a6ade7b 100644
--- a/E2Manager/handlers/httpmsghandlers/get_nodeb_id_list_request_handler.go
+++ b/E2Manager/handlers/httpmsghandlers/get_nodeb_id_list_request_handler.go
@@ -17,12 +17,11 @@
// This source code is part of the near-RT RIC (RAN Intelligent Controller)
// platform project (RICP).
-
package httpmsghandlers
import (
- "e2mgr/e2managererrors"
"e2mgr/logger"
+ "e2mgr/managers"
"e2mgr/models"
"e2mgr/services"
)
@@ -30,23 +29,20 @@
type GetNodebIdListRequestHandler struct {
rNibDataService services.RNibDataService
logger *logger.Logger
+ ranListManager managers.RanListManager
}
-func NewGetNodebIdListRequestHandler(logger *logger.Logger, rNibDataService services.RNibDataService) *GetNodebIdListRequestHandler {
+func NewGetNodebIdListRequestHandler(logger *logger.Logger, rNibDataService services.RNibDataService, ranListManager managers.RanListManager) *GetNodebIdListRequestHandler {
return &GetNodebIdListRequestHandler{
logger: logger,
rNibDataService: rNibDataService,
+ ranListManager: ranListManager,
}
}
func (handler *GetNodebIdListRequestHandler) Handle(request models.Request) (models.IResponse, error) {
- nodebIdList, err := handler.rNibDataService.GetListNodebIds()
-
- if err != nil {
- handler.logger.Errorf("#GetNodebIdListRequestHandler.Handle - Error fetching Nodeb Identity list from rNib: %v", err)
- return nil, e2managererrors.NewRnibDbError()
- }
+ nodebIdList := handler.ranListManager.GetNbIdentityList()
return models.NewGetNodebIdListResponse(nodebIdList), nil
}
diff --git a/E2Manager/handlers/httpmsghandlers/get_nodeb_id_list_request_handler_test.go b/E2Manager/handlers/httpmsghandlers/get_nodeb_id_list_request_handler_test.go
index eb5bae3..6442885 100644
--- a/E2Manager/handlers/httpmsghandlers/get_nodeb_id_list_request_handler_test.go
+++ b/E2Manager/handlers/httpmsghandlers/get_nodeb_id_list_request_handler_test.go
@@ -22,41 +22,39 @@
import (
"e2mgr/configuration"
+ "e2mgr/managers"
"e2mgr/mocks"
"e2mgr/models"
"e2mgr/services"
- "gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/common"
"gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/entities"
- "github.com/pkg/errors"
"github.com/stretchr/testify/assert"
"testing"
)
-func setupGetNodebIdListRequestHandlerTest(t *testing.T) (*GetNodebIdListRequestHandler, *mocks.RnibReaderMock) {
+func setupGetNodebIdListRequestHandlerTest(t *testing.T) (*GetNodebIdListRequestHandler, *mocks.RnibReaderMock, managers.RanListManager) {
log := initLog(t)
config := &configuration.Configuration{RnibRetryIntervalMs: 10, MaxRnibConnectionAttempts: 3}
readerMock := &mocks.RnibReaderMock{}
rnibDataService := services.NewRnibDataService(log, config, readerMock, nil)
- handler := NewGetNodebIdListRequestHandler(log, rnibDataService)
- return handler, readerMock
+ ranListManager := managers.NewRanListManager(log, rnibDataService)
+
+ handler := NewGetNodebIdListRequestHandler(log, rnibDataService, ranListManager)
+ return handler, readerMock, ranListManager
}
func TestHandleGetNodebIdListSuccess(t *testing.T) {
- handler, readerMock := setupGetNodebIdListRequestHandlerTest(t)
+ handler, readerMock, ranListManager := setupGetNodebIdListRequestHandlerTest(t)
var rnibError error
readerMock.On("GetListNodebIds").Return([]*entities.NbIdentity{}, rnibError)
+
+ err := ranListManager.InitNbIdentityMap()
+ if err != nil {
+ t.Errorf("Error cannot init identity")
+ }
+
response, err := handler.Handle(nil)
assert.Nil(t, err)
assert.NotNil(t, response)
assert.IsType(t, &models.GetNodebIdListResponse{}, response)
}
-
-func TestHandleGetNodebIdListFailure(t *testing.T) {
- handler, readerMock := setupGetNodebIdListRequestHandlerTest(t)
- var nodebIdList []*entities.NbIdentity
- readerMock.On("GetListNodebIds").Return(nodebIdList, common.NewInternalError(errors.New("#reader.GetListNodebIds - Internal Error")))
- response, err := handler.Handle(nil)
- assert.NotNil(t, err)
- assert.Nil(t, response)
-}
diff --git a/E2Manager/httpserver/http_server.go b/E2Manager/httpserver/http_server.go
index 157f5bd..3ee48ef 100644
--- a/E2Manager/httpserver/http_server.go
+++ b/E2Manager/httpserver/http_server.go
@@ -45,7 +45,7 @@
r.HandleFunc("/health", rootController.HandleHealthCheckRequest).Methods(http.MethodGet)
rr := r.PathPrefix("/nodeb").Subrouter()
- rr.HandleFunc("/ids", nodebController.GetNodebIdList).Methods(http.MethodGet)
+ rr.HandleFunc("/states", nodebController.GetNodebIdList).Methods(http.MethodGet)
rr.HandleFunc("/{ranName}", nodebController.GetNodeb).Methods(http.MethodGet)
rr.HandleFunc("/enb", nodebController.AddEnb).Methods(http.MethodPost)
rr.HandleFunc("/enb/{ranName}", nodebController.DeleteEnb).Methods(http.MethodDelete)
diff --git a/E2Manager/httpserver/http_server_test.go b/E2Manager/httpserver/http_server_test.go
index fbaecbe..0a98999 100644
--- a/E2Manager/httpserver/http_server_test.go
+++ b/E2Manager/httpserver/http_server_test.go
@@ -55,7 +55,7 @@
func TestRouteGetNodebIds(t *testing.T) {
router, _, nodebControllerMock, _ := setupRouterAndMocks()
- req, err := http.NewRequest("GET", "/v1/nodeb/ids", nil)
+ req, err := http.NewRequest("GET", "/v1/nodeb/states", nil)
if err != nil {
t.Fatal(err)
}
diff --git a/E2Manager/managers/ran_list_manager.go b/E2Manager/managers/ran_list_manager.go
index 26de59d..d6dbd8e 100644
--- a/E2Manager/managers/ran_list_manager.go
+++ b/E2Manager/managers/ran_list_manager.go
@@ -102,7 +102,7 @@
}
func (m *ranListManagerInstance) GetNbIdentityList() []*entities.NbIdentity {
- nbIds := make([]*entities.NbIdentity, len(m.nbIdentityMap))
+ nbIds := make([]*entities.NbIdentity, 0, len(m.nbIdentityMap))
for _, v := range m.nbIdentityMap {
nbIds = append(nbIds, v)
}
diff --git a/E2Manager/providers/httpmsghandlerprovider/incoming_request_handler_provider.go b/E2Manager/providers/httpmsghandlerprovider/incoming_request_handler_provider.go
index e52aab7..77128c5 100644
--- a/E2Manager/providers/httpmsghandlerprovider/incoming_request_handler_provider.go
+++ b/E2Manager/providers/httpmsghandlerprovider/incoming_request_handler_provider.go
@@ -63,11 +63,11 @@
func initRequestHandlerMap(logger *logger.Logger, rmrSender *rmrsender.RmrSender, config *configuration.Configuration, rNibDataService services.RNibDataService, e2tInstancesManager managers.IE2TInstancesManager, rmClient clients.IRoutingManagerClient, ranConnectStatusChangeManager managers.IRanConnectStatusChangeManager, nodebValidator *managers.NodebValidator, updateEnbManager managers.IUpdateNodebManager, ranListManager managers.RanListManager) map[IncomingRequest]httpmsghandlers.RequestHandler {
return map[IncomingRequest]httpmsghandlers.RequestHandler{
- ShutdownRequest: httpmsghandlers.NewDeleteAllRequestHandler(logger, rmrSender, config, rNibDataService, e2tInstancesManager, rmClient, ranConnectStatusChangeManager),
+ ShutdownRequest: httpmsghandlers.NewDeleteAllRequestHandler(logger, rmrSender, config, rNibDataService, e2tInstancesManager, rmClient, ranConnectStatusChangeManager, ranListManager),
ResetRequest: httpmsghandlers.NewX2ResetRequestHandler(logger, rmrSender, rNibDataService),
SetGeneralConfigurationRequest: httpmsghandlers.NewSetGeneralConfigurationHandler(logger, rNibDataService),
GetNodebRequest: httpmsghandlers.NewGetNodebRequestHandler(logger, rNibDataService),
- GetNodebIdListRequest: httpmsghandlers.NewGetNodebIdListRequestHandler(logger, rNibDataService),
+ GetNodebIdListRequest: httpmsghandlers.NewGetNodebIdListRequestHandler(logger, rNibDataService, ranListManager),
GetE2TInstancesRequest: httpmsghandlers.NewGetE2TInstancesRequestHandler(logger, e2tInstancesManager),
UpdateGnbRequest: httpmsghandlers.NewUpdateGnbRequestHandler(logger, rNibDataService),
UpdateEnbRequest: httpmsghandlers.NewUpdateNodebRequestHandler(logger, rNibDataService, updateEnbManager),