Change-Id: I863f8560c3d2a5fb8654741a1ab865df93194399
Signed-off-by: ns019t <ns019t@intl.att.com>
extendedUlInterferenceOverLoadIndicationList := (*[1 << 30]*C.long)(unsafe.Pointer(dynamicNAICSInformation.pA_list.list.array))[:int(paListCount):int(paListCount)]
if (extendedUlInterferenceOverLoadIndicationList == nil) {
extendedUlInterferenceOverLoadIndicationList := (*[1 << 30]*C.long)(unsafe.Pointer(dynamicNAICSInformation.pA_list.list.array))[:int(paListCount):int(paListCount)]
if (extendedUlInterferenceOverLoadIndicationList == nil) {
- return nil, fmt.Errorf("#extractPaListFromDynamicNaicsInformation - cellId: %s - Extended Ul Interference OverLoad Indication List is nil")
+ return nil, fmt.Errorf("#extractPaListFromDynamicNaicsInformation - cellId: %s - Extended Ul Interference OverLoad Indication List is nil", cellId)
}
return extendedUlInterferenceOverLoadIndicationList, nil
}
return extendedUlInterferenceOverLoadIndicationList, nil
pduCompHypothesisSetItemsListCount := pduCompInformationItemMember.coMPHypothesisSet.list.count
if pduCompHypothesisSetItemsListCount == 0 || pduCompHypothesisSetItemsListCount > NaxNoOfCompCells {
pduCompHypothesisSetItemsListCount := pduCompInformationItemMember.coMPHypothesisSet.list.count
if pduCompHypothesisSetItemsListCount == 0 || pduCompHypothesisSetItemsListCount > NaxNoOfCompCells {
- return nil, fmt.Errorf("#buildCompHypothesisSets - cellId: %s - Invalid Comp Hypothesis Set Items list count")
+ return nil, fmt.Errorf("#buildCompHypothesisSets - cellId: %s - Invalid Comp Hypothesis Set Items list count", cellId)
}
pduCompHypothesisSetItems := (*[1 << 30]*C.CoMPHypothesisSetItem_t)(unsafe.Pointer(pduCompInformationItemMember.coMPHypothesisSet.list.array))[:int(pduCompHypothesisSetItemsListCount):int(pduCompHypothesisSetItemsListCount)]
}
pduCompHypothesisSetItems := (*[1 << 30]*C.CoMPHypothesisSetItem_t)(unsafe.Pointer(pduCompInformationItemMember.coMPHypothesisSet.list.array))[:int(pduCompHypothesisSetItemsListCount):int(pduCompHypothesisSetItemsListCount)]
}
return args.Get(0).([]*entities.NbIdentity), nil
}
return args.Get(0).([]*entities.NbIdentity), nil
+}
+
+func (m *RnibReaderMock) GetRanLoadInformation(inventoryName string) (*entities.RanLoadInformation, common.IRNibError){
+ args := m.Called()
+
+ errArg := args.Get(1)
+
+ if errArg != nil {
+ return args.Get(0).(*entities.RanLoadInformation), errArg.(common.IRNibError)
+ }
+
+ return args.Get(0).(*entities.RanLoadInformation), nil
}
\ No newline at end of file
}
\ No newline at end of file
if err != nil {
return common.NewInternalError(err)
}
if err != nil {
return common.NewInternalError(err)
}
- if isNotEmptyIdentity {
- nbIdData, err := proto.Marshal(nbIdentity)
+
+ ranNameIdentity := &entities.NbIdentity{InventoryName: nbIdentity.InventoryName}
+
+ if isNotEmptyIdentity{
+ nbIdData, err := proto.Marshal(ranNameIdentity)
if err != nil {
return common.NewInternalError(err)
}
if err != nil {
return common.NewInternalError(err)
}
- err = (*w.sdl).AddMember(entity.GetNodeType().String(), nbIdData)
+ err = (*w.sdl).RemoveMember(entities.Node_UNKNOWN.String(), nbIdData)
if err != nil {
return common.NewInternalError(err)
}
if err != nil {
return common.NewInternalError(err)
}
+ } else {
+ nbIdentity = ranNameIdentity
+ }
+
+ nbIdData, err := proto.Marshal(nbIdentity)
+ if err != nil {
+ return common.NewInternalError(err)
+ }
+ err = (*w.sdl).AddMember(entity.GetNodeType().String(), nbIdData)
+ if err != nil {
+ return common.NewInternalError(err)
func isNotEmpty(nbIdentity *entities.NbIdentity) bool {
return nbIdentity.GlobalNbId != nil && nbIdentity.GlobalNbId.PlmnId != "" && nbIdentity.GlobalNbId.NbId != ""
func isNotEmpty(nbIdentity *entities.NbIdentity) bool {
return nbIdentity.GlobalNbId != nil && nbIdentity.GlobalNbId.PlmnId != "" && nbIdentity.GlobalNbId.NbId != ""
-}
\ No newline at end of file
nb.Ip = "localhost"
nb.Port = 5656
enb := entities.Enb{}
nb.Ip = "localhost"
nb.Port = 5656
enb := entities.Enb{}
- cell := &entities.ServedCellInfo{CellId: "aaff", Pci: 3}
- cellEntity := entities.Cell{Type: entities.Cell_LTE_CELL, Cell: &entities.Cell_ServedCellInfo{ServedCellInfo: cell}}
+ cell := &entities.ServedCellInfo{CellId:"aaff", Pci:3}
+ cellEntity := entities.Cell{Type:entities.Cell_LTE_CELL, Cell:&entities.Cell_ServedCellInfo{ServedCellInfo:cell}}
enb.ServedCells = []*entities.ServedCellInfo{cell}
enb.ServedCells = []*entities.ServedCellInfo{cell}
- nb.Configuration = &entities.NodebInfo_Enb{Enb: &enb}
+ nb.Configuration = &entities.NodebInfo_Enb{Enb:&enb}
data, err := proto.Marshal(&nb)
if err != nil {
t.Errorf("#rNibWriter_test.TestSaveEnb - Failed to marshal NodeB entity. Error: %v", err)
data, err := proto.Marshal(&nb)
if err != nil {
t.Errorf("#rNibWriter_test.TestSaveEnb - Failed to marshal NodeB entity. Error: %v", err)
setExpected = append(setExpected, fmt.Sprintf("PCI:%s:%02x", name, cell.GetPci()), cellData)
sdlInstanceMock.On("Set", []interface{}{setExpected}).Return(e)
setExpected = append(setExpected, fmt.Sprintf("PCI:%s:%02x", name, cell.GetPci()), cellData)
sdlInstanceMock.On("Set", []interface{}{setExpected}).Return(e)
- nbIdentity := &entities.NbIdentity{InventoryName: name, GlobalNbId: &entities.GlobalNbId{PlmnId: "02f829", NbId: "4a952a0a"}}
- nbIdData, err := proto.Marshal(nbIdentity)
+
+ nbIdData, err := proto.Marshal(&entities.NbIdentity{InventoryName: name})
+ if err != nil {
+ t.Errorf("#rNibWriter_test.TestSaveEnb - Failed to marshal nbIdentity entity. Error: %v", err)
+ }
+ sdlInstanceMock.On("RemoveMember", entities.Node_UNKNOWN.String(), []interface{}{nbIdData}).Return(e)
+
+ nbIdentity := &entities.NbIdentity{InventoryName:name, GlobalNbId:&entities.GlobalNbId{PlmnId:"02f829", NbId:"4a952a0a"}}
+ nbIdData, err = proto.Marshal(nbIdentity)
if err != nil {
t.Errorf("#rNibWriter_test.TestSaveEnb - Failed to marshal NodeB Identity entity. Error: %v", err)
}
sdlInstanceMock.On("AddMember", "ENB", []interface{}{nbIdData}).Return(e)
if err != nil {
t.Errorf("#rNibWriter_test.TestSaveEnb - Failed to marshal NodeB Identity entity. Error: %v", err)
}
sdlInstanceMock.On("AddMember", "ENB", []interface{}{nbIdData}).Return(e)
rNibErr := w.SaveNodeb(nbIdentity, &nb)
assert.Nil(t, rNibErr)
}
rNibErr := w.SaveNodeb(nbIdentity, &nb)
assert.Nil(t, rNibErr)
}
nb.Ip = "localhost"
nb.Port = 5656
enb := entities.Enb{}
nb.Ip = "localhost"
nb.Port = 5656
enb := entities.Enb{}
- cell := &entities.ServedCellInfo{Pci: 3}
+ cell := &entities.ServedCellInfo{Pci:3}
enb.ServedCells = []*entities.ServedCellInfo{cell}
enb.ServedCells = []*entities.ServedCellInfo{cell}
- nb.Configuration = &entities.NodebInfo_Enb{Enb: &enb}
+ nb.Configuration = &entities.NodebInfo_Enb{Enb:&enb}
- nbIdentity := &entities.NbIdentity{InventoryName: name, GlobalNbId: &entities.GlobalNbId{PlmnId: "02f829", NbId: "4a952a0a"}}
+ nbIdentity := &entities.NbIdentity{InventoryName:name, GlobalNbId:&entities.GlobalNbId{PlmnId:"02f829", NbId:"4a952a0a"}}
rNibErr := w.SaveNodeb(nbIdentity, &nb)
assert.NotNil(t, rNibErr)
assert.Equal(t, common.VALIDATION_ERROR, rNibErr.GetCode())
rNibErr := w.SaveNodeb(nbIdentity, &nb)
assert.NotNil(t, rNibErr)
assert.Equal(t, common.VALIDATION_ERROR, rNibErr.GetCode())
nb.Ip = "localhost"
nb.Port = 5656
enb := entities.Enb{}
nb.Ip = "localhost"
nb.Port = 5656
enb := entities.Enb{}
- cell := &entities.ServedCellInfo{CellId: "aaa", Pci: 3}
+ cell := &entities.ServedCellInfo{CellId:"aaa",Pci:3}
enb.ServedCells = []*entities.ServedCellInfo{cell}
enb.ServedCells = []*entities.ServedCellInfo{cell}
- nb.Configuration = &entities.NodebInfo_Enb{Enb: &enb}
+ nb.Configuration = &entities.NodebInfo_Enb{Enb:&enb}
- nbIdentity := &entities.NbIdentity{InventoryName: "", GlobalNbId: &entities.GlobalNbId{PlmnId: "02f829", NbId: "4a952a0a"}}
+ nbIdentity := &entities.NbIdentity{InventoryName:"", GlobalNbId:&entities.GlobalNbId{PlmnId:"02f829", NbId:"4a952a0a"}}
rNibErr := w.SaveNodeb(nbIdentity, &nb)
assert.NotNil(t, rNibErr)
assert.Equal(t, common.VALIDATION_ERROR, rNibErr.GetCode())
rNibErr := w.SaveNodeb(nbIdentity, &nb)
assert.NotNil(t, rNibErr)
assert.Equal(t, common.VALIDATION_ERROR, rNibErr.GetCode())
nb.Ip = "localhost"
nb.Port = 5656
enb := entities.Enb{}
nb.Ip = "localhost"
nb.Port = 5656
enb := entities.Enb{}
- nb.Configuration = &entities.NodebInfo_Enb{Enb: &enb}
+ nb.Configuration = &entities.NodebInfo_Enb{Enb:&enb}
data, err := proto.Marshal(&nb)
if err != nil {
t.Errorf("#rNibWriter_test.TestSaveEnbOnClosedPool - Failed to marshal NodeB entity. Error: %v", err)
data, err := proto.Marshal(&nb)
if err != nil {
t.Errorf("#rNibWriter_test.TestSaveEnbOnClosedPool - Failed to marshal NodeB entity. Error: %v", err)
sdlInstanceMock.On("Set", setExpected).Return(e)
writerPool.Close()
nbIdentity := &entities.NbIdentity{}
sdlInstanceMock.On("Set", setExpected).Return(e)
writerPool.Close()
nbIdentity := &entities.NbIdentity{}
- assert.Panics(t, func() { w.SaveNodeb(nbIdentity, &nb) })
+ assert.Panics(t, func(){w.SaveNodeb(nbIdentity, &nb)})
}
func TestSaveGnbCellIdValidationFailure(t *testing.T) {
}
func TestSaveGnbCellIdValidationFailure(t *testing.T) {
nb.Ip = "localhost"
nb.Port = 5656
gnb := entities.Gnb{}
nb.Ip = "localhost"
nb.Port = 5656
gnb := entities.Gnb{}
- cellInfo := &entities.ServedNRCellInformation{NrPci: 2}
- cell := &entities.ServedNRCell{ServedNrCellInformation: cellInfo}
+ cellInfo:= &entities.ServedNRCellInformation{NrPci:2}
+ cell := &entities.ServedNRCell{ServedNrCellInformation:cellInfo}
gnb.ServedNrCells = []*entities.ServedNRCell{cell}
gnb.ServedNrCells = []*entities.ServedNRCell{cell}
- nb.Configuration = &entities.NodebInfo_Gnb{Gnb: &gnb}
+ nb.Configuration = &entities.NodebInfo_Gnb{Gnb:&gnb}
- nbIdentity := &entities.NbIdentity{InventoryName: name, GlobalNbId: &entities.GlobalNbId{PlmnId: "02f829", NbId: "4a952a0a"}}
+ nbIdentity := &entities.NbIdentity{InventoryName:name, GlobalNbId:&entities.GlobalNbId{PlmnId:"02f829", NbId:"4a952a0a"}}
rNibErr := w.SaveNodeb(nbIdentity, &nb)
assert.NotNil(t, rNibErr)
assert.Equal(t, common.VALIDATION_ERROR, rNibErr.GetCode())
rNibErr := w.SaveNodeb(nbIdentity, &nb)
assert.NotNil(t, rNibErr)
assert.Equal(t, common.VALIDATION_ERROR, rNibErr.GetCode())
nb.Ip = "localhost"
nb.Port = 5656
gnb := entities.Gnb{}
nb.Ip = "localhost"
nb.Port = 5656
gnb := entities.Gnb{}
- cellInfo := &entities.ServedNRCellInformation{NrPci: 2, CellId: "ccdd"}
- cell := &entities.ServedNRCell{ServedNrCellInformation: cellInfo}
- cellEntity := entities.Cell{Type: entities.Cell_NR_CELL, Cell: &entities.Cell_ServedNrCell{ServedNrCell: cell}}
+ cellInfo:= &entities.ServedNRCellInformation{NrPci:2,CellId:"ccdd"}
+ cell := &entities.ServedNRCell{ServedNrCellInformation:cellInfo}
+ cellEntity := entities.Cell{Type:entities.Cell_NR_CELL, Cell:&entities.Cell_ServedNrCell{ServedNrCell:cell}}
gnb.ServedNrCells = []*entities.ServedNRCell{cell}
gnb.ServedNrCells = []*entities.ServedNRCell{cell}
- nb.Configuration = &entities.NodebInfo_Gnb{Gnb: &gnb}
+ nb.Configuration = &entities.NodebInfo_Gnb{Gnb:&gnb}
data, err := proto.Marshal(&nb)
if err != nil {
t.Errorf("#rNibWriter_test.TestSaveGnb - Failed to marshal NodeB entity. Error: %v", err)
}
var e error
data, err := proto.Marshal(&nb)
if err != nil {
t.Errorf("#rNibWriter_test.TestSaveGnb - Failed to marshal NodeB entity. Error: %v", err)
}
var e error
cellData, err := proto.Marshal(&cellEntity)
if err != nil {
t.Errorf("#rNibWriter_test.TestSaveGnb - Failed to marshal Cell entity. Error: %v", err)
cellData, err := proto.Marshal(&cellEntity)
if err != nil {
t.Errorf("#rNibWriter_test.TestSaveGnb - Failed to marshal Cell entity. Error: %v", err)
setExpected = append(setExpected, fmt.Sprintf("PCI:%s:%02x", name, cell.GetServedNrCellInformation().GetNrPci()), cellData)
sdlInstanceMock.On("Set", []interface{}{setExpected}).Return(e)
setExpected = append(setExpected, fmt.Sprintf("PCI:%s:%02x", name, cell.GetServedNrCellInformation().GetNrPci()), cellData)
sdlInstanceMock.On("Set", []interface{}{setExpected}).Return(e)
- nbIdentity := &entities.NbIdentity{InventoryName: name, GlobalNbId: &entities.GlobalNbId{PlmnId: "02f829", NbId: "4a952a0a"}}
+ nbIdentity := &entities.NbIdentity{InventoryName:name, GlobalNbId:&entities.GlobalNbId{PlmnId:"02f829", NbId:"4a952a0a"}}
nbIdData, err := proto.Marshal(nbIdentity)
if err != nil {
t.Errorf("#rNibWriter_test.TestSaveGnb - Failed to marshal NodeB Identity entity. Error: %v", err)
}
sdlInstanceMock.On("AddMember", "GNB", []interface{}{nbIdData}).Return(e)
nbIdData, err := proto.Marshal(nbIdentity)
if err != nil {
t.Errorf("#rNibWriter_test.TestSaveGnb - Failed to marshal NodeB Identity entity. Error: %v", err)
}
sdlInstanceMock.On("AddMember", "GNB", []interface{}{nbIdData}).Return(e)
+ nbIdData, err = proto.Marshal(&entities.NbIdentity{InventoryName: name})
+ if err != nil {
+ t.Errorf("#rNibWriter_test.TestSaveEnb - Failed to marshal nbIdentity entity. Error: %v", err)
+ }
+ sdlInstanceMock.On("RemoveMember", entities.Node_UNKNOWN.String(), []interface{}{nbIdData}).Return(e)
+
rNibErr := w.SaveNodeb(nbIdentity, &nb)
assert.Nil(t, rNibErr)
}
rNibErr := w.SaveNodeb(nbIdentity, &nb)
assert.Nil(t, rNibErr)
}
sdlInstanceMock := initSdlInstanceMock(namespace, 1)
w := GetRNibWriter()
sdlInstanceMock := initSdlInstanceMock(namespace, 1)
w := GetRNibWriter()
ranLoadInformation := generateRanLoadInformation()
data, err := proto.Marshal(ranLoadInformation)
ranLoadInformation := generateRanLoadInformation()
data, err := proto.Marshal(ranLoadInformation)
setExpected = append(setExpected, loadKey, data)
sdlInstanceMock.On("Set", []interface{}{setExpected}).Return(e)
setExpected = append(setExpected, loadKey, data)
sdlInstanceMock.On("Set", []interface{}{setExpected}).Return(e)
rNibErr := w.SaveRanLoadInformation(inventoryName, ranLoadInformation)
assert.Nil(t, rNibErr)
}
rNibErr := w.SaveRanLoadInformation(inventoryName, ranLoadInformation)
assert.Nil(t, rNibErr)
}
w := GetRNibWriter()
expectedErr := common.NewInternalError(errors.New("proto: Marshal called with nil"))
w := GetRNibWriter()
expectedErr := common.NewInternalError(errors.New("proto: Marshal called with nil"))
- err := w.SaveRanLoadInformation(inventoryName, nil)
+ err:= w.SaveRanLoadInformation(inventoryName, nil)
assert.Equal(t, expectedErr, err)
}
assert.Equal(t, expectedErr, err)
}
initSdlInstanceMock(namespace, 1)
w := GetRNibWriter()
initSdlInstanceMock(namespace, 1)
w := GetRNibWriter()
- err := w.SaveRanLoadInformation(inventoryName, nil)
+ err:= w.SaveRanLoadInformation(inventoryName, nil)
assert.NotNil(t, err)
assert.Equal(t, common.VALIDATION_ERROR, err.GetCode())
}
assert.NotNil(t, err)
assert.Equal(t, common.VALIDATION_ERROR, err.GetCode())
}
t.Errorf("#rNibWriter_test.TestSaveRanLoadInformationSuccess - Failed to build ran load infromation key. Error: %v", validationErr)
}
t.Errorf("#rNibWriter_test.TestSaveRanLoadInformationSuccess - Failed to build ran load infromation key. Error: %v", validationErr)
}
writerPool = nil
sdlInstanceMock := initSdlInstanceMock(namespace, 1)
w := GetRNibWriter()
writerPool = nil
sdlInstanceMock := initSdlInstanceMock(namespace, 1)
w := GetRNibWriter()
t.Errorf("#rNibWriter_test.TestSaveRanLoadInformation - Failed to marshal RanLoadInformation entity. Error: %v", err)
}
t.Errorf("#rNibWriter_test.TestSaveRanLoadInformation - Failed to marshal RanLoadInformation entity. Error: %v", err)
}
expectedErr := errors.New("expected error")
var setExpected []interface{}
setExpected = append(setExpected, loadKey, data)
sdlInstanceMock.On("Set", []interface{}{setExpected}).Return(expectedErr)
expectedErr := errors.New("expected error")
var setExpected []interface{}
setExpected = append(setExpected, loadKey, data)
sdlInstanceMock.On("Set", []interface{}{setExpected}).Return(expectedErr)
rNibErr := w.SaveRanLoadInformation(inventoryName, ranLoadInformation)
assert.NotNil(t, rNibErr)
assert.Equal(t, common.INTERNAL_ERROR, rNibErr.GetCode())
rNibErr := w.SaveRanLoadInformation(inventoryName, ranLoadInformation)
assert.NotNil(t, rNibErr)
assert.Equal(t, common.INTERNAL_ERROR, rNibErr.GetCode())
cellLoadInformation.UlInterferenceOverloadIndications = []entities.UlInterferenceOverloadIndication{ulInterferenceOverloadIndication}
ulHighInterferenceInformation := entities.UlHighInterferenceInformation{
cellLoadInformation.UlInterferenceOverloadIndications = []entities.UlInterferenceOverloadIndication{ulInterferenceOverloadIndication}
ulHighInterferenceInformation := entities.UlHighInterferenceInformation{
- TargetCellId: "456",
- UlHighInterferenceIndication: "xxx",
+ TargetCellId:"456",
+ UlHighInterferenceIndication:"xxx",
- cellLoadInformation.UlHighInterferenceInfos = []*entities.UlHighInterferenceInformation{&ulHighInterferenceInformation}
+ cellLoadInformation.UlHighInterferenceInfos = []*entities.UlHighInterferenceInformation{&ulHighInterferenceInformation }
cellLoadInformation.RelativeNarrowbandTxPower = &entities.RelativeNarrowbandTxPower{
cellLoadInformation.RelativeNarrowbandTxPower = &entities.RelativeNarrowbandTxPower{
- RntpPerPrb: "xxx",
- RntpThreshold: entities.RntpThreshold_NEG_4,
+ RntpPerPrb:"xxx",
+ RntpThreshold:entities.RntpThreshold_NEG_4,
NumberOfCellSpecificAntennaPorts: entities.NumberOfCellSpecificAntennaPorts_V1_ANT_PRT,
NumberOfCellSpecificAntennaPorts: entities.NumberOfCellSpecificAntennaPorts_V1_ANT_PRT,
- PB: 1,
- PdcchInterferenceImpact: 2,
+ PB: 1,
+ PdcchInterferenceImpact:2,
EnhancedRntp: &entities.EnhancedRntp{
EnhancedRntp: &entities.EnhancedRntp{
- EnhancedRntpBitmap: "xxx",
- RntpHighPowerThreshold: entities.RntpThreshold_NEG_2,
- EnhancedRntpStartTime: &entities.StartTime{StartSfn: 500, StartSubframeNumber: 5},
+ EnhancedRntpBitmap:"xxx",
+ RntpHighPowerThreshold:entities.RntpThreshold_NEG_2,
+ EnhancedRntpStartTime: &entities.StartTime{StartSfn:500,StartSubframeNumber:5},
},
}
cellLoadInformation.AbsInformation = &entities.AbsInformation{
},
}
cellLoadInformation.AbsInformation = &entities.AbsInformation{
- Mode: entities.AbsInformationMode_ABS_INFO_FDD,
- AbsPatternInfo: "xxx",
- NumberOfCellSpecificAntennaPorts: entities.NumberOfCellSpecificAntennaPorts_V2_ANT_PRT,
- MeasurementSubset: "xxx",
+ Mode: entities.AbsInformationMode_ABS_INFO_FDD,
+ AbsPatternInfo:"xxx",
+ NumberOfCellSpecificAntennaPorts:entities.NumberOfCellSpecificAntennaPorts_V2_ANT_PRT,
+ MeasurementSubset:"xxx",
}
cellLoadInformation.InvokeIndication = entities.InvokeIndication_ABS_INFORMATION
cellLoadInformation.ExtendedUlInterferenceOverloadInfo = &entities.ExtendedUlInterferenceOverloadInfo{
}
cellLoadInformation.InvokeIndication = entities.InvokeIndication_ABS_INFORMATION
cellLoadInformation.ExtendedUlInterferenceOverloadInfo = &entities.ExtendedUlInterferenceOverloadInfo{
- AssociatedSubframes: "xxx",
- ExtendedUlInterferenceOverloadIndications: cellLoadInformation.UlInterferenceOverloadIndications,
+ AssociatedSubframes:"xxx",
+ ExtendedUlInterferenceOverloadIndications:cellLoadInformation.UlInterferenceOverloadIndications,
}
compInformationItem := &entities.CompInformationItem{
}
compInformationItem := &entities.CompInformationItem{
- CompHypothesisSets: []*entities.CompHypothesisSet{&entities.CompHypothesisSet{CellId: "789", CompHypothesis: "xxx"}},
- BenefitMetric: 50,
+ CompHypothesisSets: []*entities.CompHypothesisSet{&entities.CompHypothesisSet{CellId: "789", CompHypothesis:"xxx"}},
+ BenefitMetric:50,
}
cellLoadInformation.CompInformation = &entities.CompInformation{
}
cellLoadInformation.CompInformation = &entities.CompInformation{
- CompInformationItems: []*entities.CompInformationItem{compInformationItem},
- CompInformationStartTime: &entities.StartTime{StartSfn: 123, StartSubframeNumber: 456},
+ CompInformationItems:[]*entities.CompInformationItem{compInformationItem},
+ CompInformationStartTime:&entities.StartTime{StartSfn:123,StartSubframeNumber:456},
}
cellLoadInformation.DynamicDlTransmissionInformation = &entities.DynamicDlTransmissionInformation{
}
cellLoadInformation.DynamicDlTransmissionInformation = &entities.DynamicDlTransmissionInformation{
- State: entities.NaicsState_NAICS_ACTIVE,
- TransmissionModes: "xxx",
- PB: 2,
- PAList: []entities.PA{entities.PA_DB_NEG_3},
+ State: entities.NaicsState_NAICS_ACTIVE,
+ TransmissionModes:"xxx",
+ PB: 2,
+ PAList:[]entities.PA{entities.PA_DB_NEG_3},
}
return &cellLoadInformation
}
return &cellLoadInformation
ranLoadInformation.LoadTimestamp = uint64(time.Now().UnixNano())
ranLoadInformation.LoadTimestamp = uint64(time.Now().UnixNano())
cellLoadInformation := generateCellLoadInformation()
ranLoadInformation.CellLoadInfos = []*entities.CellLoadInformation{cellLoadInformation}
cellLoadInformation := generateCellLoadInformation()
ranLoadInformation.CellLoadInfos = []*entities.CellLoadInformation{cellLoadInformation}
initSdlInstanceMock(namespace, 1)
w := GetRNibWriter()
expectedErr := common.NewValidationError(errors.New("#rNibWriter.saveNodeB - Unknown responding node type, entity: ip:\"localhost\" port:5656 "))
initSdlInstanceMock(namespace, 1)
w := GetRNibWriter()
expectedErr := common.NewValidationError(errors.New("#rNibWriter.saveNodeB - Unknown responding node type, entity: ip:\"localhost\" port:5656 "))
- nbIdentity := &entities.NbIdentity{InventoryName: "name", GlobalNbId: &entities.GlobalNbId{PlmnId: "02f829", NbId: "4a952a0a"}}
+ nbIdentity := &entities.NbIdentity{InventoryName:"name", GlobalNbId:&entities.GlobalNbId{PlmnId:"02f829", NbId:"4a952a0a"}}
nb := &entities.NodebInfo{}
nb.Port = 5656
nb.Ip = "localhost"
nb := &entities.NodebInfo{}
nb.Port = 5656
nb.Ip = "localhost"
if err != nil {
t.Errorf("#rNibWriter_test.TestSaveEntityFailure - Failed to marshal NodeB entity. Error: %v", err)
}
if err != nil {
t.Errorf("#rNibWriter_test.TestSaveEntityFailure - Failed to marshal NodeB entity. Error: %v", err)
}
- nbIdentity := &entities.NbIdentity{InventoryName: name, GlobalNbId: &entities.GlobalNbId{PlmnId: plmnId, NbId: nbId}}
+ nbIdentity := &entities.NbIdentity{InventoryName:name, GlobalNbId:&entities.GlobalNbId{PlmnId:plmnId, NbId:nbId}}
setExpected := []interface{}{"RAN:" + name, data}
setExpected := []interface{}{"RAN:" + name, data}
- setExpected = append(setExpected, "GNB:"+plmnId+":"+nbId, data)
+ setExpected = append(setExpected,"GNB:" + plmnId + ":" + nbId, data)
expectedErr := errors.New("expected error")
sdlInstanceMock.On("Set", []interface{}{setExpected}).Return(expectedErr)
rNibErr := w.SaveNodeb(nbIdentity, &gnb)
expectedErr := errors.New("expected error")
sdlInstanceMock.On("Set", []interface{}{setExpected}).Return(expectedErr)
rNibErr := w.SaveNodeb(nbIdentity, &gnb)
func TestGetRNibWriterPoolNotInitializedFailure(t *testing.T) {
writerPool = nil
func TestGetRNibWriterPoolNotInitializedFailure(t *testing.T) {
writerPool = nil
- assert.Panics(t, func() { GetRNibWriter() })
+ assert.Panics(t, func(){GetRNibWriter()})
}
func TestGetRNibWriter(t *testing.T) {
}
func TestGetRNibWriter(t *testing.T) {
var e error
instanceMock.On("Close").Return(e)
Close()
var e error
instanceMock.On("Close").Return(e)
Close()
- assert.Panics(t, func() { Close() })
+ assert.Panics(t, func(){Close()})
}
func TestCloseFailure(t *testing.T) {
}
func TestCloseFailure(t *testing.T) {
-//func TestSaveEnbInteg(t *testing.T){
+//func TestSaveEnbGnbInteg(t *testing.T){
// for i := 0; i<10; i++{
// Init("e2Manager", 1)
// w := GetRNibWriter()
// for i := 0; i<10; i++{
// Init("e2Manager", 1)
// w := GetRNibWriter()
//
// nb1 := entities.NodebInfo{}
// nb1.NodeType = entities.Node_GNB
//
// nb1 := entities.NodebInfo{}
// nb1.NodeType = entities.Node_GNB
-// nb.ConnectionStatus = entities.ConnectionStatus_CONNECTED
+// nb1.ConnectionStatus = entities.ConnectionStatus_CONNECTED
// nb1.Ip = "localhost"
// nb1.Port = uint32(6565 + i)
// gnb := entities.Gnb{}
// nb1.Ip = "localhost"
// nb1.Port = uint32(6565 + i)
// gnb := entities.Gnb{}
+//
+//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()
//func TestSaveRanLoadInformationInteg(t *testing.T){
// Init("e2Manager", 1)
// w := GetRNibWriter()
// if err != nil{
// t.Errorf("#rNibWriter_test.TestSaveRanLoadInformationInteg - Failed to save RanLoadInformation entity. Error: %v", err)
// }
// if err != nil{
// t.Errorf("#rNibWriter_test.TestSaveRanLoadInformationInteg - Failed to save RanLoadInformation entity. Error: %v", err)
// }
+//}
\ No newline at end of file