RICFCA_RIC-357 Align Submgr with new E2 spec

Change-Id: I61077a90ac9b9a3be94e39e77e328ad86c7ec8e9
Signed-off-by: Anssi Mannila <anssi.mannila@nokia.com>
diff --git a/pkg/teststube2ap/stubE2.go b/pkg/teststube2ap/stubE2.go
index 9323555..bb2dff6 100644
--- a/pkg/teststube2ap/stubE2.go
+++ b/pkg/teststube2ap/stubE2.go
@@ -100,7 +100,7 @@
 	p.Req = &e2ap.E2APSubscriptionRequest{}
 
 	p.Req.RequestId.Id = 1
-	p.Req.RequestId.Seq = 0
+	p.Req.RequestId.InstanceId = 0
 	p.Req.FunctionId = 1
 
 	p.Req.EventTriggerDefinition.InterfaceId.GlobalEnbId.Present = true
@@ -119,9 +119,34 @@
 
 	p.Req.ActionSetups[0].ActionId = 0
 	p.Req.ActionSetups[0].ActionType = e2ap.E2AP_ActionTypeReport
-	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].RicActionDefinitionPresent = true
+	p.Req.ActionSetups[0].ActionDefinitionChoice.ActionDefinitionFormat1Present = false
+	p.Req.ActionSetups[0].ActionDefinitionChoice.ActionDefinitionFormat2Present = true
+
+	// 1..15
+	for index2 := 0; index2 < 1; index2++ {
+		ranUEgroupItem := e2ap.RANueGroupItem{}
+		// 1..255
+		for index2 := 0; index2 < 1; index2++ {
+			ranUEGroupDefItem := e2ap.RANueGroupDefItem{}
+			ranUEGroupDefItem.RanParameterID = 22
+			ranUEGroupDefItem.RanParameterTest = e2ap.RANParameterTest_equal
+			ranUEGroupDefItem.RanParameterValue.ValueIntPresent = true
+			ranUEGroupDefItem.RanParameterValue.ValueInt = 100
+			ranUEgroupItem.RanUEgroupDefinition.RanUEGroupDefItems = append(ranUEgroupItem.RanUEgroupDefinition.RanUEGroupDefItems, ranUEGroupDefItem)
+		}
+		// 1..255
+		for index3 := 0; index3 < 1; index3++ {
+			ranParameterItem := e2ap.RANParameterItem{}
+			ranParameterItem.RanParameterID = 33
+			ranParameterItem.RanParameterValue.ValueIntPresent = true
+			ranParameterItem.RanParameterValue.ValueInt = 100
+			ranUEgroupItem.RanPolicy.RanParameterItems = append(ranUEgroupItem.RanPolicy.RanParameterItems, ranParameterItem)
+		}
+		ranUEgroupItem.RanUEgroupID = 2
+		p.Req.ActionSetups[0].ActionDefinitionChoice.ActionDefinitionFormat2.RanUEgroupItems =
+			append(p.Req.ActionSetups[0].ActionDefinitionChoice.ActionDefinitionFormat2.RanUEgroupItems, ranUEgroupItem)
+	}
 	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
@@ -141,7 +166,7 @@
 
 	p.Fail = &e2ap.E2APSubscriptionFailure{}
 	p.Fail.RequestId.Id = p.Req.RequestId.Id
-	p.Fail.RequestId.Seq = p.Req.RequestId.Seq
+	p.Fail.RequestId.InstanceId = p.Req.RequestId.InstanceId
 	p.Fail.FunctionId = p.Req.FunctionId
 	p.Fail.ActionNotAdmittedList.Items = make([]e2ap.ActionNotAdmittedItem, len(p.Req.ActionSetups))
 	for index := int(0); index < len(p.Fail.ActionNotAdmittedList.Items); index++ {
@@ -256,7 +281,7 @@
 	resp := &e2ap.E2APSubscriptionResponse{}
 
 	resp.RequestId.Id = req.RequestId.Id
-	resp.RequestId.Seq = req.RequestId.Seq
+	resp.RequestId.InstanceId = req.RequestId.InstanceId
 	resp.FunctionId = req.FunctionId
 
 	resp.ActionAdmittedList.Items = make([]e2ap.ActionAdmittedItem, len(req.ActionSetups))
@@ -326,7 +351,7 @@
 			if unpackerr != nil {
 				tc.TestError(t, "RIC_SUB_RESP unpack failed err: %s", unpackerr.Error())
 			}
-			tc.Logger.Info("Recv Subs Resp rmr: xid=%s subid=%d, asn: seqnro=%d", msg.Xid, msg.SubId, resp.RequestId.Seq)
+			tc.Logger.Info("Recv Subs Resp rmr: xid=%s subid=%d, asn: instanceid=%d", msg.Xid, msg.SubId, resp.RequestId.InstanceId)
 			return e2SubsId
 		}
 	} else {
@@ -399,7 +424,7 @@
 			if unpackerr != nil {
 				tc.TestError(t, "RIC_SUB_FAILURE unpack failed err: %s", unpackerr.Error())
 			}
-			tc.Logger.Info("Recv Subs Fail rmr: xid=%s subid=%d, asn: seqnro=%d", msg.Xid, msg.SubId, resp.RequestId.Seq)
+			tc.Logger.Info("Recv Subs Fail rmr: xid=%s subid=%d, asn: instanceid=%d", msg.Xid, msg.SubId, resp.RequestId.InstanceId)
 			return e2SubsId
 		}
 	} else {
@@ -425,7 +450,7 @@
 	//---------------------------------
 	req := &e2ap.E2APSubscriptionDeleteRequest{}
 	req.RequestId.Id = 1
-	req.RequestId.Seq = e2SubsId
+	req.RequestId.InstanceId = e2SubsId
 	req.FunctionId = 1
 
 	err, packedMsg := e2SubsDelReq.Pack(req)
@@ -496,7 +521,7 @@
 	//---------------------------------
 	resp := &e2ap.E2APSubscriptionDeleteResponse{}
 	resp.RequestId.Id = req.RequestId.Id
-	resp.RequestId.Seq = req.RequestId.Seq
+	resp.RequestId.InstanceId = req.RequestId.InstanceId
 	resp.FunctionId = req.FunctionId
 
 	packerr, packedMsg := e2SubsDelResp.Pack(resp)
@@ -546,7 +571,7 @@
 			if unpackerr != nil {
 				tc.TestError(t, "RIC_SUB_DEL_RESP unpack failed err: %s", unpackerr.Error())
 			}
-			tc.Logger.Info("Recv Subs Del Resp rmr: xid=%s subid=%d, asn: seqnro=%d", msg.Xid, msg.SubId, resp.RequestId.Seq)
+			tc.Logger.Info("Recv Subs Del Resp rmr: xid=%s subid=%d, asn: instanceid=%d", msg.Xid, msg.SubId, resp.RequestId.InstanceId)
 			return
 		}
 	} else {
@@ -566,10 +591,10 @@
 	//---------------------------------
 	resp := &e2ap.E2APSubscriptionDeleteFailure{}
 	resp.RequestId.Id = req.RequestId.Id
-	resp.RequestId.Seq = req.RequestId.Seq
+	resp.RequestId.InstanceId = req.RequestId.InstanceId
 	resp.FunctionId = req.FunctionId
-	resp.Cause.Content = 3  // CauseMisc
-	resp.Cause.CauseVal = 4 // unspecified
+	resp.Cause.Content = 4  // CauseMisc
+	resp.Cause.CauseVal = 3 // unspecified
 
 	packerr, packedMsg := e2SubsDelFail.Pack(resp)
 	if packerr != nil {