From: subhash kumar singh Date: Fri, 6 May 2022 07:32:01 +0000 (+0000) Subject: Add txID in RICServiceUpdate message X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=commitdiff_plain;h=72df30a162be46c3dda91c9a053cb853b2c95e45;p=ric-plt%2Fe2mgr.git Add txID in RICServiceUpdate message Added transaction ID support in RICServiceUpdate message. Signed-off-by: subhash kumar singh Change-Id: Iac59040d2b2bcd90f63ac7cc3e90941902c9a14d --- diff --git a/E2Manager/handlers/rmrmsghandlers/ric_service_update_handler.go b/E2Manager/handlers/rmrmsghandlers/ric_service_update_handler.go index 2f871e7..94f9272 100644 --- a/E2Manager/handlers/rmrmsghandlers/ric_service_update_handler.go +++ b/E2Manager/handlers/rmrmsghandlers/ric_service_update_handler.go @@ -89,7 +89,7 @@ func (h *RicServiceUpdateHandler) Handle(request *models.NotificationRequest) { h.logger.Infof("#RicServiceUpdateHandler.Handle - RIC_SERVICE_UPDATE has been parsed successfully %+v", ricServiceUpdate) ackFunctionIds := h.updateFunctions(ricServiceUpdate.E2APPDU.InitiatingMessage.Value.RICServiceUpdate.ProtocolIEs.RICServiceUpdateIEs, nodebInfo) - if len(ricServiceUpdate.E2APPDU.InitiatingMessage.Value.RICServiceUpdate.ProtocolIEs.RICServiceUpdateIEs) != 0 { + if len(ricServiceUpdate.E2APPDU.InitiatingMessage.Value.RICServiceUpdate.ProtocolIEs.RICServiceUpdateIEs) > 1 { err = h.rNibDataService.UpdateNodebInfoAndPublish(nodebInfo) if err != nil { h.logger.Errorf("#RicServiceUpdateHandler.Handle - RAN name: %s - Failed at UpdateNodebInfoAndPublish. error: %s", nodebInfo.RanName, err) diff --git a/E2Manager/models/ric_service_update_message.go b/E2Manager/models/ric_service_update_message.go index 0ffe458..29055d5 100644 --- a/E2Manager/models/ric_service_update_message.go +++ b/E2Manager/models/ric_service_update_message.go @@ -69,6 +69,7 @@ type RICServiceUpdateIEs struct { } `xml:"criticality"` Value struct { Text string `xml:",chardata"` + TransactionID string `xml:"TransactionID"` RANfunctionsList struct { Text string `xml:",chardata"` RANfunctionsItemProtocolIESingleContainer []RANfunctionsItemProtocolIESingleContainer `xml:"ProtocolIE-SingleContainer"` @@ -113,11 +114,11 @@ type RICServiceUpdateMessage struct { func (m *RICServiceUpdateE2APPDU) ExtractRanFunctionsList() []*entities.RanFunction { serviceUpdateRequestIes := m.InitiatingMessage.Value.RICServiceUpdate.ProtocolIEs.RICServiceUpdateIEs - if len(serviceUpdateRequestIes) < 2 { + if len(serviceUpdateRequestIes) < 3 { return nil } - ranFunctionsListContainer := serviceUpdateRequestIes[1].Value.RANfunctionsList.RANfunctionsItemProtocolIESingleContainer + ranFunctionsListContainer := serviceUpdateRequestIes[2].Value.RANfunctionsList.RANfunctionsItemProtocolIESingleContainer funcs := make([]*entities.RanFunction, len(ranFunctionsListContainer)) for i := 0; i < len(funcs); i++ { ranFunctionItem := ranFunctionsListContainer[i].Value.RANfunctionItem diff --git a/E2Manager/models/ric_service_update_message_test.go b/E2Manager/models/ric_service_update_message_test.go index 3edff8a..de6a136 100644 --- a/E2Manager/models/ric_service_update_message_test.go +++ b/E2Manager/models/ric_service_update_message_test.go @@ -58,3 +58,8 @@ func TestRicServiceUpdateMessageWithOID(t *testing.T) { assert.Equal(t, uint32(2), ranFunctions[0].RanFunctionRevision) assert.Equal(t, "OID20", ranFunctions[0].RanFunctionOid) } + +func TestRICServiceUpdateMessageTxId(t *testing.T) { + serviceUpdate := getTestRicServiceUpdate(t, "../tests/resources/serviceUpdate/RicServiceUpdate_AddedFunction_With_OID.xml") + assert.Equal(t, "1234", serviceUpdate.E2APPDU.InitiatingMessage.Value.RICServiceUpdate.ProtocolIEs.RICServiceUpdateIEs[0].Value.TransactionID) +} diff --git a/E2Manager/tests/resources/serviceUpdate/RicServiceUpdate_AddedFunction.xml b/E2Manager/tests/resources/serviceUpdate/RicServiceUpdate_AddedFunction.xml index c8b246c..1a08f45 100644 --- a/E2Manager/tests/resources/serviceUpdate/RicServiceUpdate_AddedFunction.xml +++ b/E2Manager/tests/resources/serviceUpdate/RicServiceUpdate_AddedFunction.xml @@ -5,6 +5,13 @@ + + 49 + + + 1234 + + 10 diff --git a/E2Manager/tests/resources/serviceUpdate/RicServiceUpdate_AddedFunction_With_OID.xml b/E2Manager/tests/resources/serviceUpdate/RicServiceUpdate_AddedFunction_With_OID.xml index 319b681..7bd3631 100644 --- a/E2Manager/tests/resources/serviceUpdate/RicServiceUpdate_AddedFunction_With_OID.xml +++ b/E2Manager/tests/resources/serviceUpdate/RicServiceUpdate_AddedFunction_With_OID.xml @@ -5,6 +5,13 @@ + + 49 + + + 1234 + + 10 diff --git a/E2Manager/tests/resources/serviceUpdate/RicServiceUpdate_DeleteFunction.xml b/E2Manager/tests/resources/serviceUpdate/RicServiceUpdate_DeleteFunction.xml index af0d259..07b93b6 100644 --- a/E2Manager/tests/resources/serviceUpdate/RicServiceUpdate_DeleteFunction.xml +++ b/E2Manager/tests/resources/serviceUpdate/RicServiceUpdate_DeleteFunction.xml @@ -5,6 +5,13 @@ + + 49 + + + 1234 + + 11 diff --git a/E2Manager/tests/resources/serviceUpdate/RicServiceUpdate_Empty.xml b/E2Manager/tests/resources/serviceUpdate/RicServiceUpdate_Empty.xml index 1a7b23b..b52a34c 100644 --- a/E2Manager/tests/resources/serviceUpdate/RicServiceUpdate_Empty.xml +++ b/E2Manager/tests/resources/serviceUpdate/RicServiceUpdate_Empty.xml @@ -5,6 +5,13 @@ + + 49 + + + 1234 + + diff --git a/E2Manager/tests/resources/serviceUpdate/RicServiceUpdate_ModifiedFunction.xml b/E2Manager/tests/resources/serviceUpdate/RicServiceUpdate_ModifiedFunction.xml index 30311e1..9756b37 100644 --- a/E2Manager/tests/resources/serviceUpdate/RicServiceUpdate_ModifiedFunction.xml +++ b/E2Manager/tests/resources/serviceUpdate/RicServiceUpdate_ModifiedFunction.xml @@ -5,6 +5,13 @@ + + 49 + + + 1234 + + 12 diff --git a/E2Manager/tests/resources/serviceUpdate/RicServiceUpdate_SetupRequest.xml b/E2Manager/tests/resources/serviceUpdate/RicServiceUpdate_SetupRequest.xml index d210242..b8f6548 100644 --- a/E2Manager/tests/resources/serviceUpdate/RicServiceUpdate_SetupRequest.xml +++ b/E2Manager/tests/resources/serviceUpdate/RicServiceUpdate_SetupRequest.xml @@ -5,6 +5,13 @@ + + 49 + + + 1234 + + 3