From: idanshal Date: Thu, 16 Jul 2020 15:01:18 +0000 (+0000) Subject: [RIC-431] Remove handling of UNKNOWN node types from GetNodebIdsList X-Git-Tag: common/v1.0.46 X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=commitdiff_plain;h=286f566b2e0e9551a1e57bd14cbf767647fca90d;p=ric-plt%2Fnodeb-rnib.git [RIC-431] Remove handling of UNKNOWN node types from GetNodebIdsList Change-Id: I4f5747884c9c6646a0763afb6885c11564495937 Signed-off-by: idanshal --- diff --git a/reader/go.mod b/reader/go.mod index 9160ac4..87dfb21 100644 --- a/reader/go.mod +++ b/reader/go.mod @@ -3,8 +3,8 @@ module gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/reader go 1.12 require ( - gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/common v1.0.45 - gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/entities v1.0.45 + gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/common v1.0.46 + gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/entities v1.0.46 github.com/golang/protobuf v1.4.2 github.com/google/go-cmp v0.4.1 // indirect github.com/pkg/errors v0.8.1 diff --git a/reader/rNibReader.go b/reader/rNibReader.go index 19feefa..a83c033 100644 --- a/reader/rNibReader.go +++ b/reader/rNibReader.go @@ -178,12 +178,7 @@ func (w *rNibReaderInstance) GetListNodebIds() ([]*entities.NbIdentity, error) { if err != nil { return nil, common.NewInternalError(err) } - dataUnknown, err := w.sdl.GetMembers(entities.Node_UNKNOWN.String()) - if err != nil { - return nil, common.NewInternalError(err) - } allIds := append(dataEnb, dataGnb...) - allIds = append(allIds, dataUnknown...) data, rnibErr := w.unmarshalIdentityList(allIds) return data, rnibErr } diff --git a/reader/rNibReader_test.go b/reader/rNibReader_test.go index 73ff176..4004be5 100644 --- a/reader/rNibReader_test.go +++ b/reader/rNibReader_test.go @@ -369,21 +369,13 @@ func TestGetListNodesIdsSuccess(t *testing.T) { t.Errorf("#rNibReader_test.TestGetListNodesIdsSuccess - Failed to marshal nodeb identity entity. Error: %v", err) } - name2 := "name2" - nbIdentity2 := &entities.NbIdentity{InventoryName: name2} - data2, err := proto.Marshal(nbIdentity2) - if err != nil { - t.Errorf("#rNibReader_test.TestGetListNodesIdsSuccess - Failed to marshal nodeb identity entity. Error: %v", err) - } - sdlInstanceMock.On("GetMembers", entities.Node_GNB.String()).Return([]string{string(data)}, nilError) sdlInstanceMock.On("GetMembers", entities.Node_ENB.String()).Return([]string{string(data1)}, nilError) - sdlInstanceMock.On("GetMembers", entities.Node_UNKNOWN.String()).Return([]string{string(data2)}, nilError) ids, er := w.GetListNodebIds() assert.Nil(t, er) assert.NotNil(t, ids) - assert.Len(t, ids, 3) + assert.Len(t, ids, 2) } func TestGetListEnbIdsUnmarshalFailure(t *testing.T) {