X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=pkg%2Fcontrol%2Fmessaging_test.go;h=68118eac287e103c907da6e82fbdfce6666ce6b9;hb=31797b49985822f1d402501f16ab2794838bebba;hp=ed314231ae609f6687d020ad42356b5a52f03620;hpb=7e9c5e52615fef7cbc23de28505e1a7292cdf14f;p=ric-plt%2Fsubmgr.git diff --git a/pkg/control/messaging_test.go b/pkg/control/messaging_test.go index ed31423..68118ea 100644 --- a/pkg/control/messaging_test.go +++ b/pkg/control/messaging_test.go @@ -586,6 +586,41 @@ func (mc *testingMainControl) wait_msgcounter_change(t *testing.T, orig uint64, return 0, false } +//----------------------------------------------------------------------------- +// TestSubReqAndRouteNok +// +// stub stub +// +-------+ +---------+ +---------+ +// | xapp | | submgr | | rtmgr | +// +-------+ +---------+ +---------+ +// | | | +// | SubReq | | +// |------------->| | +// | | | +// | | RouteCreate | +// | |------------->| +// | | | +// | | RouteCreate | +// | | status:400 | +// | |<-------------| +// | | | +// | [SUBS INT DELETE] | +// | | | +// +//----------------------------------------------------------------------------- + +func TestSubReqAndRouteNok(t *testing.T) { + xapp.Logger.Info("TestSubReqAndRouteNok") + + waiter := rtmgrHttp.AllocNextEvent(false) + newSubsId := mainCtrl.get_subid(t) + xappConn1.handle_xapp_subs_req(t, nil) + waiter.WaitResult(t) + + //Wait that subs is cleaned + mainCtrl.wait_subs_clean(t, int(newSubsId), 10) +} + //----------------------------------------------------------------------------- // TestSubReqAndSubDelOk // @@ -623,15 +658,20 @@ func (mc *testingMainControl) wait_msgcounter_change(t *testing.T, orig uint64, func TestSubReqAndSubDelOk(t *testing.T) { xapp.Logger.Info("TestSubReqAndSubDelOk") + waiter := rtmgrHttp.AllocNextEvent(true) cretrans := xappConn1.handle_xapp_subs_req(t, nil) + waiter.WaitResult(t) + crereq, cremsg := e2termConn.handle_e2term_subs_req(t) e2termConn.handle_e2term_subs_resp(t, crereq, cremsg) e2SubsId := xappConn1.handle_xapp_subs_resp(t, cretrans) - deltrans := xappConn1.handle_xapp_subs_del_req(t, nil, e2SubsId) delreq, delmsg := e2termConn.handle_e2term_subs_del_req(t) + + waiter = rtmgrHttp.AllocNextEvent(true) e2termConn.handle_e2term_subs_del_resp(t, delreq, delmsg) xappConn1.handle_xapp_subs_del_resp(t, deltrans) + waiter.WaitResult(t) //Wait that subs is cleaned mainCtrl.wait_subs_clean(t, e2SubsId, 10)