X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=pkg%2Fteststube2ap%2FstubE2.go;h=5d28d3bff674d7c05369e75417eb509dc4115fe7;hb=5112239fe7bf1a53f43d8898d2862921594b1f80;hp=bcc6aae4e23b47fa07a09ea7e297e651722c86c5;hpb=e5e672c043d80c7a531b9d6d640ca8879d9bf01b;p=ric-plt%2Fsubmgr.git diff --git a/pkg/teststube2ap/stubE2.go b/pkg/teststube2ap/stubE2.go index bcc6aae..5d28d3b 100644 --- a/pkg/teststube2ap/stubE2.go +++ b/pkg/teststube2ap/stubE2.go @@ -324,6 +324,38 @@ func (tc *E2Stub) SendSubsResp(t *testing.T, req *e2ap.E2APSubscriptionRequest, } } +//----------------------------------------------------------------------------- +// +//----------------------------------------------------------------------------- +func (tc *E2Stub) SendInvalidE2Asn1Resp(t *testing.T, msg *xapp.RMRParams, msgType int) { + + params := &xapp.RMRParams{} + params.Mtype = msgType + params.SubId = -1 + params.Payload = []byte{1, 2, 3, 4, 5} + params.PayloadLen = 5 + params.Meid = msg.Meid + params.Xid = "" + params.Mbuf = nil + + if params.Mtype == xapp.RIC_SUB_RESP { + tc.Info("SEND INVALID ASN.1 SUB RESP") + + } else if params.Mtype == xapp.RIC_SUB_FAILURE { + tc.Info("SEND INVALID ASN.1 SUB FAILURE") + + } else if params.Mtype == xapp.RIC_SUB_DEL_RESP { + tc.Info("SEND INVALID ASN.1 SUB DEL RESP") + + } else if params.Mtype == xapp.RIC_SUB_DEL_FAILURE { + tc.Info("SEND INVALID ASN.1 SUB DEL FAILURE") + } + snderr := tc.SendWithRetry(params, false, 5) + if snderr != nil { + tc.TestError(t, "RMR SEND FAILED: %s", snderr.Error()) + } +} + //----------------------------------------------------------------------------- // //----------------------------------------------------------------------------- @@ -597,7 +629,7 @@ func (tc *E2Stub) SendSubsDelFail(t *testing.T, req *e2ap.E2APSubscriptionDelete resp.RequestId.Id = req.RequestId.Id resp.RequestId.InstanceId = req.RequestId.InstanceId resp.FunctionId = req.FunctionId - resp.Cause.Content = 4 // CauseMisc + resp.Cause.Content = 5 // CauseMisc resp.Cause.Value = 3 // unspecified packerr, packedMsg := e2SubsDelFail.Pack(resp)