2 // Copyright 2019 AT&T Intellectual Property
3 // Copyright 2019 Nokia
5 // Licensed under the Apache License, Version 2.0 (the "License");
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://www.apache.org/licenses/LICENSE-2.0
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
24 "gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/common"
25 "gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/entities"
26 "github.com/golang/protobuf/proto"
27 "github.com/stretchr/testify/assert"
32 func TestInitRNibWriter(t *testing.T) {
34 initSdlInstanceMock(namespace, 1)
35 available, created := writerPool.Stats()
36 assert.Equal(t, available, 0, "number of available objects in the writerPool should be 0")
37 assert.Equal(t, created, 0, "number of created objects in the writerPool should be 0")
42 func TestInitPool(t *testing.T) {
44 sdlInstanceMock := new(mocks.MockSdlInstance)
45 initPool(1, func() interface{} {
46 sdlI := common.ISdlInstance(sdlInstanceMock)
47 return &rNibWriterInstance{sdl: &sdlI, namespace: namespace}
49 func(obj interface{}) {
52 assert.NotNil(t, writerPool)
53 assert.NotNil(t, writerPool.New)
54 assert.NotNil(t, writerPool.Destroy)
55 available, created := writerPool.Stats()
56 assert.Equal(t, 0, available, "number of available objects in the writerPool should be 0")
57 assert.Equal(t, 0, created, "number of created objects in the writerPool should be 0")
60 var namespace = "namespace"
62 func initSdlInstanceMock(namespace string, poolSize int) *mocks.MockSdlInstance {
63 sdlInstanceMock := new(mocks.MockSdlInstance)
64 initPool(poolSize, func() interface{} {
65 sdlI := common.ISdlInstance(sdlInstanceMock)
66 return &rNibWriterInstance{sdl: &sdlI, namespace: namespace}
68 func(obj interface{}) {
71 return sdlInstanceMock
74 func TestSaveEnb(t *testing.T) {
76 ranName := "RAN:" + name
78 sdlInstanceMock := initSdlInstanceMock(namespace, 1)
80 nb := entities.NodebInfo{}
81 nb.NodeType = entities.Node_ENB
82 nb.ConnectionStatus = 1
86 cell := &entities.ServedCellInfo{CellId:"aaff", Pci:3}
87 cellEntity := entities.Cell{Type:entities.Cell_LTE_CELL, Cell:&entities.Cell_ServedCellInfo{ServedCellInfo:cell}}
88 enb.ServedCells = []*entities.ServedCellInfo{cell}
89 nb.Configuration = &entities.NodebInfo_Enb{Enb:&enb}
90 data, err := proto.Marshal(&nb)
92 t.Errorf("#rNibWriter_test.TestSaveEnb - Failed to marshal NodeB entity. Error: %v", err)
96 cellData, err := proto.Marshal(&cellEntity)
98 t.Errorf("#rNibWriter_test.TestSaveEnb - Failed to marshal Cell entity. Error: %v", err)
100 var setExpected []interface{}
101 setExpected = append(setExpected, ranName, data)
102 setExpected = append(setExpected, "ENB:02f829:4a952a0a", data)
103 setExpected = append(setExpected, fmt.Sprintf("CELL:%s", cell.GetCellId()), cellData)
104 setExpected = append(setExpected, fmt.Sprintf("PCI:%s:%02x", name, cell.GetPci()), cellData)
106 sdlInstanceMock.On("Set", []interface{}{setExpected}).Return(e)
108 nbIdData, err := proto.Marshal(&entities.NbIdentity{InventoryName: name})
110 t.Errorf("#rNibWriter_test.TestSaveEnb - Failed to marshal nbIdentity entity. Error: %v", err)
112 sdlInstanceMock.On("RemoveMember", entities.Node_UNKNOWN.String(), []interface{}{nbIdData}).Return(e)
114 nbIdentity := &entities.NbIdentity{InventoryName:name, GlobalNbId:&entities.GlobalNbId{PlmnId:"02f829", NbId:"4a952a0a"}}
115 nbIdData, err = proto.Marshal(nbIdentity)
117 t.Errorf("#rNibWriter_test.TestSaveEnb - Failed to marshal NodeB Identity entity. Error: %v", err)
119 sdlInstanceMock.On("AddMember", "ENB", []interface{}{nbIdData}).Return(e)
121 rNibErr := w.SaveNodeb(nbIdentity, &nb)
122 assert.Nil(t, rNibErr)
125 func TestSaveEnbCellIdValidationFailure(t *testing.T) {
128 initSdlInstanceMock(namespace, 1)
130 nb := entities.NodebInfo{}
131 nb.NodeType = entities.Node_ENB
132 nb.ConnectionStatus = 1
135 enb := entities.Enb{}
136 cell := &entities.ServedCellInfo{Pci:3}
137 enb.ServedCells = []*entities.ServedCellInfo{cell}
138 nb.Configuration = &entities.NodebInfo_Enb{Enb:&enb}
140 nbIdentity := &entities.NbIdentity{InventoryName:name, GlobalNbId:&entities.GlobalNbId{PlmnId:"02f829", NbId:"4a952a0a"}}
141 rNibErr := w.SaveNodeb(nbIdentity, &nb)
142 assert.NotNil(t, rNibErr)
143 assert.Equal(t, common.VALIDATION_ERROR, rNibErr.GetCode())
144 assert.Equal(t, "3 VALIDATION_ERROR - #utils.ValidateAndBuildCellIdKey - an empty cell id received", rNibErr.Error())
147 func TestSaveEnbInventoryNameValidationFailure(t *testing.T) {
149 initSdlInstanceMock(namespace, 1)
151 nb := entities.NodebInfo{}
152 nb.NodeType = entities.Node_ENB
153 nb.ConnectionStatus = 1
156 enb := entities.Enb{}
157 cell := &entities.ServedCellInfo{CellId:"aaa",Pci:3}
158 enb.ServedCells = []*entities.ServedCellInfo{cell}
159 nb.Configuration = &entities.NodebInfo_Enb{Enb:&enb}
161 nbIdentity := &entities.NbIdentity{InventoryName:"", GlobalNbId:&entities.GlobalNbId{PlmnId:"02f829", NbId:"4a952a0a"}}
162 rNibErr := w.SaveNodeb(nbIdentity, &nb)
163 assert.NotNil(t, rNibErr)
164 assert.Equal(t, common.VALIDATION_ERROR, rNibErr.GetCode())
165 assert.Equal(t, "3 VALIDATION_ERROR - #utils.ValidateAndBuildNodeBNameKey - an empty inventory name received", rNibErr.Error())
168 func TestSaveEnbOnClosedPool(t *testing.T) {
171 sdlInstanceMock := initSdlInstanceMock(namespace, 1)
173 nb := entities.NodebInfo{}
174 nb.NodeType = entities.Node_ENB
175 nb.ConnectionStatus = 1
178 enb := entities.Enb{}
179 nb.Configuration = &entities.NodebInfo_Enb{Enb:&enb}
180 data, err := proto.Marshal(&nb)
182 t.Errorf("#rNibWriter_test.TestSaveEnbOnClosedPool - Failed to marshal NodeB entity. Error: %v", err)
184 setExpected := []interface{}{name, data}
186 sdlInstanceMock.On("Set", setExpected).Return(e)
188 nbIdentity := &entities.NbIdentity{}
189 assert.Panics(t, func(){w.SaveNodeb(nbIdentity, &nb)})
192 func TestSaveGnbCellIdValidationFailure(t *testing.T) {
195 initSdlInstanceMock(namespace, 1)
197 nb := entities.NodebInfo{}
198 nb.NodeType = entities.Node_GNB
199 nb.ConnectionStatus = 1
202 gnb := entities.Gnb{}
203 cellInfo:= &entities.ServedNRCellInformation{NrPci:2}
204 cell := &entities.ServedNRCell{ServedNrCellInformation:cellInfo}
205 gnb.ServedNrCells = []*entities.ServedNRCell{cell}
206 nb.Configuration = &entities.NodebInfo_Gnb{Gnb:&gnb}
208 nbIdentity := &entities.NbIdentity{InventoryName:name, GlobalNbId:&entities.GlobalNbId{PlmnId:"02f829", NbId:"4a952a0a"}}
209 rNibErr := w.SaveNodeb(nbIdentity, &nb)
210 assert.NotNil(t, rNibErr)
211 assert.Equal(t, common.VALIDATION_ERROR, rNibErr.GetCode())
212 assert.Equal(t, "3 VALIDATION_ERROR - #utils.ValidateAndBuildNrCellIdKey - an empty cell id received", rNibErr.Error())
215 func TestSaveGnb(t *testing.T) {
217 ranName := "RAN:" + name
219 sdlInstanceMock := initSdlInstanceMock(namespace, 1)
221 nb := entities.NodebInfo{}
222 nb.NodeType = entities.Node_GNB
223 nb.ConnectionStatus = 1
226 gnb := entities.Gnb{}
227 cellInfo:= &entities.ServedNRCellInformation{NrPci:2,CellId:"ccdd"}
228 cell := &entities.ServedNRCell{ServedNrCellInformation:cellInfo}
229 cellEntity := entities.Cell{Type:entities.Cell_NR_CELL, Cell:&entities.Cell_ServedNrCell{ServedNrCell:cell}}
230 gnb.ServedNrCells = []*entities.ServedNRCell{cell}
231 nb.Configuration = &entities.NodebInfo_Gnb{Gnb:&gnb}
232 data, err := proto.Marshal(&nb)
234 t.Errorf("#rNibWriter_test.TestSaveGnb - Failed to marshal NodeB entity. Error: %v", err)
239 cellData, err := proto.Marshal(&cellEntity)
241 t.Errorf("#rNibWriter_test.TestSaveGnb - Failed to marshal Cell entity. Error: %v", err)
243 var setExpected []interface{}
244 setExpected = append(setExpected, ranName, data)
245 setExpected = append(setExpected, "GNB:02f829:4a952a0a", data)
246 setExpected = append(setExpected, fmt.Sprintf("NRCELL:%s", cell.GetServedNrCellInformation().GetCellId()), cellData)
247 setExpected = append(setExpected, fmt.Sprintf("PCI:%s:%02x", name, cell.GetServedNrCellInformation().GetNrPci()), cellData)
249 sdlInstanceMock.On("Set", []interface{}{setExpected}).Return(e)
250 nbIdentity := &entities.NbIdentity{InventoryName:name, GlobalNbId:&entities.GlobalNbId{PlmnId:"02f829", NbId:"4a952a0a"}}
251 nbIdData, err := proto.Marshal(nbIdentity)
253 t.Errorf("#rNibWriter_test.TestSaveGnb - Failed to marshal NodeB Identity entity. Error: %v", err)
255 sdlInstanceMock.On("AddMember", "GNB", []interface{}{nbIdData}).Return(e)
257 nbIdData, err = proto.Marshal(&entities.NbIdentity{InventoryName: name})
259 t.Errorf("#rNibWriter_test.TestSaveEnb - Failed to marshal nbIdentity entity. Error: %v", err)
261 sdlInstanceMock.On("RemoveMember", entities.Node_UNKNOWN.String(), []interface{}{nbIdData}).Return(e)
263 rNibErr := w.SaveNodeb(nbIdentity, &nb)
264 assert.Nil(t, rNibErr)
267 func TestSaveRanLoadInformationSuccess(t *testing.T) {
268 inventoryName := "name"
269 loadKey, validationErr := common.ValidateAndBuildRanLoadInformationKey(inventoryName)
271 if validationErr != nil {
272 t.Errorf("#rNibWriter_test.TestSaveRanLoadInformationSuccess - Failed to build ran load infromation key. Error: %v", validationErr)
276 sdlInstanceMock := initSdlInstanceMock(namespace, 1)
280 ranLoadInformation := generateRanLoadInformation()
281 data, err := proto.Marshal(ranLoadInformation)
284 t.Errorf("#rNibWriter_test.TestSaveRanLoadInformation - Failed to marshal RanLoadInformation entity. Error: %v", err)
288 var setExpected []interface{}
289 setExpected = append(setExpected, loadKey, data)
290 sdlInstanceMock.On("Set", []interface{}{setExpected}).Return(e)
293 rNibErr := w.SaveRanLoadInformation(inventoryName, ranLoadInformation)
294 assert.Nil(t, rNibErr)
297 func TestSaveRanLoadInformationMarshalNilFailure(t *testing.T) {
298 inventoryName := "name2"
300 initSdlInstanceMock(namespace, 1)
303 expectedErr := common.NewInternalError(errors.New("proto: Marshal called with nil"))
304 err:= w.SaveRanLoadInformation(inventoryName, nil)
305 assert.Equal(t, expectedErr, err)
308 func TestSaveRanLoadInformationEmptyInventoryNameFailure(t *testing.T) {
311 initSdlInstanceMock(namespace, 1)
314 err:= w.SaveRanLoadInformation(inventoryName, nil)
315 assert.NotNil(t, err)
316 assert.Equal(t, common.VALIDATION_ERROR, err.GetCode())
319 func TestSaveRanLoadInformationSdlFailure(t *testing.T) {
320 inventoryName := "name2"
322 loadKey, validationErr := common.ValidateAndBuildRanLoadInformationKey(inventoryName)
324 if validationErr != nil {
325 t.Errorf("#rNibWriter_test.TestSaveRanLoadInformationSuccess - Failed to build ran load infromation key. Error: %v", validationErr)
330 sdlInstanceMock := initSdlInstanceMock(namespace, 1)
333 ranLoadInformation := generateRanLoadInformation()
334 data, err := proto.Marshal(ranLoadInformation)
337 t.Errorf("#rNibWriter_test.TestSaveRanLoadInformation - Failed to marshal RanLoadInformation entity. Error: %v", err)
341 expectedErr := errors.New("expected error")
342 var setExpected []interface{}
343 setExpected = append(setExpected, loadKey, data)
344 sdlInstanceMock.On("Set", []interface{}{setExpected}).Return(expectedErr)
347 rNibErr := w.SaveRanLoadInformation(inventoryName, ranLoadInformation)
348 assert.NotNil(t, rNibErr)
349 assert.Equal(t, common.INTERNAL_ERROR, rNibErr.GetCode())
350 assert.Equal(t, expectedErr, rNibErr.GetError())
353 func generateCellLoadInformation() *entities.CellLoadInformation {
354 cellLoadInformation := entities.CellLoadInformation{}
356 cellLoadInformation.CellId = "123"
358 ulInterferenceOverloadIndication := entities.UlInterferenceOverloadIndication_HIGH_INTERFERENCE
359 cellLoadInformation.UlInterferenceOverloadIndications = []entities.UlInterferenceOverloadIndication{ulInterferenceOverloadIndication}
361 ulHighInterferenceInformation := entities.UlHighInterferenceInformation{
363 UlHighInterferenceIndication:"xxx",
366 cellLoadInformation.UlHighInterferenceInfos = []*entities.UlHighInterferenceInformation{&ulHighInterferenceInformation }
368 cellLoadInformation.RelativeNarrowbandTxPower = &entities.RelativeNarrowbandTxPower{
370 RntpThreshold:entities.RntpThreshold_NEG_4,
371 NumberOfCellSpecificAntennaPorts: entities.NumberOfCellSpecificAntennaPorts_V1_ANT_PRT,
373 PdcchInterferenceImpact:2,
374 EnhancedRntp: &entities.EnhancedRntp{
375 EnhancedRntpBitmap:"xxx",
376 RntpHighPowerThreshold:entities.RntpThreshold_NEG_2,
377 EnhancedRntpStartTime: &entities.StartTime{StartSfn:500,StartSubframeNumber:5},
381 cellLoadInformation.AbsInformation = &entities.AbsInformation{
382 Mode: entities.AbsInformationMode_ABS_INFO_FDD,
383 AbsPatternInfo:"xxx",
384 NumberOfCellSpecificAntennaPorts:entities.NumberOfCellSpecificAntennaPorts_V2_ANT_PRT,
385 MeasurementSubset:"xxx",
388 cellLoadInformation.InvokeIndication = entities.InvokeIndication_ABS_INFORMATION
390 cellLoadInformation.ExtendedUlInterferenceOverloadInfo = &entities.ExtendedUlInterferenceOverloadInfo{
391 AssociatedSubframes:"xxx",
392 ExtendedUlInterferenceOverloadIndications:cellLoadInformation.UlInterferenceOverloadIndications,
395 compInformationItem := &entities.CompInformationItem{
396 CompHypothesisSets: []*entities.CompHypothesisSet{&entities.CompHypothesisSet{CellId: "789", CompHypothesis:"xxx"}},
400 cellLoadInformation.CompInformation = &entities.CompInformation{
401 CompInformationItems:[]*entities.CompInformationItem{compInformationItem},
402 CompInformationStartTime:&entities.StartTime{StartSfn:123,StartSubframeNumber:456},
405 cellLoadInformation.DynamicDlTransmissionInformation = &entities.DynamicDlTransmissionInformation{
406 State: entities.NaicsState_NAICS_ACTIVE,
407 TransmissionModes:"xxx",
409 PAList:[]entities.PA{entities.PA_DB_NEG_3},
412 return &cellLoadInformation
415 func generateRanLoadInformation() *entities.RanLoadInformation {
416 ranLoadInformation := entities.RanLoadInformation{}
418 ranLoadInformation.LoadTimestamp = uint64(time.Now().UnixNano())
421 cellLoadInformation := generateCellLoadInformation()
422 ranLoadInformation.CellLoadInfos = []*entities.CellLoadInformation{cellLoadInformation}
424 return &ranLoadInformation
427 func TestSaveNilEntityFailure(t *testing.T) {
429 initSdlInstanceMock(namespace, 1)
431 expectedErr := common.NewInternalError(errors.New("proto: Marshal called with nil"))
432 nbIdentity := &entities.NbIdentity{}
433 actualErr := w.SaveNodeb(nbIdentity, nil)
434 assert.Equal(t, expectedErr, actualErr)
437 func TestSaveUnknownTypeEntityFailure(t *testing.T) {
439 initSdlInstanceMock(namespace, 1)
441 expectedErr := common.NewValidationError(errors.New("#rNibWriter.saveNodeB - Unknown responding node type, entity: ip:\"localhost\" port:5656 "))
442 nbIdentity := &entities.NbIdentity{InventoryName:"name", GlobalNbId:&entities.GlobalNbId{PlmnId:"02f829", NbId:"4a952a0a"}}
443 nb := &entities.NodebInfo{}
446 actualErr := w.SaveNodeb(nbIdentity, nb)
447 assert.Equal(t, expectedErr, actualErr)
450 func TestSaveEntityFailure(t *testing.T) {
456 sdlInstanceMock := initSdlInstanceMock(namespace, 1)
458 gnb := entities.NodebInfo{}
459 gnb.NodeType = entities.Node_GNB
460 data, err := proto.Marshal(&gnb)
462 t.Errorf("#rNibWriter_test.TestSaveEntityFailure - Failed to marshal NodeB entity. Error: %v", err)
464 nbIdentity := &entities.NbIdentity{InventoryName:name, GlobalNbId:&entities.GlobalNbId{PlmnId:plmnId, NbId:nbId}}
465 setExpected := []interface{}{"RAN:" + name, data}
466 setExpected = append(setExpected,"GNB:" + plmnId + ":" + nbId, data)
467 expectedErr := errors.New("expected error")
468 sdlInstanceMock.On("Set", []interface{}{setExpected}).Return(expectedErr)
469 rNibErr := w.SaveNodeb(nbIdentity, &gnb)
470 assert.NotEmpty(t, rNibErr)
473 func TestGetRNibWriterPoolNotInitializedFailure(t *testing.T) {
475 assert.Panics(t, func(){GetRNibWriter()})
478 func TestGetRNibWriter(t *testing.T) {
480 initSdlInstanceMock(namespace, 1)
481 received := GetRNibWriter()
482 assert.NotEmpty(t, received)
483 available, created := writerPool.Stats()
484 assert.Equal(t, 0, available, "number of available objects in the writerPool should be 0")
485 assert.Equal(t, 1, created, "number of created objects in the writerPool should be 1")
489 func TestClose(t *testing.T) {
491 instanceMock := initSdlInstanceMock(namespace, 2)
492 w1 := GetRNibWriter()
493 w2 := GetRNibWriter()
496 available, created := writerPool.Stats()
497 assert.Equal(t, 2, available, "number of available objects in the writerPool should be 2")
498 assert.Equal(t, 2, created, "number of created objects in the writerPool should be 2")
500 instanceMock.On("Close").Return(e)
502 available, created = writerPool.Stats()
503 assert.Equal(t, 0, available, "number of available objects in the writerPool should be 0")
504 assert.Equal(t, 0, created, "number of created objects in the writerPool should be 0")
507 func TestCloseOnClosedPoolFailure(t *testing.T) {
509 instanceMock := initSdlInstanceMock(namespace, 1)
510 w1 := GetRNibWriter()
512 available, created := writerPool.Stats()
513 assert.Equal(t, 1, available, "number of available objects in the writerPool should be 1")
514 assert.Equal(t, 1, created, "number of created objects in the writerPool should be 1")
516 instanceMock.On("Close").Return(e)
518 assert.Panics(t, func(){Close()})
521 func TestCloseFailure(t *testing.T) {
523 instanceMock := initSdlInstanceMock(namespace, 2)
524 w1 := GetRNibWriter()
526 available, created := writerPool.Stats()
527 assert.Equal(t, 1, available, "number of available objects in the writerPool should be 1")
528 assert.Equal(t, 1, created, "number of created objects in the writerPool should be 1")
529 e := errors.New("expected error")
530 instanceMock.On("Close").Return(e)
532 available, created = writerPool.Stats()
533 assert.Equal(t, 0, available, "number of available objects in the writerPool should be 0")
534 assert.Equal(t, 0, created, "number of created objects in the writerPool should be 0")
537 func TestInit(t *testing.T) {
540 assert.NotNil(t, writerPool)
541 assert.NotNil(t, writerPool.New)
542 assert.NotNil(t, writerPool.Destroy)
543 available, created := writerPool.Stats()
544 assert.Equal(t, 0, available, "number of available objects in the writerPool should be 0")
545 assert.Equal(t, 0, created, "number of created objects in the writerPool should be 0")
550 //func TestSaveEnbGnbInteg(t *testing.T){
551 // for i := 0; i<10; i++{
552 // Init("e2Manager", 1)
553 // w := GetRNibWriter()
554 // nb := entities.NodebInfo{}
555 // nb.NodeType = entities.Node_ENB
556 // nb.ConnectionStatus = entities.ConnectionStatus_CONNECTED
557 // nb.Ip = "localhost"
558 // nb.Port = uint32(5656 + i)
559 // enb := entities.Enb{}
560 // cell1 := &entities.ServedCellInfo{CellId:fmt.Sprintf("%02x",111 + i), Pci:uint32(11 + i)}
561 // cell2 := &entities.ServedCellInfo{CellId:fmt.Sprintf("%02x",222 + i), Pci:uint32(22 + i)}
562 // cell3 := &entities.ServedCellInfo{CellId:fmt.Sprintf("%02x",333 + i), Pci:uint32(33 + i)}
563 // enb.ServedCells = []*entities.ServedCellInfo{cell1, cell2, cell3}
564 // nb.Configuration = &entities.NodebInfo_Enb{Enb:&enb}
565 // plmnId := 0x02f828
566 // nbId := 0x4a952a0a
567 // nbIdentity := &entities.NbIdentity{InventoryName: fmt.Sprintf("nameEnb%d" ,i), GlobalNbId:&entities.GlobalNbId{PlmnId:fmt.Sprintf("%02x", plmnId + i), NbId:fmt.Sprintf("%02x", nbId + i)}}
568 // err := w.SaveNodeb(nbIdentity, &nb)
570 // t.Errorf("#rNibWriter_test.TestSaveEnbInteg - Failed to save NodeB entity. Error: %v", err)
573 // nb1 := entities.NodebInfo{}
574 // nb1.NodeType = entities.Node_GNB
575 // nb1.ConnectionStatus = entities.ConnectionStatus_CONNECTED
576 // nb1.Ip = "localhost"
577 // nb1.Port = uint32(6565 + i)
578 // gnb := entities.Gnb{}
579 // gCell1 := &entities.ServedNRCell{ServedNrCellInformation:&entities.ServedNRCellInformation{CellId:fmt.Sprintf("%02x",1111 + i), NrPci:uint32(1 + i)}}
580 // gCell2 := &entities.ServedNRCell{ServedNrCellInformation:&entities.ServedNRCellInformation{CellId:fmt.Sprintf("%02x",2222 + i), NrPci:uint32(2 + i)}}
581 // gCell3 := &entities.ServedNRCell{ServedNrCellInformation:&entities.ServedNRCellInformation{CellId:fmt.Sprintf("%02x",3333 + i), NrPci:uint32(3 + i)}}
582 // gnb.ServedNrCells = []*entities.ServedNRCell{gCell1, gCell2, gCell3,}
583 // nb1.Configuration = &entities.NodebInfo_Gnb{Gnb:&gnb}
584 // nbIdentity = &entities.NbIdentity{InventoryName: fmt.Sprintf("nameGnb%d" ,i), GlobalNbId:&entities.GlobalNbId{PlmnId:fmt.Sprintf("%02x", plmnId - i), NbId:fmt.Sprintf("%02x", nbId - i)}}
585 // err = w.SaveNodeb(nbIdentity, &nb1)
587 // t.Errorf("#rNibWriter_test.TestSaveEnbInteg - Failed to save NodeB entity. Error: %v", err)
592 //func TestSaveNbRanNamesInteg(t *testing.T){
593 // for i := 0; i<10; i++{
594 // Init("e2Manager", 1)
595 // w := GetRNibWriter()
596 // nb := entities.NodebInfo{}
597 // nb.ConnectionStatus = entities.ConnectionStatus_CONNECTING
598 // nb.Ip = "localhost"
599 // nb.Port = uint32(5656 + i)
600 // nbIdentity := &entities.NbIdentity{InventoryName: fmt.Sprintf("nameOnly%d" ,i)}
601 // err := w.SaveNodeb(nbIdentity, &nb)
603 // t.Errorf("#rNibWriter_test.TestSaveEnbInteg - Failed to save NodeB entity. Error: %v", err)
608 //func TestSaveRanLoadInformationInteg(t *testing.T){
609 // Init("e2Manager", 1)
610 // w := GetRNibWriter()
611 // ranLoadInformation := generateRanLoadInformation()
612 // err := w.SaveRanLoadInformation("ran_integ", ranLoadInformation)
614 // t.Errorf("#rNibWriter_test.TestSaveRanLoadInformationInteg - Failed to save RanLoadInformation entity. Error: %v", err)