plmn id handling improved
[ric-plt/submgr.git] / pkg / teststube2ap / stubE2.go
index c7c09ab..a5dfa54 100644 (file)
@@ -104,7 +104,8 @@ func (p *E2StubSubsReqParams) Init() {
        p.Req.FunctionId = 1
 
        p.Req.EventTriggerDefinition.InterfaceId.GlobalEnbId.Present = true
-       p.Req.EventTriggerDefinition.InterfaceId.GlobalEnbId.PlmnIdentity.StringPut("310150")
+       p.Req.EventTriggerDefinition.InterfaceId.GlobalEnbId.PlmnIdentity.Mcc = "310"
+       p.Req.EventTriggerDefinition.InterfaceId.GlobalEnbId.PlmnIdentity.Mnc = "150"
        p.Req.EventTriggerDefinition.InterfaceId.GlobalEnbId.NodeId.Id = 123
        p.Req.EventTriggerDefinition.InterfaceId.GlobalEnbId.NodeId.Bits = e2ap.E2AP_ENBIDHomeBits28
 
@@ -116,15 +117,15 @@ func (p *E2StubSubsReqParams) Init() {
        p.Req.EventTriggerDefinition.TypeOfMessage = e2ap.E2AP_InitiatingMessage
 
        p.Req.ActionSetups = make([]e2ap.ActionToBeSetupItem, 1)
+
        p.Req.ActionSetups[0].ActionId = 0
        p.Req.ActionSetups[0].ActionType = e2ap.E2AP_ActionTypeReport
-       p.Req.ActionSetups[0].ActionDefinition.Present = false
+       p.Req.ActionSetups[0].ActionDefinition.Present = false // Not supported
        //p.Req.ActionSetups[index].ActionDefinition.StyleId = 255
        //p.Req.ActionSetups[index].ActionDefinition.ParamId = 222
        p.Req.ActionSetups[0].SubsequentAction.Present = true
        p.Req.ActionSetups[0].SubsequentAction.Type = e2ap.E2AP_SubSeqActionTypeContinue
        p.Req.ActionSetups[0].SubsequentAction.TimetoWait = e2ap.E2AP_TimeToWaitZero
-
 }
 
 //-----------------------------------------------------------------------------
@@ -198,6 +199,7 @@ func (tc *E2Stub) SendSubsReq(t *testing.T, rparams *E2StubSubsReqParams, oldTra
        params.Mtype = xapp.RIC_SUB_REQ
        params.SubId = -1
        params.Payload = packedMsg.Buf
+       params.PayloadLen = len(packedMsg.Buf)
        params.Meid = trans.meid
        params.Xid = trans.xid
        params.Mbuf = nil
@@ -282,6 +284,7 @@ func (tc *E2Stub) SendSubsResp(t *testing.T, req *e2ap.E2APSubscriptionRequest,
        //params.SubId = msg.SubId
        params.SubId = -1
        params.Payload = packedMsg.Buf
+       params.PayloadLen = len(packedMsg.Buf)
        params.Meid = msg.Meid
        //params.Xid = msg.Xid
        params.Mbuf = nil
@@ -354,6 +357,7 @@ func (tc *E2Stub) SendSubsFail(t *testing.T, fparams *E2StubSubsFailParams, msg
        params.Mtype = xapp.RIC_SUB_FAILURE
        params.SubId = msg.SubId
        params.Payload = packedMsg.Buf
+       params.PayloadLen = len(packedMsg.Buf)
        params.Meid = msg.Meid
        params.Xid = msg.Xid
        params.Mbuf = nil
@@ -436,6 +440,7 @@ func (tc *E2Stub) SendSubsDelReq(t *testing.T, oldTrans *RmrTransactionId, e2Sub
        params.Mtype = xapp.RIC_SUB_DEL_REQ
        params.SubId = int(e2SubsId)
        params.Payload = packedMsg.Buf
+       params.PayloadLen = len(packedMsg.Buf)
        params.Meid = trans.meid
        params.Xid = trans.xid
        params.Mbuf = nil
@@ -505,6 +510,7 @@ func (tc *E2Stub) SendSubsDelResp(t *testing.T, req *e2ap.E2APSubscriptionDelete
        params.Mtype = xapp.RIC_SUB_DEL_RESP
        params.SubId = msg.SubId
        params.Payload = packedMsg.Buf
+       params.PayloadLen = len(packedMsg.Buf)
        params.Meid = msg.Meid
        params.Xid = msg.Xid
        params.Mbuf = nil
@@ -576,6 +582,7 @@ func (tc *E2Stub) SendSubsDelFail(t *testing.T, req *e2ap.E2APSubscriptionDelete
        params.Mtype = xapp.RIC_SUB_DEL_FAILURE
        params.SubId = msg.SubId
        params.Payload = packedMsg.Buf
+       params.PayloadLen = len(packedMsg.Buf)
        params.Meid = msg.Meid
        params.Xid = msg.Xid
        params.Mbuf = nil