2 ==================================================================================
3 Copyright (c) 2019 AT&T Intellectual Property.
4 Copyright (c) 2019 Nokia
6 Licensed under the Apache License, Version 2.0 (the "License");
7 you may not use this file except in compliance with the License.
8 You may obtain a copy of the License at
10 http://www.apache.org/licenses/LICENSE-2.0
12 Unless required by applicable law or agreed to in writing, software
13 distributed under the License is distributed on an "AS IS" BASIS,
14 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 See the License for the specific language governing permissions and
16 limitations under the License.
17 ==================================================================================
29 "gerrit.o-ran-sc.org/r/ric-plt/e2ap/pkg/e2ap"
30 "gerrit.o-ran-sc.org/r/ric-plt/e2ap/pkg/e2ap_wrapper"
31 "gerrit.o-ran-sc.org/r/ric-plt/submgr/pkg/teststub"
32 clientmodel "gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/clientmodel"
33 //"gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/models"
34 "gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/xapp"
37 //-----------------------------------------------------------------------------
39 //-----------------------------------------------------------------------------
40 var e2asnpacker e2ap.E2APPackerIf = e2ap_wrapper.NewAsn1E2Packer()
42 //-----------------------------------------------------------------------------
44 //-----------------------------------------------------------------------------
45 type RmrTransactionId struct {
50 type E2RestIds struct {
58 func (trans *RmrTransactionId) String() string {
60 if trans.meid != nil {
61 meidstr = trans.meid.String()
63 return "trans(" + trans.xid + "/" + meidstr + ")"
67 teststub.RmrStubControl
71 CallBackNotification chan int64
72 RESTNotification chan uint32
73 CallBackListedNotifications chan E2RestIds
74 ListedRESTNotifications chan E2RestIds
75 clientEndpoint clientmodel.SubscriptionParamsClientEndpoint
77 restSubsIdList []string
80 //-----------------------------------------------------------------------------
82 //-----------------------------------------------------------------------------
83 func CreateNewE2Stub(desc string, srcId teststub.RmrSrcId, rtgSvc teststub.RmrRtgSvc, stat string, mtypeseed int, ranName string, host string, RMRPort int64, HTTPPort int64) *E2Stub {
85 tc.RmrStubControl.Init(desc, srcId, rtgSvc, stat, mtypeseed)
88 tc.CallBackNotification = make(chan int64)
89 tc.RESTNotification = make(chan uint32)
90 tc.CallBackListedNotifications = make(chan E2RestIds)
91 tc.ListedRESTNotifications = make(chan E2RestIds, 2)
92 var endPoint clientmodel.SubscriptionParamsClientEndpoint
94 endPoint.HTTPPort = &HTTPPort
95 endPoint.RMRPort = &RMRPort
96 tc.clientEndpoint = endPoint
101 //-----------------------------------------------------------------------------
103 //-----------------------------------------------------------------------------
104 func CreateNewE2termStub(desc string, srcId teststub.RmrSrcId, rtgSvc teststub.RmrRtgSvc, stat string, mtypeseed int) *E2Stub {
106 tc.RmrStubControl.Init(desc, srcId, rtgSvc, stat, mtypeseed)
108 tc.SetCheckXid(false)
112 //-----------------------------------------------------------------------------
114 //-----------------------------------------------------------------------------
115 func (tc *E2Stub) NewRmrTransactionId(xid string, ranname string) *RmrTransactionId {
116 trans := &RmrTransactionId{}
118 trans.xid = tc.GetDesc() + "_XID_" + strconv.FormatUint(uint64(tc.xid_seq), 10)
123 trans.meid = &xapp.RMRMeid{RanName: ranname}
124 tc.Debug("New test %s", trans.String())
128 //-----------------------------------------------------------------------------
130 //-----------------------------------------------------------------------------
131 type E2StubSubsReqParams struct {
132 Req *e2ap.E2APSubscriptionRequest
135 func (p *E2StubSubsReqParams) Init() {
136 p.Req = &e2ap.E2APSubscriptionRequest{}
138 p.Req.RequestId.Id = 1
139 p.Req.RequestId.InstanceId = 0
142 // gnb -> enb outgoing
143 // enb -> gnb incoming
145 p.Req.EventTriggerDefinition.Data.Length = 1
146 p.Req.EventTriggerDefinition.Data.Data = make([]uint8, p.Req.EventTriggerDefinition.Data.Length)
147 p.Req.EventTriggerDefinition.Data.Data[0] = 1
149 p.Req.ActionSetups = make([]e2ap.ActionToBeSetupItem, 1)
151 p.Req.ActionSetups[0].ActionId = 0
152 p.Req.ActionSetups[0].ActionType = e2ap.E2AP_ActionTypeReport
153 p.Req.ActionSetups[0].RicActionDefinitionPresent = true
155 p.Req.ActionSetups[0].ActionDefinitionChoice.Data.Length = 1
156 p.Req.ActionSetups[0].ActionDefinitionChoice.Data.Data = make([]uint8, p.Req.ActionSetups[0].ActionDefinitionChoice.Data.Length)
157 p.Req.ActionSetups[0].ActionDefinitionChoice.Data.Data[0] = 1
159 p.Req.ActionSetups[0].SubsequentAction.Present = true
160 p.Req.ActionSetups[0].SubsequentAction.Type = e2ap.E2AP_SubSeqActionTypeContinue
161 p.Req.ActionSetups[0].SubsequentAction.TimetoWait = e2ap.E2AP_TimeToWaitZero
164 //-----------------------------------------------------------------------------
166 //-----------------------------------------------------------------------------
168 type E2StubSubsFailParams struct {
169 Req *e2ap.E2APSubscriptionRequest
170 Fail *e2ap.E2APSubscriptionFailure
173 func (p *E2StubSubsFailParams) Set(req *e2ap.E2APSubscriptionRequest) {
176 p.Fail = &e2ap.E2APSubscriptionFailure{}
177 p.Fail.RequestId.Id = p.Req.RequestId.Id
178 p.Fail.RequestId.InstanceId = p.Req.RequestId.InstanceId
179 p.Fail.FunctionId = p.Req.FunctionId
180 p.Fail.ActionNotAdmittedList.Items = make([]e2ap.ActionNotAdmittedItem, len(p.Req.ActionSetups))
181 for index := int(0); index < len(p.Fail.ActionNotAdmittedList.Items); index++ {
182 p.Fail.ActionNotAdmittedList.Items[index].ActionId = p.Req.ActionSetups[index].ActionId
183 p.SetCauseVal(index, 5, 1)
187 func (p *E2StubSubsFailParams) SetCauseVal(ind int, content uint8, causeval uint8) {
190 for index := int(0); index < len(p.Fail.ActionNotAdmittedList.Items); index++ {
191 p.Fail.ActionNotAdmittedList.Items[index].Cause.Content = content
192 p.Fail.ActionNotAdmittedList.Items[index].Cause.Value = causeval
196 p.Fail.ActionNotAdmittedList.Items[ind].Cause.Content = content
197 p.Fail.ActionNotAdmittedList.Items[ind].Cause.Value = causeval
200 //-----------------------------------------------------------------------------
202 //-----------------------------------------------------------------------------
204 func (tc *E2Stub) SendSubsReq(t *testing.T, rparams *E2StubSubsReqParams, oldTrans *RmrTransactionId) *RmrTransactionId {
208 trans = tc.NewRmrTransactionId("", "RAN_NAME_1")
211 tc.Debug("SendSubsReq %s", trans.String())
212 e2SubsReq := e2asnpacker.NewPackerSubscriptionRequest()
214 //---------------------------------
215 // xapp activity: Send Subs Req
216 //---------------------------------
220 myparams = &E2StubSubsReqParams{}
224 err, packedMsg := e2SubsReq.Pack(myparams.Req)
226 tc.TestError(t, "pack NOK %s %s", trans.String(), err.Error())
229 tc.Debug("%s %s", trans.String(), e2SubsReq.String())
231 params := &xapp.RMRParams{}
232 params.Mtype = xapp.RIC_SUB_REQ
234 params.Payload = packedMsg.Buf
235 params.PayloadLen = len(packedMsg.Buf)
236 params.Meid = trans.meid
237 params.Xid = trans.xid
240 tc.Debug("SEND SUB REQ: %s", params.String())
241 snderr := tc.SendWithRetry(params, false, 5)
243 tc.TestError(t, "RMR SEND FAILED: %s %s", trans.String(), snderr.Error())
249 //-----------------------------------------------------------------------------
251 //-----------------------------------------------------------------------------
252 func (tc *E2Stub) RecvSubsReq(t *testing.T) (*e2ap.E2APSubscriptionRequest, *xapp.RMRParams) {
253 tc.Debug("RecvSubsReq")
254 e2SubsReq := e2asnpacker.NewPackerSubscriptionRequest()
256 //---------------------------------
257 // e2term activity: Recv Subs Req
258 //---------------------------------
259 msg := tc.WaitMsg(15)
261 if msg.Mtype != xapp.RICMessageTypes["RIC_SUB_REQ"] {
262 tc.TestError(t, "Received wrong mtype expected %s got %s, error", "RIC_SUB_REQ", xapp.RicMessageTypeToName[msg.Mtype])
264 tc.Debug("Recv Subs Req")
265 packedData := &e2ap.PackedData{}
266 packedData.Buf = msg.Payload
267 unpackerr, req := e2SubsReq.UnPack(packedData)
268 if unpackerr != nil {
269 tc.TestError(t, "RIC_SUB_REQ unpack failed err: %s", unpackerr.Error())
274 tc.TestError(t, "Not Received msg within %d secs", 15)
280 //-----------------------------------------------------------------------------
282 //-----------------------------------------------------------------------------
283 func (tc *E2Stub) SendSubsResp(t *testing.T, req *e2ap.E2APSubscriptionRequest, msg *xapp.RMRParams) {
284 tc.Debug("SendSubsResp")
285 e2SubsResp := e2asnpacker.NewPackerSubscriptionResponse()
287 //---------------------------------
288 // e2term activity: Send Subs Resp
289 //---------------------------------
290 resp := &e2ap.E2APSubscriptionResponse{}
292 resp.RequestId.Id = req.RequestId.Id
293 resp.RequestId.InstanceId = req.RequestId.InstanceId
294 resp.FunctionId = req.FunctionId
296 resp.ActionAdmittedList.Items = make([]e2ap.ActionAdmittedItem, len(req.ActionSetups))
297 for index := int(0); index < len(req.ActionSetups); index++ {
298 resp.ActionAdmittedList.Items[index].ActionId = req.ActionSetups[index].ActionId
301 packerr, packedMsg := e2SubsResp.Pack(resp)
303 tc.TestError(t, "pack NOK %s", packerr.Error())
305 tc.Debug("%s", e2SubsResp.String())
307 params := &xapp.RMRParams{}
308 params.Mtype = xapp.RIC_SUB_RESP
309 //params.SubId = msg.SubId
311 params.Payload = packedMsg.Buf
312 params.PayloadLen = len(packedMsg.Buf)
313 params.Meid = msg.Meid
314 //params.Xid = msg.Xid
317 tc.Debug("SEND SUB RESP: %s", params.String())
318 snderr := tc.SendWithRetry(params, false, 5)
320 tc.TestError(t, "RMR SEND FAILED: %s", snderr.Error())
324 //-----------------------------------------------------------------------------
326 //-----------------------------------------------------------------------------
327 func (tc *E2Stub) SendPartialSubsResp(t *testing.T, req *e2ap.E2APSubscriptionRequest, msg *xapp.RMRParams, actionNotAdmittedList e2ap.ActionNotAdmittedList) {
328 tc.Debug("SendPartialSubsResp")
330 if len(actionNotAdmittedList.Items) == 0 {
331 tc.TestError(t, "SendPartialSubsResp() Empty actionNotAdmittedList.Items")
335 e2SubsResp := e2asnpacker.NewPackerSubscriptionResponse()
337 //---------------------------------
338 // e2term activity: Send Subs Resp
339 //---------------------------------
340 resp := &e2ap.E2APSubscriptionResponse{}
342 resp.RequestId.Id = req.RequestId.Id
343 resp.RequestId.InstanceId = req.RequestId.InstanceId
344 resp.FunctionId = req.FunctionId
346 for index, actionNotAdmittedItem := range actionNotAdmittedList.Items {
347 for _, ActionToBeSetupItem := range req.ActionSetups {
348 if ActionToBeSetupItem.ActionId == actionNotAdmittedItem.ActionId {
349 actionNotAdmittedItem := e2ap.ActionNotAdmittedItem{}
350 actionNotAdmittedItem.ActionId = ActionToBeSetupItem.ActionId
351 actionNotAdmittedItem.Cause.Content = 1
352 actionNotAdmittedItem.Cause.Value = 8
353 resp.ActionNotAdmittedList.Items = append(resp.ActionNotAdmittedList.Items, actionNotAdmittedItem)
354 // Remove the element
355 req.ActionSetups = append(req.ActionSetups[:index], req.ActionSetups[index+1:]...)
360 for _, ActionToBeSetupItem := range req.ActionSetups {
361 actionAdmittedItem := e2ap.ActionAdmittedItem{}
362 actionAdmittedItem.ActionId = ActionToBeSetupItem.ActionId
363 resp.ActionAdmittedList.Items = append(resp.ActionAdmittedList.Items, actionAdmittedItem)
366 packerr, packedMsg := e2SubsResp.Pack(resp)
368 tc.TestError(t, "pack NOK %s", packerr.Error())
370 tc.Debug("%s", e2SubsResp.String())
372 params := &xapp.RMRParams{}
373 params.Mtype = xapp.RIC_SUB_RESP
374 //params.SubId = msg.SubId
376 params.Payload = packedMsg.Buf
377 params.PayloadLen = len(packedMsg.Buf)
378 params.Meid = msg.Meid
379 //params.Xid = msg.Xid
382 tc.Debug("SEND SUB RESP: %s", params.String())
383 snderr := tc.SendWithRetry(params, false, 5)
385 tc.TestError(t, "RMR SEND FAILED: %s", snderr.Error())
389 //-----------------------------------------------------------------------------
391 //-----------------------------------------------------------------------------
392 func (tc *E2Stub) SendInvalidE2Asn1Resp(t *testing.T, msg *xapp.RMRParams, msgType int) {
394 params := &xapp.RMRParams{}
395 params.Mtype = msgType
397 params.Payload = []byte{1, 2, 3, 4, 5}
398 params.PayloadLen = 5
399 params.Meid = msg.Meid
403 if params.Mtype == xapp.RIC_SUB_RESP {
404 tc.Debug("SEND INVALID ASN.1 SUB RESP")
406 } else if params.Mtype == xapp.RIC_SUB_FAILURE {
407 tc.Debug("SEND INVALID ASN.1 SUB FAILURE")
409 } else if params.Mtype == xapp.RIC_SUB_DEL_RESP {
410 tc.Debug("SEND INVALID ASN.1 SUB DEL RESP")
412 } else if params.Mtype == xapp.RIC_SUB_DEL_FAILURE {
413 tc.Debug("SEND INVALID ASN.1 SUB DEL FAILURE")
415 snderr := tc.SendWithRetry(params, false, 5)
417 tc.TestError(t, "RMR SEND FAILED: %s", snderr.Error())
421 //-----------------------------------------------------------------------------
423 //-----------------------------------------------------------------------------
424 func (tc *E2Stub) RecvSubsResp(t *testing.T, trans *RmrTransactionId) uint32 {
425 tc.Debug("RecvSubsResp")
426 e2SubsResp := e2asnpacker.NewPackerSubscriptionResponse()
429 //---------------------------------
430 // xapp activity: Recv Subs Resp
431 //---------------------------------
432 msg := tc.WaitMsg(15)
434 if msg.Mtype != xapp.RICMessageTypes["RIC_SUB_RESP"] {
435 tc.TestError(t, "Received RIC_SUB_RESP wrong mtype expected %s got %s, error", "RIC_SUB_RESP", xapp.RicMessageTypeToName[msg.Mtype])
437 } else if msg.Xid != trans.xid {
438 tc.TestError(t, "Received RIC_SUB_RESP wrong xid expected %s got %s, error", trans.xid, msg.Xid)
441 packedData := &e2ap.PackedData{}
442 packedData.Buf = msg.Payload
444 e2SubsId = uint32(msg.SubId)
448 unpackerr, resp := e2SubsResp.UnPack(packedData)
449 if unpackerr != nil {
450 tc.TestError(t, "RIC_SUB_RESP unpack failed err: %s", unpackerr.Error())
452 tc.Debug("Recv Subs Resp rmr: xid=%s subid=%d, asn: instanceid=%d", msg.Xid, msg.SubId, resp.RequestId.InstanceId)
456 tc.TestError(t, "Not Received msg within %d secs", 15)
461 //-----------------------------------------------------------------------------
463 //-----------------------------------------------------------------------------
465 func (tc *E2Stub) SendSubsFail(t *testing.T, fparams *E2StubSubsFailParams, msg *xapp.RMRParams) {
466 tc.Debug("SendSubsFail")
467 e2SubsFail := e2asnpacker.NewPackerSubscriptionFailure()
469 //---------------------------------
470 // e2term activity: Send Subs Fail
471 //---------------------------------
472 packerr, packedMsg := e2SubsFail.Pack(fparams.Fail)
474 tc.TestError(t, "pack NOK %s", packerr.Error())
476 tc.Debug("%s", e2SubsFail.String())
478 params := &xapp.RMRParams{}
479 params.Mtype = xapp.RIC_SUB_FAILURE
480 params.SubId = msg.SubId
481 params.Payload = packedMsg.Buf
482 params.PayloadLen = len(packedMsg.Buf)
483 params.Meid = msg.Meid
487 tc.Debug("SEND SUB FAIL: %s", params.String())
488 snderr := tc.SendWithRetry(params, false, 5)
490 tc.TestError(t, "RMR SEND FAILED: %s", snderr.Error())
494 //-----------------------------------------------------------------------------
496 //-----------------------------------------------------------------------------
497 func (tc *E2Stub) RecvSubsFail(t *testing.T, trans *RmrTransactionId) uint32 {
498 tc.Debug("RecvSubsFail")
499 e2SubsFail := e2asnpacker.NewPackerSubscriptionFailure()
502 //-------------------------------
503 // xapp activity: Recv Subs Fail
504 //-------------------------------
505 msg := tc.WaitMsg(15)
507 if msg.Mtype != xapp.RICMessageTypes["RIC_SUB_FAILURE"] {
508 tc.TestError(t, "Received RIC_SUB_FAILURE wrong mtype expected %s got %s, error", "RIC_SUB_FAILURE", xapp.RicMessageTypeToName[msg.Mtype])
510 } else if msg.Xid != trans.xid {
511 tc.TestError(t, "Received RIC_SUB_FAILURE wrong xid expected %s got %s, error", trans.xid, msg.Xid)
514 packedData := &e2ap.PackedData{}
515 packedData.Buf = msg.Payload
517 e2SubsId = uint32(msg.SubId)
521 unpackerr, resp := e2SubsFail.UnPack(packedData)
522 if unpackerr != nil {
523 tc.TestError(t, "RIC_SUB_FAILURE unpack failed err: %s", unpackerr.Error())
525 tc.Debug("Recv Subs Fail rmr: xid=%s subid=%d, asn: instanceid=%d", msg.Xid, msg.SubId, resp.RequestId.InstanceId)
529 tc.TestError(t, "Not Received msg within %d secs", 15)
534 //-----------------------------------------------------------------------------
536 //-----------------------------------------------------------------------------
537 func (tc *E2Stub) SendSubsDelReq(t *testing.T, oldTrans *RmrTransactionId, e2SubsId uint32) *RmrTransactionId {
541 trans = tc.NewRmrTransactionId("", "RAN_NAME_1")
544 tc.Debug("SendSubsDelReq %s", trans.String())
545 e2SubsDelReq := e2asnpacker.NewPackerSubscriptionDeleteRequest()
546 //---------------------------------
547 // xapp activity: Send Subs Del Req
548 //---------------------------------
549 req := &e2ap.E2APSubscriptionDeleteRequest{}
551 req.RequestId.InstanceId = e2SubsId
554 err, packedMsg := e2SubsDelReq.Pack(req)
556 tc.TestError(t, "pack NOK %s %s", trans.String(), err.Error())
559 tc.Debug("%s %s", trans.String(), e2SubsDelReq.String())
561 params := &xapp.RMRParams{}
562 params.Mtype = xapp.RIC_SUB_DEL_REQ
563 params.SubId = int(e2SubsId)
564 params.Payload = packedMsg.Buf
565 params.PayloadLen = len(packedMsg.Buf)
566 params.Meid = trans.meid
567 params.Xid = trans.xid
570 tc.Debug("SEND SUB DEL REQ: %s", params.String())
571 snderr := tc.SendWithRetry(params, false, 5)
573 tc.TestError(t, "RMR SEND FAILED: %s %s", trans.String(), snderr.Error())
579 //-----------------------------------------------------------------------------
581 //-----------------------------------------------------------------------------
582 func (tc *E2Stub) RecvSubsDelReq(t *testing.T) (*e2ap.E2APSubscriptionDeleteRequest, *xapp.RMRParams) {
583 tc.Debug("RecvSubsDelReq")
584 e2SubsDelReq := e2asnpacker.NewPackerSubscriptionDeleteRequest()
586 //---------------------------------
587 // e2term activity: Recv Subs Del Req
588 //---------------------------------
589 msg := tc.WaitMsg(15)
591 if msg.Mtype != xapp.RICMessageTypes["RIC_SUB_DEL_REQ"] {
592 tc.TestError(t, "Received wrong mtype expected %s got %s, error", "RIC_SUB_DEL_REQ", xapp.RicMessageTypeToName[msg.Mtype])
594 tc.Debug("Recv Subs Del Req")
596 packedData := &e2ap.PackedData{}
597 packedData.Buf = msg.Payload
598 unpackerr, req := e2SubsDelReq.UnPack(packedData)
599 if unpackerr != nil {
600 tc.TestError(t, "RIC_SUB_DEL_REQ unpack failed err: %s", unpackerr.Error())
605 tc.TestError(t, "Not Received msg within %d secs", 15)
610 //-----------------------------------------------------------------------------
612 //-----------------------------------------------------------------------------
613 func (tc *E2Stub) SendSubsDelResp(t *testing.T, req *e2ap.E2APSubscriptionDeleteRequest, msg *xapp.RMRParams) {
614 tc.Debug("SendSubsDelResp")
615 e2SubsDelResp := e2asnpacker.NewPackerSubscriptionDeleteResponse()
617 //---------------------------------
618 // e2term activity: Send Subs Del Resp
619 //---------------------------------
620 resp := &e2ap.E2APSubscriptionDeleteResponse{}
621 resp.RequestId.Id = req.RequestId.Id
622 resp.RequestId.InstanceId = req.RequestId.InstanceId
623 resp.FunctionId = req.FunctionId
625 packerr, packedMsg := e2SubsDelResp.Pack(resp)
627 tc.TestError(t, "pack NOK %s", packerr.Error())
629 tc.Debug("%s", e2SubsDelResp.String())
631 params := &xapp.RMRParams{}
632 params.Mtype = xapp.RIC_SUB_DEL_RESP
633 params.SubId = msg.SubId
634 params.Payload = packedMsg.Buf
635 params.PayloadLen = len(packedMsg.Buf)
636 params.Meid = msg.Meid
640 tc.Debug("SEND SUB DEL RESP: %s", params.String())
641 snderr := tc.SendWithRetry(params, false, 5)
643 tc.TestError(t, "RMR SEND FAILED: %s", snderr.Error())
647 //-----------------------------------------------------------------------------
649 //-----------------------------------------------------------------------------
650 func (tc *E2Stub) RecvSubsDelResp(t *testing.T, trans *RmrTransactionId) {
651 tc.Debug("RecvSubsDelResp")
652 e2SubsDelResp := e2asnpacker.NewPackerSubscriptionDeleteResponse()
654 //---------------------------------
655 // xapp activity: Recv Subs Del Resp
656 //---------------------------------
657 msg := tc.WaitMsg(15)
659 if msg.Mtype != xapp.RICMessageTypes["RIC_SUB_DEL_RESP"] {
660 tc.TestError(t, "Received RIC_SUB_DEL_RESP wrong mtype expected %s got %s, error", "RIC_SUB_DEL_RESP", xapp.RicMessageTypeToName[msg.Mtype])
662 } else if trans != nil && msg.Xid != trans.xid {
663 tc.TestError(t, "Received RIC_SUB_DEL_RESP wrong xid expected %s got %s, error", trans.xid, msg.Xid)
666 packedData := &e2ap.PackedData{}
667 packedData.Buf = msg.Payload
668 unpackerr, resp := e2SubsDelResp.UnPack(packedData)
669 if unpackerr != nil {
670 tc.TestError(t, "RIC_SUB_DEL_RESP unpack failed err: %s", unpackerr.Error())
672 tc.Debug("Recv Subs Del Resp rmr: xid=%s subid=%d, asn: instanceid=%d", msg.Xid, msg.SubId, resp.RequestId.InstanceId)
676 tc.TestError(t, "Not Received msg within %d secs", 15)
680 //-----------------------------------------------------------------------------
682 //-----------------------------------------------------------------------------
683 func (tc *E2Stub) SendSubsDelFail(t *testing.T, req *e2ap.E2APSubscriptionDeleteRequest, msg *xapp.RMRParams) {
684 tc.Debug("SendSubsDelFail")
685 e2SubsDelFail := e2asnpacker.NewPackerSubscriptionDeleteFailure()
687 //---------------------------------
688 // e2term activity: Send Subs Del Fail
689 //---------------------------------
690 resp := &e2ap.E2APSubscriptionDeleteFailure{}
691 resp.RequestId.Id = req.RequestId.Id
692 resp.RequestId.InstanceId = req.RequestId.InstanceId
693 resp.FunctionId = req.FunctionId
694 resp.Cause.Content = 5 // CauseMisc
695 resp.Cause.Value = 3 // unspecified
697 packerr, packedMsg := e2SubsDelFail.Pack(resp)
699 tc.TestError(t, "pack NOK %s", packerr.Error())
701 tc.Debug("%s", e2SubsDelFail.String())
703 params := &xapp.RMRParams{}
704 params.Mtype = xapp.RIC_SUB_DEL_FAILURE
705 params.SubId = msg.SubId
706 params.Payload = packedMsg.Buf
707 params.PayloadLen = len(packedMsg.Buf)
708 params.Meid = msg.Meid
712 tc.Debug("SEND SUB DEL FAIL: %s", params.String())
713 snderr := tc.SendWithRetry(params, false, 5)
715 tc.TestError(t, "RMR SEND FAILED: %s", snderr.Error())
719 // REST code below all
721 /*****************************************************************************/
722 // REST interface specific functions are below
724 //-----------------------------------------------------------------------------
725 // Callback handler for subscription response notifications
726 //-----------------------------------------------------------------------------
727 func (tc *E2Stub) SubscriptionRespHandler(resp *clientmodel.SubscriptionResponse) {
729 if tc.subscriptionId == "SUBSCRIPTIONID NOT SET" {
730 tc.Debug("REST notification received for %v while no SubscriptionID was not set for E2EventInstanceID=%v, XappEventInstanceID=%v",
731 *resp.SubscriptionID, *resp.SubscriptionInstances[0].E2EventInstanceID, *resp.SubscriptionInstances[0].XappEventInstanceID)
732 tc.CallBackNotification <- *resp.SubscriptionInstances[0].E2EventInstanceID
733 } else if tc.subscriptionId == *resp.SubscriptionID {
734 tc.Debug("REST notification received SubscriptionID=%s, E2EventInstanceID=%v, RequestorID=%v",
735 *resp.SubscriptionID, *resp.SubscriptionInstances[0].E2EventInstanceID, *resp.SubscriptionInstances[0].XappEventInstanceID)
736 tc.CallBackNotification <- *resp.SubscriptionInstances[0].E2EventInstanceID
738 tc.Debug("MISMATCHING REST notification received SubscriptionID=%s<>%s, E2EventInstanceID=%v, XappEventInstanceID=%v",
739 tc.subscriptionId, *resp.SubscriptionID, *resp.SubscriptionInstances[0].E2EventInstanceID, *resp.SubscriptionInstances[0].XappEventInstanceID)
743 //-----------------------------------------------------------------------------
745 //-----------------------------------------------------------------------------
747 func (tc *E2Stub) ExpectRESTNotification(t *testing.T, restSubsId string) {
748 tc.expectNotification(t, restSubsId, "")
751 func (tc *E2Stub) ExpectRESTNotificationOk(t *testing.T, restSubsId string) {
752 tc.expectNotification(t, restSubsId, "allOk")
755 func (tc *E2Stub) ExpectRESTNotificationNok(t *testing.T, restSubsId string, expectError string) {
756 tc.expectNotification(t, restSubsId, expectError)
759 func (tc *E2Stub) expectNotification(t *testing.T, restSubsId string, expectError string) {
761 tc.Debug("### Started to wait REST notification for restSubsId= %v, RMRPort=%v, requestCount=%v responses expected", restSubsId, *tc.clientEndpoint.RMRPort, tc.requestCount)
762 tc.restSubsIdList = []string{restSubsId}
763 xapp.Subscription.SetResponseCB(tc.ListedRestNotifHandler)
764 if tc.requestCount == 0 {
765 tc.TestError(t, "### NO REST notifications SET received for restSubsId= %v, RMRPort=%v, request count ZERO!", restSubsId, *tc.clientEndpoint.RMRPort)
769 case e2Ids := <-tc.CallBackListedNotifications:
770 if tc.requestCount == 0 {
771 tc.TestError(t, "### REST notification count unexpectedly ZERO for restSubsId= %v", restSubsId)
772 } else if e2Ids.RestSubsId != restSubsId {
773 tc.TestError(t, "### Unexpected REST notifications received, expected %s but got %s instead", e2Ids.RestSubsId, restSubsId)
774 } else if e2Ids.ErrorCause == "" && expectError == "allFail" {
775 tc.TestError(t, "### Unexpected ok cause received from REST notifications |%s:%s|", e2Ids.RestSubsId, restSubsId)
776 } else if e2Ids.ErrorCause != "" && expectError == "allOk" {
777 tc.TestError(t, "### Unexpected ErrorCause: (%s), ErrorSource: (%s), TimeoutType: (%s) received from REST notifications |%s:%s|", e2Ids.ErrorCause, e2Ids.ErrorSource, e2Ids.TimeoutType, e2Ids.RestSubsId, restSubsId)
780 if tc.requestCount == 0 {
781 tc.Debug("### All expected REST notifications received for restSubsId= %v)", e2Ids.RestSubsId)
783 tc.Debug("### Expected REST notifications received for restSubsId= %v", e2Ids.RestSubsId)
785 if e2Ids.ErrorCause != "" && expectError == "allFail" {
786 tc.Debug("### REST Notification: RestSubsId: %s, ErrorCause: %s, ErrorSource: (%s), TimeoutType: (%s)", e2Ids.RestSubsId, e2Ids.ErrorCause, e2Ids.ErrorSource, e2Ids.TimeoutType)
788 tc.Debug("### REST Notification received Notif for %s : %v", e2Ids.RestSubsId, e2Ids.E2SubsId)
789 tc.ListedRESTNotifications <- e2Ids
790 if len(tc.ListedRESTNotifications) > 1 {
791 panic("expectNotification - ListedRESTNotifications stacking up")
794 case <-time.After(15 * time.Second):
795 err := fmt.Errorf("### Timeout 15s expired while expecting REST notification for subsId: %v", restSubsId)
796 tc.TestError(t, "%s", err.Error())
801 func (tc *E2Stub) WaitRESTNotification(t *testing.T, restSubsId string) uint32 {
803 stack := string(debug.Stack())
806 case e2SubsId := <-tc.ListedRESTNotifications:
807 if e2SubsId.RestSubsId == restSubsId {
808 tc.Debug("### Expected REST notifications received %s, e2SubsId %v", e2SubsId.RestSubsId, e2SubsId.E2SubsId)
809 return e2SubsId.E2SubsId
811 tc.TestError(t, "### Unexpected REST notification %s received, expected %v", e2SubsId.RestSubsId, restSubsId)
812 xapp.Logger.Debug("CALL STACK:\n %s", stack)
815 case <-time.After(15 * time.Second):
816 err := fmt.Errorf("### Timeout 15s expired while waiting REST notification for subsId: %v", restSubsId)
817 tc.TestError(t, "%s", err.Error())
818 xapp.Logger.Debug("CALL STACK:\n %s", stack)
819 panic("WaitRESTNotification - timeout error")
823 // Note, this function should be followed by a handling of <-xappConn1.RESTNotification.
824 func (tc *E2Stub) ExpectAnyNotification(t *testing.T) {
826 tc.Debug("### Started waiting ANY REST notifications received for RMRPort=%v", *tc.clientEndpoint.RMRPort)
828 case e2SubsId := <-tc.CallBackNotification:
829 tc.Debug("### ANY REST notifications received for e2SubsId %v RMRPort=%v", e2SubsId, *tc.clientEndpoint.RMRPort)
830 tc.RESTNotification <- (uint32)(e2SubsId)
831 case <-time.After(15 * time.Second):
832 err := fmt.Errorf("### Timeout 15s expired while waiting ANY REST notification")
833 tc.TestError(t, "%s", err.Error())
834 tc.RESTNotification <- 0
839 func (tc *E2Stub) WaitAnyRESTNotification(t *testing.T) uint32 {
842 case e2SubsId := <-tc.RESTNotification:
843 tc.Debug("### Expected ANY REST notification received for e2SubsId %v", e2SubsId)
846 case <-time.After(15 * time.Second):
847 err := fmt.Errorf("### Timeout 15s expired while waiting ANY REST notification")
848 tc.TestError(t, "%s", err.Error())
849 panic("WaitRESTNotification - timeout error")
853 func (tc *E2Stub) ListedRestNotifHandler(resp *clientmodel.SubscriptionResponse) {
855 if len(tc.restSubsIdList) == 0 {
856 tc.Error("Unexpected listed REST notifications received for SubscriptionID=%s, expected restSubsId list size was ZERO!", *resp.SubscriptionID)
858 for i, subsId := range tc.restSubsIdList {
859 if *resp.SubscriptionID == subsId {
860 //tc.Debug("Listed REST notifications received SubscriptionID=%s, InstanceID=%v, XappEventInstanceID=%v",
861 // *resp.SubscriptionID, *resp.SubscriptionInstances[0].InstanceID, *resp.SubscriptionInstances[0].XappEventInstanceID)
863 tc.restSubsIdList = append(tc.restSubsIdList[:i], tc.restSubsIdList[i+1:]...)
864 //tc.Debug("Removed %s from Listed REST notifications, %v entries left", *resp.SubscriptionID, len(tc.restSubsIdList))
866 // if resp.SubscriptionInstances[0].ErrorCause != nil {
867 tc.CallBackListedNotifications <- *tc.GetE2RestIds(resp)
869 // tc.CallBackListedNotifications <- E2RestIds{*resp.SubscriptionID, uint32(*resp.SubscriptionInstances[0].E2EventInstanceID), "", "", ""}
872 if len(tc.restSubsIdList) == 0 {
873 tc.Debug("All listed REST notifications received for SubscriptionID=%s", *resp.SubscriptionID)
879 tc.Error("UNKONWN REST notification received SubscriptionID=%s<>%s, InstanceID=%v, XappEventInstanceID=%v",
880 tc.subscriptionId, *resp.SubscriptionID, *resp.SubscriptionInstances[0].E2EventInstanceID, *resp.SubscriptionInstances[0].XappEventInstanceID)
884 //-----------------------------------------------------------------------------
886 //-----------------------------------------------------------------------------
887 func (tc *E2Stub) GetE2RestIds(resp *clientmodel.SubscriptionResponse) *E2RestIds {
889 e2RestIds := &E2RestIds{}
891 if resp.SubscriptionID != nil {
892 e2RestIds.RestSubsId = *resp.SubscriptionID
894 if resp.SubscriptionInstances != nil {
895 if resp.SubscriptionInstances[0].E2EventInstanceID != nil {
896 e2RestIds.E2SubsId = uint32(*resp.SubscriptionInstances[0].E2EventInstanceID)
898 e2RestIds.ErrorCause = resp.SubscriptionInstances[0].ErrorCause
899 e2RestIds.ErrorSource = resp.SubscriptionInstances[0].ErrorSource
900 e2RestIds.TimeoutType = resp.SubscriptionInstances[0].TimeoutType
906 //-----------------------------------------------------------------------------
908 //-----------------------------------------------------------------------------
909 func (tc *E2Stub) WaitListedRestNotifications(t *testing.T, restSubsIds []string) {
910 tc.Debug("Started to wait REST notifications for restSubsIds=%v, RMRPort=%v", restSubsIds, *tc.clientEndpoint.RMRPort)
912 tc.restSubsIdList = restSubsIds
913 xapp.Subscription.SetResponseCB(tc.ListedRestNotifHandler)
915 for i := 0; i < len(restSubsIds); i++ {
918 case e2Ids := <-tc.CallBackListedNotifications:
919 tc.Debug("Listed Notification waiter received Notif for %s : %v", e2Ids.RestSubsId, e2Ids.E2SubsId)
920 tc.ListedRESTNotifications <- e2Ids
921 case <-time.After(15 * time.Second):
922 err := fmt.Errorf("Timeout 15s expired while waiting Listed REST notification")
923 tc.TestError(t, "%s", err.Error())
924 tc.RESTNotification <- 0
930 //-----------------------------------------------------------------------------
932 //-----------------------------------------------------------------------------
933 func (tc *E2Stub) SendRESTSubsReq(t *testing.T, params *RESTSubsReqParams) string {
934 tc.Debug("======== Posting REST subscriptions to Submgr ======")
937 tc.Debug("SendRESTReportSubsReq: params == nil")
941 tc.subscriptionId = "SUBSCRIPTIONID NOT SET"
943 resp, err := xapp.Subscription.Subscribe(¶ms.SubsReqParams)
945 // Swagger generated code makes checks for the values that are inserted the subscription function
946 // If error cause is unknown and POST is not done, the problem is in the inserted values
947 tc.Error("======== REST subscription request failed %s ========", err.Error())
950 tc.subscriptionId = *resp.SubscriptionID
951 tc.Debug("======== REST subscriptions posted successfully. SubscriptionID = %s, RequestCount = %v ========", *resp.SubscriptionID, tc.requestCount)
952 return *resp.SubscriptionID
955 //-----------------------------------------------------------------------------
957 //-----------------------------------------------------------------------------
958 func (tc *E2Stub) GetRESTSubsReqReportParams(subReqCount int) *RESTSubsReqParams {
960 reportParams := RESTSubsReqParams{}
961 reportParams.GetRESTSubsReqReportParams(subReqCount, &tc.clientEndpoint, &tc.meid)
962 tc.requestCount = subReqCount
966 //-----------------------------------------------------------------------------
968 //-----------------------------------------------------------------------------
969 type RESTSubsReqParams struct {
970 SubsReqParams clientmodel.SubscriptionParams
973 func (p *RESTSubsReqParams) GetRESTSubsReqReportParams(subReqCount int, clientEndpoint *clientmodel.SubscriptionParamsClientEndpoint, meid *string) {
976 p.SubsReqParams.ClientEndpoint = clientEndpoint
977 p.SubsReqParams.Meid = meid
978 var rANFunctionID int64 = 33
979 p.SubsReqParams.RANFunctionID = &rANFunctionID
982 actionType := "report"
983 subsequestActioType := "continue"
984 timeToWait := "w10ms"
986 for requestCount := 0; requestCount < subReqCount; requestCount++ {
987 reqId := int64(requestCount) + 1
988 subscriptionDetail := &clientmodel.SubscriptionDetail{
989 XappEventInstanceID: &reqId,
990 EventTriggers: clientmodel.EventTriggerDefinition{
991 int64(1234 + requestCount),
993 ActionToBeSetupList: clientmodel.ActionsToBeSetup{
994 &clientmodel.ActionToBeSetup{
996 ActionType: &actionType,
997 ActionDefinition: clientmodel.ActionDefinition{
998 int64(5678 + requestCount),
1000 SubsequentAction: &clientmodel.SubsequentAction{
1001 SubsequentActionType: &subsequestActioType,
1002 TimeToWait: &timeToWait,
1007 p.SubsReqParams.SubscriptionDetails = append(p.SubsReqParams.SubscriptionDetails, subscriptionDetail)
1012 func (p *RESTSubsReqParams) SetMeid(MEID string) {
1013 p.SubsReqParams.Meid = &MEID
1016 func (p *RESTSubsReqParams) SetEndpoint(HTTP_port int64, RMR_port int64, host string) {
1017 var endpoint clientmodel.SubscriptionParamsClientEndpoint
1018 endpoint.HTTPPort = &HTTP_port
1019 endpoint.RMRPort = &RMR_port
1020 endpoint.Host = host
1021 p.SubsReqParams.ClientEndpoint = &endpoint
1024 func (p *RESTSubsReqParams) SetEndpointHost(host string) {
1026 if p.SubsReqParams.ClientEndpoint.Host != "" {
1027 if p.SubsReqParams.ClientEndpoint.Host != host {
1028 // Renaming toto, print something tc.Debug("Posting REST subscription request to Submgr")
1029 err := fmt.Errorf("hostname change attempt: %s -> %s", p.SubsReqParams.ClientEndpoint.Host, host)
1033 p.SubsReqParams.ClientEndpoint.Host = host
1036 func (p *RESTSubsReqParams) SetHTTPEndpoint(HTTP_port int64, host string) {
1038 p.SubsReqParams.ClientEndpoint.HTTPPort = &HTTP_port
1040 p.SetEndpointHost(host)
1042 if p.SubsReqParams.ClientEndpoint.RMRPort == nil {
1044 p.SubsReqParams.ClientEndpoint.RMRPort = &RMR_port
1048 func (p *RESTSubsReqParams) SetE2SubscriptionDirectives(E2RetryCount int64, E2TimeoutTimerValue int64, RMRRoutingNeeded bool) {
1050 E2SubscriptionDirectives := &clientmodel.SubscriptionParamsE2SubscriptionDirectives{}
1051 p.SubsReqParams.E2SubscriptionDirectives = E2SubscriptionDirectives
1052 p.SubsReqParams.E2SubscriptionDirectives.E2RetryCount = &E2RetryCount
1053 p.SubsReqParams.E2SubscriptionDirectives.E2TimeoutTimerValue = E2TimeoutTimerValue
1054 p.SubsReqParams.E2SubscriptionDirectives.RMRRoutingNeeded = RMRRoutingNeeded
1057 func (p *RESTSubsReqParams) RemoveE2SubscriptionDirectives() {
1059 p.SubsReqParams.E2SubscriptionDirectives = nil
1062 func (p *RESTSubsReqParams) SetSubActionTypes(actionType string) {
1064 for _, subDetail := range p.SubsReqParams.SubscriptionDetails {
1065 for _, action := range subDetail.ActionToBeSetupList {
1067 action.ActionType = &actionType
1073 func (p *RESTSubsReqParams) SetSubActionIDs(actionId int64) {
1075 for _, subDetail := range p.SubsReqParams.SubscriptionDetails {
1076 for _, action := range subDetail.ActionToBeSetupList {
1078 action.ActionID = &actionId
1084 func (p *RESTSubsReqParams) SetSubActionDefinition(actionDefinition []int64) {
1086 for _, subDetail := range p.SubsReqParams.SubscriptionDetails {
1087 for _, action := range subDetail.ActionToBeSetupList {
1089 action.ActionDefinition = actionDefinition
1095 func (p *RESTSubsReqParams) SetSubEventTriggerDefinition(eventTriggerDefinition []int64) {
1097 for _, subDetail := range p.SubsReqParams.SubscriptionDetails {
1098 if subDetail != nil {
1099 subDetail.EventTriggers = eventTriggerDefinition
1104 func (p *RESTSubsReqParams) AppendActionToActionToBeSetupList(actionId int64, actionType string, actionDefinition []int64, subsequentActionType string, timeToWait string) {
1106 actionToBeSetup := &clientmodel.ActionToBeSetup{
1107 ActionID: &actionId,
1108 ActionType: &actionType,
1109 ActionDefinition: clientmodel.ActionDefinition(actionDefinition),
1110 SubsequentAction: &clientmodel.SubsequentAction{
1111 SubsequentActionType: &subsequentActionType,
1112 TimeToWait: &timeToWait,
1116 for _, subDetail := range p.SubsReqParams.SubscriptionDetails {
1117 if subDetail != nil {
1118 subDetail.ActionToBeSetupList = append(subDetail.ActionToBeSetupList, actionToBeSetup)
1123 func (p *RESTSubsReqParams) SetRMREndpoint(RMR_port int64, host string) {
1125 p.SubsReqParams.ClientEndpoint.RMRPort = &RMR_port
1127 p.SetEndpointHost(host)
1129 if p.SubsReqParams.ClientEndpoint.HTTPPort == nil {
1131 p.SubsReqParams.ClientEndpoint.HTTPPort = &HTTP_port
1135 func (p *RESTSubsReqParams) SetTimeToWait(timeToWait string) {
1137 for _, subDetail := range p.SubsReqParams.SubscriptionDetails {
1138 for _, action := range subDetail.ActionToBeSetupList {
1139 if action != nil && action.SubsequentAction != nil {
1140 action.SubsequentAction.TimeToWait = &timeToWait
1146 func (p *RESTSubsReqParams) SetSubscriptionID(SubscriptionID *string) {
1148 if *SubscriptionID == "" {
1151 p.SubsReqParams.SubscriptionID = *SubscriptionID
1154 func (p *RESTSubsReqParams) SetXappEventInstanceID(xappEventInstanceId int64) {
1156 for _, subDetail := range p.SubsReqParams.SubscriptionDetails {
1157 if subDetail != nil {
1158 subDetail.XappEventInstanceID = &xappEventInstanceId
1163 //-----------------------------------------------------------------------------
1165 //-----------------------------------------------------------------------------
1166 func (tc *E2Stub) SendRESTSubsDelReq(t *testing.T, subscriptionID *string) {
1168 tc.Debug("======== Posting REST DELETE subscription(s) to Submgr ======")
1170 if *subscriptionID == "" {
1171 tc.Error("REST error in deleting subscriptions. Empty SubscriptionID = %s", *subscriptionID)
1173 tc.Debug("REST deleting E2 subscriptions. SubscriptionID = %s", *subscriptionID)
1175 err := xapp.Subscription.Unsubscribe(*subscriptionID)
1177 tc.Error("REST Delete subscription failed %s", err.Error())
1179 tc.Debug("REST delete subscription pushed to submgr successfully. SubscriptionID = %s", *subscriptionID)
1182 //-----------------------------------------------------------------------------
1184 //-----------------------------------------------------------------------------
1185 func (tc *E2Stub) GetRESTSubsReqPolicyParams(subReqCount int) *RESTSubsReqParams {
1187 policyParams := RESTSubsReqParams{}
1188 policyParams.GetRESTSubsReqPolicyParams(subReqCount, &tc.clientEndpoint, &tc.meid)
1189 tc.requestCount = subReqCount
1190 return &policyParams
1193 //-----------------------------------------------------------------------------
1195 //-----------------------------------------------------------------------------
1196 func (tc *E2Stub) DecrementRequestCount() {
1197 if tc.requestCount > 0 {
1198 tc.requestCount -= 1
1200 tc.Error("FAILED to decrement request count, count already ZERO")
1204 //-----------------------------------------------------------------------------
1206 //-----------------------------------------------------------------------------
1207 func (p *RESTSubsReqParams) GetRESTSubsReqPolicyParams(subReqCount int, clientEndpoint *clientmodel.SubscriptionParamsClientEndpoint, meid *string) {
1209 p.SubsReqParams.ClientEndpoint = clientEndpoint
1210 p.SubsReqParams.Meid = meid
1211 var rANFunctionID int64 = 33
1212 p.SubsReqParams.RANFunctionID = &rANFunctionID
1213 actionId := int64(1)
1214 actionType := "policy"
1215 subsequestActioType := "continue"
1216 timeToWait := "w10ms"
1218 for requestCount := 0; requestCount < subReqCount; requestCount++ {
1219 reqId := int64(requestCount) + 1
1220 subscriptionDetail := &clientmodel.SubscriptionDetail{
1221 XappEventInstanceID: &reqId,
1222 EventTriggers: clientmodel.EventTriggerDefinition{
1223 int64(1234 + requestCount),
1225 ActionToBeSetupList: clientmodel.ActionsToBeSetup{
1226 &clientmodel.ActionToBeSetup{
1227 ActionID: &actionId,
1228 ActionType: &actionType,
1229 ActionDefinition: clientmodel.ActionDefinition{
1230 int64(5678 + requestCount),
1232 SubsequentAction: &clientmodel.SubsequentAction{
1233 SubsequentActionType: &subsequestActioType,
1234 TimeToWait: &timeToWait,
1239 p.SubsReqParams.SubscriptionDetails = append(p.SubsReqParams.SubscriptionDetails, subscriptionDetail)
1243 func (p *RESTSubsReqParams) SetSubscriptionDirectives(e2Timeout int64, e2RetryCount int64, routingNeeded bool) {
1245 e2SubscriptionDirectives := &clientmodel.SubscriptionParamsE2SubscriptionDirectives{}
1246 e2SubscriptionDirectives.E2TimeoutTimerValue = e2Timeout
1247 e2SubscriptionDirectives.E2RetryCount = &e2RetryCount
1248 e2SubscriptionDirectives.RMRRoutingNeeded = routingNeeded
1249 p.SubsReqParams.E2SubscriptionDirectives = e2SubscriptionDirectives