+//-----------------------------------------------------------------------------
+// TestRESTSubReqAndE1apDeleteReqPackingError
+//
+// stub stub stub
+// +-------+ +---------+ +---------+ +---------+
+// | xapp | | submgr | | e2term | | rtmgr |
+// +-------+ +---------+ +---------+ +---------+
+// | | | |
+// | RESTSubReq | | |
+// |---------------->| | |
+// | | RouteCreate | |
+// | |--------------------------->| // The order of these events may vary
+// | | | |
+// | RESTSubResp | | | // The order of these events may vary
+// |<----------------| | |
+// | | RouteResponse| |
+// | |<---------------------------| // The order of these events may vary
+// | | | |
+// | | SubReq | |
+// | |------------->| | // The order of these events may vary
+// | | | |
+// | | SubResp | |
+// | |<-------------| |
+// | RESTNotif1 | | |
+// |<----------------| | |
+// | | | |
+// | RESTSubDelReq | | |
+// |---------------->| | |
+// | | | |
+// | RESTSubDelResp| | |
+// |<----------------| | |
+// | | | |
+// | | | |
+//
+//-----------------------------------------------------------------------------
+func TestRESTSubReqAndE1apDeleteReqPackingError(t *testing.T) {
+
+ restSubId, e2SubsId := createSubscription(t, xappConn1, e2termConn1, nil)
+
+ e2ap_wrapper.AllowE2apToProcess(e2ap_wrapper.SUB_DEL_REQ, false)
+ xappConn1.SendRESTSubsDelReq(t, &restSubId)
+ defer e2ap_wrapper.AllowE2apToProcess(e2ap_wrapper.SUB_DEL_REQ, true)
+
+ waitSubsCleanup(t, e2SubsId, 10)
+}
+
+//-----------------------------------------------------------------------------
+// TestRESTSubReqAndE1apDeleteRespUnpackingError
+//
+// stub stub stub
+// +-------+ +---------+ +---------+ +---------+
+// | xapp | | submgr | | e2term | | rtmgr |
+// +-------+ +---------+ +---------+ +---------+
+// | | | |
+// | RESTSubReq | | |
+// |---------------->| | |
+// | | RouteCreate | |
+// | |--------------------------->| // The order of these events may vary
+// | | | |
+// | RESTSubResp | | | // The order of these events may vary
+// |<----------------| | |
+// | | RouteResponse| |
+// | |<---------------------------| // The order of these events may vary
+// | | | |
+// | | SubReq | |
+// | |------------->| | // The order of these events may vary
+// | | | |
+// | | SubResp | |
+// | |<-------------| |
+// | RESTNotif1 | | |
+// |<----------------| | |
+// | | | |
+// | RESTSubDelReq | | |
+// |---------------->| | |
+// | | SubDelReq | |
+// | |------------->| |
+// | | | |
+// | RESTSubDelResp| | |
+// |<----------------| | | // The order of these events may vary
+// | | | |
+// | | SubDelResp | |
+// | |<-------------| | // 1.st NOK
+// | | | |
+// | | SubDelReq | |
+// | |------------->| |
+// | | | |
+// | | SubDelResp | |
+// | |<-------------| | // 2.nd NOK
+//
+//-----------------------------------------------------------------------------
+
+func TestRESTSubReqAndE1apDeleteRespUnpackingError(t *testing.T) {
+
+ restSubId, e2SubsId := createSubscription(t, xappConn1, e2termConn1, nil)
+
+ xappConn1.SendRESTSubsDelReq(t, &restSubId)
+ e2ap_wrapper.AllowE2apToProcess(e2ap_wrapper.SUB_DEL_RESP, false)
+ delreq, delmsg := e2termConn1.RecvSubsDelReq(t)
+ e2termConn1.SendSubsDelResp(t, delreq, delmsg)
+
+ delreq, delmsg = e2termConn1.RecvSubsDelReq(t)
+ e2termConn1.SendSubsDelResp(t, delreq, delmsg)
+
+ defer e2ap_wrapper.AllowE2apToProcess(e2ap_wrapper.SUB_DEL_RESP, true)
+
+ waitSubsCleanup(t, e2SubsId, 10)
+}
+