[RIC-433] Add unit tests + increment container-tag
Change-Id: Ida268bcdd2bab131a68499095173e24c5734a1db
Signed-off-by: Amichai <amichai.sichel@intl.att.com>
diff --git a/E2Manager/container-tag.yaml b/E2Manager/container-tag.yaml
index 9309859..91e8f86 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.3.0
+tag: 5.2.10
diff --git a/E2Manager/controllers/nodeb_controller.go b/E2Manager/controllers/nodeb_controller.go
index 3ff453e..71b1160 100644
--- a/E2Manager/controllers/nodeb_controller.go
+++ b/E2Manager/controllers/nodeb_controller.go
@@ -145,7 +145,7 @@
c.logger.Infof("[Client -> E2 Manager] #NodebController.DeleteEnb - request: %v", c.prettifyRequest(r))
vars := mux.Vars(r)
ranName := vars["ranName"]
- request := models.DeleteEnbRequest{RanName: ranName}
+ request := &models.DeleteEnbRequest{RanName: ranName}
c.handleRequest(writer, &r.Header, httpmsghandlerprovider.DeleteEnbRequest, request, true, http.StatusNoContent)
}
diff --git a/E2Manager/controllers/nodeb_controller_test.go b/E2Manager/controllers/nodeb_controller_test.go
index 7ee44d7..d128dad 100644
--- a/E2Manager/controllers/nodeb_controller_test.go
+++ b/E2Manager/controllers/nodeb_controller_test.go
@@ -124,6 +124,12 @@
expectedJsonResponse string
}
+type controllerDeleteEnbTestContext struct {
+ getNodebInfoResult *getNodebInfoResult
+ expectedStatusCode int
+ expectedJsonResponse string
+}
+
func generateServedNrCells(cellIds ...string) []*entities.ServedNRCell {
servedNrCells := []*entities.ServedNRCell{}
@@ -374,6 +380,14 @@
writerMock.AssertExpectations(t)
}
+func assertControllerDeleteEnb(t *testing.T, context *controllerDeleteEnbTestContext, writer *httptest.ResponseRecorder, readerMock *mocks.RnibReaderMock, writerMock *mocks.RnibWriterMock) {
+ assert.Equal(t, context.expectedStatusCode, writer.Result().StatusCode)
+ bodyBytes, _ := ioutil.ReadAll(writer.Body)
+ assert.Equal(t, context.expectedJsonResponse, string(bodyBytes))
+ readerMock.AssertExpectations(t)
+ writerMock.AssertExpectations(t)
+}
+
func buildUpdateGnbRequest(context *controllerUpdateGnbTestContext) *http.Request {
updateGnbUrl := fmt.Sprintf("/nodeb/%s/update", RanName)
requestBody := getJsonRequestAsBuffer(context.requestBody)
@@ -438,6 +452,20 @@
assertControllerAddEnb(t, context, writer, readerMock, writerMock)
}
+func controllerDeleteEnbTestExecuter(t *testing.T, context *controllerDeleteEnbTestContext) {
+ 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)
+ }
+ writer := httptest.NewRecorder()
+ r, _ := http.NewRequest(http.MethodDelete, AddEnbUrl+"/"+RanName, nil)
+ r.Header.Set("Content-Type", "application/json")
+ r = mux.SetURLVars(r, map[string]string{"ranName": RanName})
+ controller.DeleteEnb(writer, r)
+ assertControllerDeleteEnb(t, context, writer, readerMock, writerMock)
+}
+
func TestControllerUpdateGnbEmptyServedNrCells(t *testing.T) {
context := controllerUpdateGnbTestContext{
getNodebInfoResult: nil,
@@ -883,6 +911,57 @@
controllerAddEnbTestExecuter(t, &context)
}
+func TestControllerDeleteEnbGetNodebInternalError(t *testing.T) {
+ context := controllerDeleteEnbTestContext{
+ getNodebInfoResult: &getNodebInfoResult{
+ nodebInfo: nil,
+ rnibError: common.NewInternalError(errors.New("#reader.GetNodeb - Internal Error")),
+ },
+ expectedStatusCode: http.StatusInternalServerError,
+ expectedJsonResponse: RnibErrorJson,
+ }
+
+ controllerDeleteEnbTestExecuter(t, &context)
+}
+
+func TestControllerDeleteEnbNodebNotExistsFailure(t *testing.T) {
+ context := controllerDeleteEnbTestContext{
+ getNodebInfoResult: &getNodebInfoResult{
+ nodebInfo: nil,
+ rnibError: common.NewResourceNotFoundError("#reader.GetNodeb - Not found"),
+ },
+ expectedStatusCode: http.StatusNotFound,
+ expectedJsonResponse: ResourceNotFoundJson,
+ }
+
+ controllerDeleteEnbTestExecuter(t, &context)
+}
+
+func TestControllerDeleteEnbNodebNotEnb(t *testing.T) {
+ context := controllerDeleteEnbTestContext{
+ getNodebInfoResult: &getNodebInfoResult{
+ nodebInfo: &entities.NodebInfo{RanName: "ran1", NodeType: entities.Node_GNB, ConnectionStatus: entities.ConnectionStatus_DISCONNECTED},
+ rnibError: nil,
+ },
+ expectedStatusCode: http.StatusBadRequest,
+ expectedJsonResponse: ValidationFailureJson,
+ }
+
+ controllerDeleteEnbTestExecuter(t, &context)
+}
+
+func TestControllerDeleteEnbSuccess(t *testing.T) {
+ context := controllerDeleteEnbTestContext{
+ getNodebInfoResult: &getNodebInfoResult{
+ nodebInfo: &entities.NodebInfo{RanName: "ran1", NodeType: entities.Node_ENB, ConnectionStatus: entities.ConnectionStatus_DISCONNECTED},
+ rnibError: nil,
+ },
+ expectedStatusCode: http.StatusNoContent,
+ expectedJsonResponse: "",
+ }
+ controllerDeleteEnbTestExecuter(t, &context)
+}
+
func getJsonRequestAsBuffer(requestJson map[string]interface{}) *bytes.Buffer {
b := new(bytes.Buffer)
_ = json.NewEncoder(b).Encode(requestJson)
diff --git a/E2Manager/handlers/httpmsghandlers/delete_enb_request_handler.go b/E2Manager/handlers/httpmsghandlers/delete_enb_request_handler.go
index dbe23d6..29cb39f 100644
--- a/E2Manager/handlers/httpmsghandlers/delete_enb_request_handler.go
+++ b/E2Manager/handlers/httpmsghandlers/delete_enb_request_handler.go
@@ -33,8 +33,8 @@
rNibDataService services.RNibDataService
}
-func NewDeleteEnbRequestHandler(logger *logger.Logger, rNibDataService services.RNibDataService) *AddEnbRequestHandler {
- return &AddEnbRequestHandler{
+func NewDeleteEnbRequestHandler(logger *logger.Logger, rNibDataService services.RNibDataService) *DeleteEnbRequestHandler {
+ return &DeleteEnbRequestHandler{
logger: logger,
rNibDataService: rNibDataService,
}
@@ -44,7 +44,7 @@
deleteEnbRequest := request.(*models.DeleteEnbRequest)
- h.logger.Infof("#DeleteEnbRequestHandler.Handle - Ran name: %s", deleteEnbRequest.RanName)
+ h.logger.Infof("#DeleteEnbRequestHandler.Handle - RAN name: %s", deleteEnbRequest.RanName)
nodebInfo, err := h.rNibDataService.GetNodeb(deleteEnbRequest.RanName)
@@ -72,6 +72,7 @@
return nil, e2managererrors.NewRnibDbError()
}
+ h.logger.Infof("#DeleteEnbRequestHandler.Handle - RAN name: %s - deleted successfully.", deleteEnbRequest.RanName)
return models.NewDeleteEnbResponse(nodebInfo), nil
}
diff --git a/E2Manager/handlers/httpmsghandlers/delete_enb_request_handler_test.go b/E2Manager/handlers/httpmsghandlers/delete_enb_request_handler_test.go
new file mode 100644
index 0000000..2c47919
--- /dev/null
+++ b/E2Manager/handlers/httpmsghandlers/delete_enb_request_handler_test.go
@@ -0,0 +1,115 @@
+//
+// Copyright 2019 AT&T Intellectual Property
+// Copyright 2019 Nokia
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// This source code is part of the near-RT RIC (RAN Intelligent Controller)
+// platform project (RICP).
+
+
+package httpmsghandlers
+
+import (
+ "e2mgr/configuration"
+ "e2mgr/mocks"
+ "e2mgr/models"
+ "e2mgr/services"
+ "errors"
+ "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/stretchr/testify/assert"
+ "testing"
+)
+
+func setupDeleteEnbRequestHandlerTest(t *testing.T) (*DeleteEnbRequestHandler, *mocks.RnibReaderMock, *mocks.RnibWriterMock) {
+ log := initLog(t)
+ config := &configuration.Configuration{RnibRetryIntervalMs: 10, MaxRnibConnectionAttempts: 3}
+ readerMock := &mocks.RnibReaderMock{}
+ writerMock := &mocks.RnibWriterMock{}
+ rnibDataService := services.NewRnibDataService(log, config, readerMock, writerMock)
+ handler := NewDeleteEnbRequestHandler(log, rnibDataService)
+ return handler, readerMock, writerMock
+}
+
+func TestHandleDeleteEnbSuccess(t *testing.T) {
+ handler, readerMock, writerMock := setupDeleteEnbRequestHandlerTest(t)
+
+ ranName := "test1"
+ var rnibError error
+ nodebInfo := &entities.NodebInfo{RanName: ranName, NodeType: entities.Node_ENB}
+ readerMock.On("GetNodeb", ranName).Return(nodebInfo, rnibError)
+ writerMock.On("RemoveEnb", nodebInfo).Return(nil)
+ result, err := handler.Handle(&models.DeleteEnbRequest{RanName: ranName})
+ assert.Nil(t, err)
+ assert.NotNil(t, result)
+ assert.IsType(t, &models.DeleteEnbResponse{}, result)
+ readerMock.AssertExpectations(t)
+ writerMock.AssertExpectations(t)
+}
+
+func TestHandleDeleteEnbInternalGetNodebError(t *testing.T) {
+ handler, readerMock, writerMock := setupDeleteEnbRequestHandlerTest(t)
+
+ ranName := "test1"
+ rnibError := errors.New("for test")
+ var nodebInfo *entities.NodebInfo
+ readerMock.On("GetNodeb", ranName).Return(nodebInfo, rnibError)
+ result, err := handler.Handle(&models.DeleteEnbRequest{RanName: ranName})
+ assert.NotNil(t, err)
+ assert.Nil(t, result)
+ readerMock.AssertExpectations(t)
+ writerMock.AssertExpectations(t)
+}
+
+func TestHandleDeleteEnbInternalRemoveEnbError(t *testing.T) {
+ handler, readerMock, writerMock := setupDeleteEnbRequestHandlerTest(t)
+
+ ranName := "test1"
+ rnibError := errors.New("for test")
+ nodebInfo := &entities.NodebInfo{RanName: ranName, NodeType: entities.Node_ENB}
+ readerMock.On("GetNodeb", ranName).Return(nodebInfo, nil)
+ writerMock.On("RemoveEnb", nodebInfo).Return(rnibError)
+ result, err := handler.Handle(&models.DeleteEnbRequest{RanName: ranName})
+ assert.NotNil(t, err)
+ assert.Nil(t, result)
+ readerMock.AssertExpectations(t)
+ writerMock.AssertExpectations(t)
+}
+
+func TestHandleDeleteEnbResourceNotFoundError(t *testing.T) {
+ handler, readerMock, writerMock := setupDeleteEnbRequestHandlerTest(t)
+
+ ranName := "test1"
+ rnibError := common.NewResourceNotFoundError("for test")
+ var nodebInfo *entities.NodebInfo
+ readerMock.On("GetNodeb", ranName).Return(nodebInfo, rnibError)
+ result, err := handler.Handle(&models.DeleteEnbRequest{RanName: ranName})
+ assert.NotNil(t, err)
+ assert.Nil(t, result)
+ readerMock.AssertExpectations(t)
+ writerMock.AssertExpectations(t)
+}
+
+func TestHandleDeleteEnbNodeTypeNotEnbError(t *testing.T) {
+ handler, readerMock, writerMock := setupDeleteEnbRequestHandlerTest(t)
+
+ ranName := "test1"
+ nodebInfo := &entities.NodebInfo{RanName: ranName, NodeType: entities.Node_GNB}
+ readerMock.On("GetNodeb", ranName).Return(nodebInfo, nil)
+ result, err := handler.Handle(&models.DeleteEnbRequest{RanName: ranName})
+ assert.NotNil(t, err)
+ assert.Nil(t, result)
+ readerMock.AssertExpectations(t)
+ writerMock.AssertExpectations(t)
+}
\ No newline at end of file
diff --git a/E2Manager/rNibWriter/rNibWriter_test.go b/E2Manager/rNibWriter/rNibWriter_test.go
index 069e509..75cf7b0 100644
--- a/E2Manager/rNibWriter/rNibWriter_test.go
+++ b/E2Manager/rNibWriter/rNibWriter_test.go
@@ -105,11 +105,24 @@
return servedCells
}
+func generateServedCellInfos(cellIds ...string) []*entities.ServedCellInfo {
+
+ servedCells := []*entities.ServedCellInfo{}
+
+ for i, v := range cellIds {
+ servedCells = append(servedCells, &entities.ServedCellInfo{
+ CellId: v,
+ Pci: uint32(i + 1),
+ })
+ }
+
+ return servedCells
+}
+
func TestRemoveServedNrCellsSuccess(t *testing.T) {
w, sdlInstanceMock := initSdlInstanceMock(namespace)
servedNrCellsToRemove := generateServedNrCells("whatever1", "whatever2")
sdlInstanceMock.On("Remove", buildServedNRCellKeysToRemove(RanName, servedNrCellsToRemove)).Return(nil)
-
err := w.RemoveServedNrCells(RanName, servedNrCellsToRemove)
assert.Nil(t, err)
}
@@ -118,7 +131,6 @@
w, sdlInstanceMock := initSdlInstanceMock(namespace)
servedNrCellsToRemove := generateServedNrCells("whatever1", "whatever2")
sdlInstanceMock.On("Remove", buildServedNRCellKeysToRemove(RanName, servedNrCellsToRemove)).Return(errors.New("expected error"))
-
err := w.RemoveServedNrCells(RanName, servedNrCellsToRemove)
assert.IsType(t, &common.InternalError{}, err)
}
@@ -957,4 +969,162 @@
setExpected = append(setExpected, nrCellIdKey, cellData, cellNamePciKey, cellData)
}
return setExpected
-}
\ No newline at end of file
+}
+
+func TestRemoveEnbSuccess(t *testing.T) {
+ inventoryName := "name"
+ plmnId := "02f829"
+ nbId := "4a952a0a"
+ channelName := "RAN_MANIPULATION"
+ eventName := inventoryName + "_" + "DELETED"
+ w, sdlInstanceMock := initSdlInstanceMock(namespace)
+ nodebInfo := generateNodebInfo(inventoryName, entities.Node_ENB, plmnId, nbId)
+ nodebInfo.GetEnb().ServedCells = generateServedCellInfos("cell1", "cell2")
+
+ var e error
+
+ nbIdentity := &entities.NbIdentity{InventoryName: nodebInfo.RanName, GlobalNbId: nodebInfo.GetGlobalNbId()}
+ nbIdData, err := proto.Marshal(nbIdentity)
+ if err != nil {
+ t.Errorf("#rNibWriter_test.TestRemoveEnbSuccess - Failed to marshal NbIdentity entity. Error: %v", err)
+ }
+ sdlInstanceMock.On("RemoveMember", entities.Node_ENB.String(), []interface{}{nbIdData}).Return(e)
+
+ expectedKeys := []string{}
+ cell1Key := fmt.Sprintf("CELL:%s", nodebInfo.GetEnb().ServedCells[0].CellId)
+ cell1PciKey := fmt.Sprintf("PCI:%s:%02x", inventoryName, nodebInfo.GetEnb().ServedCells[0].Pci)
+ cell2Key := fmt.Sprintf("CELL:%s", nodebInfo.GetEnb().ServedCells[1].CellId)
+ cell2PciKey := fmt.Sprintf("PCI:%s:%02x", inventoryName, nodebInfo.GetEnb().ServedCells[1].Pci)
+ nodebNameKey := fmt.Sprintf("RAN:%s", inventoryName)
+ nodebIdKey := fmt.Sprintf("ENB:%s:%s", plmnId, nbId)
+ expectedKeys = append(expectedKeys, cell1Key, cell1PciKey, cell2Key, cell2PciKey, nodebNameKey, nodebIdKey)
+ sdlInstanceMock.On("RemoveAndPublish", []string{channelName, eventName}, expectedKeys).Return(e)
+
+ rNibErr := w.RemoveEnb(nodebInfo)
+ assert.Nil(t, rNibErr)
+ sdlInstanceMock.AssertExpectations(t)
+}
+
+func TestRemoveEnbRemoveNbIdentityError(t *testing.T) {
+ inventoryName := "name"
+ plmnId := "02f829"
+ nbId := "4a952a0a"
+ w, sdlInstanceMock := initSdlInstanceMock(namespace)
+ nodebInfo := generateNodebInfo(inventoryName, entities.Node_ENB, plmnId, nbId)
+ nodebInfo.GetEnb().ServedCells = generateServedCellInfos("cell1", "cell2")
+
+ nbIdentity := &entities.NbIdentity{InventoryName: nodebInfo.RanName, GlobalNbId: nodebInfo.GetGlobalNbId()}
+ nbIdData, err := proto.Marshal(nbIdentity)
+ if err != nil {
+ t.Errorf("#rNibWriter_test.TestRemoveEnbSuccess - Failed to marshal NbIdentity entity. Error: %v", err)
+ }
+ sdlInstanceMock.On("RemoveMember", entities.Node_ENB.String(), []interface{}{nbIdData}).Return(errors.New("for test"))
+
+ rNibErr := w.RemoveEnb(nodebInfo)
+ assert.NotNil(t, rNibErr)
+ sdlInstanceMock.AssertExpectations(t)
+}
+
+func TestRemoveEnbRemoveAndPublishError(t *testing.T) {
+ inventoryName := "name"
+ plmnId := "02f829"
+ nbId := "4a952a0a"
+ channelName := "RAN_MANIPULATION"
+ eventName := inventoryName + "_" + "DELETED"
+ w, sdlInstanceMock := initSdlInstanceMock(namespace)
+ nodebInfo := generateNodebInfo(inventoryName, entities.Node_ENB, plmnId, nbId)
+ nodebInfo.GetEnb().ServedCells = generateServedCellInfos("cell1", "cell2")
+
+ var e error
+
+ nbIdentity := &entities.NbIdentity{InventoryName: nodebInfo.RanName, GlobalNbId: nodebInfo.GetGlobalNbId()}
+ nbIdData, err := proto.Marshal(nbIdentity)
+ if err != nil {
+ t.Errorf("#rNibWriter_test.TestRemoveEnbSuccess - Failed to marshal NbIdentity entity. Error: %v", err)
+ }
+ sdlInstanceMock.On("RemoveMember", entities.Node_ENB.String(), []interface{}{nbIdData}).Return(e)
+
+ expectedKeys := []string{}
+ cell1Key := fmt.Sprintf("CELL:%s", nodebInfo.GetEnb().ServedCells[0].CellId)
+ cell1PciKey := fmt.Sprintf("PCI:%s:%02x", inventoryName, nodebInfo.GetEnb().ServedCells[0].Pci)
+ cell2Key := fmt.Sprintf("CELL:%s", nodebInfo.GetEnb().ServedCells[1].CellId)
+ cell2PciKey := fmt.Sprintf("PCI:%s:%02x", inventoryName, nodebInfo.GetEnb().ServedCells[1].Pci)
+ nodebNameKey := fmt.Sprintf("RAN:%s", inventoryName)
+ nodebIdKey := fmt.Sprintf("ENB:%s:%s", plmnId, nbId)
+ expectedKeys = append(expectedKeys, cell1Key, cell1PciKey, cell2Key, cell2PciKey, nodebNameKey, nodebIdKey)
+ sdlInstanceMock.On("RemoveAndPublish", []string{channelName, eventName}, expectedKeys).Return(errors.New("for test"))
+
+ rNibErr := w.RemoveEnb(nodebInfo)
+ assert.NotNil(t, rNibErr)
+ sdlInstanceMock.AssertExpectations(t)
+}
+
+//Integration tests
+//
+//func TestSaveEnbGnbInteg(t *testing.T){
+// for i := 0; i<10; i++{
+// Init("e2Manager", 1)
+// w := GetRNibWriter()
+// nb := entities.NodebInfo{}
+// nb.NodeType = entities.Node_ENB
+// nb.ConnectionStatus = entities.ConnectionStatus_CONNECTED
+// nb.Ip = "localhost"
+// nb.Port = uint32(5656 + i)
+// enb := entities.Enb{}
+// cell1 := &entities.ServedCellInfo{CellId:fmt.Sprintf("%02x",111 + i), Pci:uint32(11 + i)}
+// cell2 := &entities.ServedCellInfo{CellId:fmt.Sprintf("%02x",222 + i), Pci:uint32(22 + i)}
+// cell3 := &entities.ServedCellInfo{CellId:fmt.Sprintf("%02x",333 + i), Pci:uint32(33 + i)}
+// enb.ServedCells = []*entities.ServedCellInfo{cell1, cell2, cell3}
+// nb.Configuration = &entities.NodebInfo_Enb{Enb:&enb}
+// plmnId := 0x02f828
+// nbId := 0x4a952a0a
+// nbIdentity := &entities.NbIdentity{InventoryName: fmt.Sprintf("nameEnb%d" ,i), GlobalNbId:&entities.GlobalNbId{RicId:fmt.Sprintf("%02x", plmnId + i), NbId:fmt.Sprintf("%02x", nbId + i)}}
+// err := w.SaveNodeb(nbIdentity, &nb)
+// if err != nil{
+// t.Errorf("#rNibWriter_test.TestSaveEnbInteg - Failed to save NodeB entity. Error: %v", err)
+// }
+//
+// nb1 := entities.NodebInfo{}
+// nb1.NodeType = entities.Node_GNB
+// nb1.ConnectionStatus = entities.ConnectionStatus_CONNECTED
+// nb1.Ip = "localhost"
+// nb1.Port = uint32(6565 + i)
+// gnb := entities.Gnb{}
+// gCell1 := &entities.ServedNRCell{ServedNrCellInformation:&entities.ServedNRCellInformation{CellId:fmt.Sprintf("%02x",1111 + i), NrPci:uint32(1 + i)}}
+// gCell2 := &entities.ServedNRCell{ServedNrCellInformation:&entities.ServedNRCellInformation{CellId:fmt.Sprintf("%02x",2222 + i), NrPci:uint32(2 + i)}}
+// gCell3 := &entities.ServedNRCell{ServedNrCellInformation:&entities.ServedNRCellInformation{CellId:fmt.Sprintf("%02x",3333 + i), NrPci:uint32(3 + i)}}
+// gnb.ServedNrCells = []*entities.ServedNRCell{gCell1, gCell2, gCell3,}
+// nb1.Configuration = &entities.NodebInfo_Gnb{Gnb:&gnb}
+// nbIdentity = &entities.NbIdentity{InventoryName: fmt.Sprintf("nameGnb%d" ,i), GlobalNbId:&entities.GlobalNbId{RicId:fmt.Sprintf("%02x", plmnId - i), NbId:fmt.Sprintf("%02x", nbId - i)}}
+// err = w.SaveNodeb(nbIdentity, &nb1)
+// if err != nil{
+// t.Errorf("#rNibWriter_test.TestSaveEnbInteg - Failed to save NodeB entity. Error: %v", err)
+// }
+// }
+//}
+//
+//func TestSaveNbRanNamesInteg(t *testing.T){
+// for i := 0; i<10; i++{
+// Init("e2Manager", 1)
+// w := GetRNibWriter()
+// nb := entities.NodebInfo{}
+// nb.ConnectionStatus = entities.ConnectionStatus_CONNECTING
+// nb.Ip = "localhost"
+// nb.Port = uint32(5656 + i)
+// nbIdentity := &entities.NbIdentity{InventoryName: fmt.Sprintf("nameOnly%d" ,i)}
+// err := w.SaveNodeb(nbIdentity, &nb)
+// if err != nil{
+// t.Errorf("#rNibWriter_test.TestSaveEnbInteg - Failed to save NodeB entity. Error: %v", err)
+// }
+// }
+//}
+//
+//func TestSaveRanLoadInformationInteg(t *testing.T){
+// Init("e2Manager", 1)
+// w := GetRNibWriter()
+// ranLoadInformation := generateRanLoadInformation()
+// err := w.SaveRanLoadInformation("ran_integ", ranLoadInformation)
+// if err != nil{
+// t.Errorf("#rNibWriter_test.TestSaveRanLoadInformationInteg - Failed to save RanLoadInformation entity. Error: %v", err)
+// }
+//}
diff --git a/E2Manager/services/rnib_data_service.go b/E2Manager/services/rnib_data_service.go
index e668da6..c1bf97b 100644
--- a/E2Manager/services/rnib_data_service.go
+++ b/E2Manager/services/rnib_data_service.go
@@ -85,6 +85,8 @@
}
func (w *rNibDataService) RemoveEnb(nodebInfo *entities.NodebInfo) error {
+ w.logger.Infof("#RnibDataService.RemoveEnb - nodebInfo: %s", nodebInfo)
+
err := w.retry("RemoveEnb", func() (err error) {
err = w.rnibWriter.RemoveEnb(nodebInfo)
return