+}
+
+//-----------------------------------------------------------------------------
+//
+//-----------------------------------------------------------------------------
+func handle_wait_subs_clean(t *testing.T, e2SubsId int) bool {
+ xapp.Logger.Info("handle_wait_subs_clean start")
+ if mainCtrl.wait_subs_clean(e2SubsId, 10) == false {
+ testError(t, "(general) no clean within 10 secs")
+ return false
+ }
+ return true
+}
+
+//-----------------------------------------------------------------------------
+// TestSubReqAndSubDelOk
+//
+// stub stub
+// +-------+ +---------+ +---------+
+// | xapp | | submgr | | e2term |
+// +-------+ +---------+ +---------+
+// | | |
+// | SubReq | |
+// |------------->| |
+// | | |
+// | | SubReq |
+// | |------------->|
+// | | |
+// | | SubResp |
+// | |<-------------|
+// | | |
+// | SubResp | |
+// |<-------------| |
+// | | |
+// | | |
+// | SubDelReq | |
+// |------------->| |
+// | | |
+// | | SubDelReq |
+// | |------------->|
+// | | |
+// | | SubDelResp |
+// | |<-------------|
+// | | |
+// | SubDelResp | |
+// |<-------------| |
+//
+//-----------------------------------------------------------------------------
+func TestSubReqAndSubDelOk(t *testing.T) {
+ xapp.Logger.Info("TestSubReqAndSubDelOk start")
+
+ handle_xapp_subs_req(t)
+ handle_e2term_subs_reqandresp(t)
+ e2SubsId := handle_xapp_subs_resp(t)
+
+ handle_xapp_subs_del_req(t, e2SubsId)
+ handle_e2term_subs_del_reqandresp(t)
+ handle_xapp_subs_del_resp(t)
+
+ //Wait that subs is cleaned
+ handle_wait_subs_clean(t, e2SubsId)
+}
+
+//-----------------------------------------------------------------------------
+// TestSubReqRetransmission
+//
+// stub stub
+// +-------+ +---------+ +---------+
+// | xapp | | submgr | | e2term |
+// +-------+ +---------+ +---------+
+// | | |
+// | SubReq | |
+// |------------->| |
+// | | |
+// | | SubReq |
+// | |------------->|
+// | | |
+// | SubReq | |
+// | (retrans) | |
+// |------------->| |
+// | | |
+// | | SubResp |
+// | |<-------------|
+// | | |
+// | SubResp | |
+// |<-------------| |
+// | | |
+// | [SUBS DELETE] |
+// | | |
+//
+//-----------------------------------------------------------------------------
+func TestSubReqRetransmission(t *testing.T) {
+ xapp.Logger.Info("TestSubReqRetransmission start")
+
+ //Subs Create
+ handle_xapp_subs_req(t)
+ req, msg := handle_e2term_subs_req(t)
+ handle_xapp_subs_req(t)
+
+ handle_e2term_subs_resp(t, req, msg)
+
+ e2SubsId := handle_xapp_subs_resp(t)
+
+ //Subs Delete
+ handle_xapp_subs_del_req(t, e2SubsId)
+ handle_e2term_subs_del_reqandresp(t)
+ handle_xapp_subs_del_resp(t)
+
+ //Wait that subs is cleaned
+ handle_wait_subs_clean(t, e2SubsId)
+}
+
+//-----------------------------------------------------------------------------
+// TestSubDelReqRetransmission
+//
+// stub stub
+// +-------+ +---------+ +---------+
+// | xapp | | submgr | | e2term |
+// +-------+ +---------+ +---------+
+// | | |
+// | [SUBS CREATE] |
+// | | |
+// | | |
+// | SubDelReq | |
+// |------------->| |
+// | | |
+// | | SubDelReq |
+// | |------------->|
+// | | |
+// | SubDelReq | |
+// |------------->| |
+// | | |
+// | | SubDelResp |
+// | |<-------------|
+// | | |
+// | SubDelResp | |
+// |<-------------| |
+//
+//-----------------------------------------------------------------------------
+func TestSubDelReqRetransmission(t *testing.T) {
+ xapp.Logger.Info("TestSubDelReqRetransmission start")
+
+ //Subs Create
+ handle_xapp_subs_req(t)
+ handle_e2term_subs_reqandresp(t)
+ e2SubsId := handle_xapp_subs_resp(t)
+
+ //Subs Delete
+ handle_xapp_subs_del_req(t, e2SubsId)
+ req, msg := handle_e2term_subs_del_req(t)
+
+ <-time.After(2 * time.Second)
+
+ handle_xapp_subs_del_req(t, e2SubsId)
+
+ handle_e2term_subs_del_resp(t, req, msg)