X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=pkg%2Fcontrol%2Fut_messaging_test.go;h=b1379052548864c83c916d90ba6324d1c691193d;hb=b3277dceb4d0791961942583781f371222fb12ff;hp=e3d6655649d27079be71c95ca7328033b3a741da;hpb=5112239fe7bf1a53f43d8898d2862921594b1f80;p=ric-plt%2Fsubmgr.git diff --git a/pkg/control/ut_messaging_test.go b/pkg/control/ut_messaging_test.go index e3d6655..b137905 100644 --- a/pkg/control/ut_messaging_test.go +++ b/pkg/control/ut_messaging_test.go @@ -5722,6 +5722,74 @@ func TestRESTUnpackSubscriptionDeleteFailureNoTransaction(t *testing.T) { mainCtrl.wait_registry_empty(t, 10) } +//----------------------------------------------------------------------------- +// TestRESTSubReqFailAsn1PackSubReqError +// +// stub stub +// +-------+ +---------+ +---------+ +// | xapp | | submgr | | e2term | +// +-------+ +---------+ +---------+ +// | | | +// | RESTSubReq | | +// |---------------->| | +// | | | +// | RESTSubResp | | +// |<----------------| | +// | | | +// | ASN.1 encode fails | +// | | | +// | | SubDelReq | +// | |------------->| +// | | | +// | | SubDelFail | +// | |<-------------| +// | | | +// | RESTNotif | | +// | unsuccess | | +// |<----------------| | +// | | | +// | [SUBS DELETE] | +// | | | +// +//----------------------------------------------------------------------------- +func TestRESTSubReqFailAsn1PackSubReqError(t *testing.T) { + + mainCtrl.CounterValuesToBeVeriefied(t, CountersToBeAdded{ + Counter{cSubReqFromXapp, 1}, + Counter{cSubDelReqToE2, 1}, + Counter{cSubDelFailFromE2, 1}, + Counter{cSubRespToXapp, 1}, + }) + + subReqCount := 1 + parameterSet := 1 // E2SM-gNB-X2 + actionDefinitionPresent := true + actionParamCount := 1 + + var params *teststube2ap.RESTSubsReqParams = nil + params = xappConn1.GetRESTSubsReqReportParams(subReqCount, parameterSet, actionDefinitionPresent, actionParamCount) + e2ap_wrapper.AllowE2apToProcess(e2ap_wrapper.SUB_REQ, false) + + // Req + restSubId := xappConn1.SendRESTSubsReq(t, params) + xapp.Logger.Info("Send REST subscriber request for subscriberId : %v", restSubId) + + // E2t: Receive SubsDelReq + delreq, delmsg := e2termConn1.RecvSubsDelReq(t) + xappConn1.ExpectRESTNotification(t, restSubId) + + // Subscription does not exist in in E2 Node. + e2termConn1.SendSubsDelFail(t, delreq, delmsg) + + e2SubsId := xappConn1.WaitRESTNotification(t, restSubId) + xapp.Logger.Info("TEST: REST notification received e2SubsId=%v", e2SubsId) + + e2ap_wrapper.AllowE2apToProcess(e2ap_wrapper.SUB_REQ, true) + // Wait that subs is cleaned + waitSubsCleanup(t, e2SubsId, 10) + mainCtrl.VerifyCounterValues(t) +} + //////////////////////////////////////////////////////////////////////////////////// // Services for UT cases ////////////////////////////////////////////////////////////////////////////////////