//---------------------------------
select {
case msg := <-xappConn.rmrConChan:
+ xappConn.DecMsgCnt()
if msg.Mtype != xapp.RICMessageTypes["RIC_SUB_RESP"] {
testError(t, "(%s) Received RIC_SUB_RESP wrong mtype expected %s got %s, error", xappConn.desc, "RIC_SUB_RESP", xapp.RicMessageTypeToName[msg.Mtype])
return -1
//-------------------------------
select {
case msg := <-xappConn.rmrConChan:
+ xappConn.DecMsgCnt()
if msg.Mtype != xapp.RICMessageTypes["RIC_SUB_FAILURE"] {
testError(t, "(%s) Received RIC_SUB_FAILURE wrong mtype expected %s got %s, error", xappConn.desc, "RIC_SUB_FAILURE", xapp.RicMessageTypeToName[msg.Mtype])
return -1
//---------------------------------
select {
case msg := <-xappConn.rmrConChan:
+ xappConn.DecMsgCnt()
if msg.Mtype != xapp.RICMessageTypes["RIC_SUB_DEL_RESP"] {
testError(t, "(%s) Received RIC_SUB_DEL_RESP wrong mtype expected %s got %s, error", xappConn.desc, "RIC_SUB_DEL_RESP", xapp.RicMessageTypeToName[msg.Mtype])
return
//---------------------------------
select {
case msg := <-e2termConn.rmrConChan:
+ e2termConn.DecMsgCnt()
if msg.Mtype != xapp.RICMessageTypes["RIC_SUB_REQ"] {
testError(t, "(%s) Received wrong mtype expected %s got %s, error", e2termConn.desc, "RIC_SUB_REQ", xapp.RicMessageTypeToName[msg.Mtype])
} else {
params := &RMRParams{&xapp.RMRParams{}}
params.Mtype = xapp.RIC_SUB_RESP
- params.SubId = msg.SubId
+ //params.SubId = msg.SubId
+ params.SubId = -1
params.Payload = packedMsg.Buf
params.Meid = msg.Meid
- params.Xid = msg.Xid
+ //params.Xid = msg.Xid
params.Mbuf = nil
snderr := e2termConn.RmrSend(params)
//---------------------------------
select {
case msg := <-e2termConn.rmrConChan:
+ e2termConn.DecMsgCnt()
if msg.Mtype != xapp.RICMessageTypes["RIC_SUB_DEL_REQ"] {
testError(t, "(%s) Received wrong mtype expected %s got %s, error", e2termConn.desc, "RIC_SUB_DEL_REQ", xapp.RicMessageTypeToName[msg.Mtype])
} else {
//
//-----------------------------------------------------------------------------
func (mc *testingMainControl) wait_subs_clean(t *testing.T, e2SubsId int, secs int) bool {
+ var subs *Subscription
i := 1
for ; i <= secs*2; i++ {
- if mc.c.registry.GetSubscription(uint16(e2SubsId)) == nil {
+ subs = mc.c.registry.GetSubscription(uint16(e2SubsId))
+ if subs == nil {
return true
}
time.Sleep(500 * time.Millisecond)
}
- testError(t, "(general) no clean within %d secs", secs)
+ if subs != nil {
+ testError(t, "(general) no clean within %d secs: %s", secs, subs.String())
+ } else {
+ testError(t, "(general) no clean within %d secs: subs(N/A)", secs)
+ }
return false
}
func (mc *testingMainControl) wait_subs_trans_clean(t *testing.T, e2SubsId int, secs int) bool {
+ var trans *Transaction
i := 1
for ; i <= secs*2; i++ {
subs := mc.c.registry.GetSubscription(uint16(e2SubsId))
if subs == nil {
return true
}
- trans := subs.GetTransaction()
+ trans = subs.GetTransaction()
if trans == nil {
return true
}
time.Sleep(500 * time.Millisecond)
}
- testError(t, "(general) no clean within %d secs", secs)
+ if trans != nil {
+ testError(t, "(general) no clean within %d secs: %s", secs, trans.String())
+ } else {
+ testError(t, "(general) no clean within %d secs: trans(N/A)", secs)
+ }
return false
}
//Wait that subs is cleaned
mainCtrl.wait_subs_clean(t, int(newSubsId), 10)
+
+ xappConn1.TestMsgCnt(t)
+ xappConn2.TestMsgCnt(t)
+ e2termConn.TestMsgCnt(t)
}
//-----------------------------------------------------------------------------
//Wait that subs is cleaned
mainCtrl.wait_subs_clean(t, e2SubsId, 10)
+
+ xappConn1.TestMsgCnt(t)
+ xappConn2.TestMsgCnt(t)
+ e2termConn.TestMsgCnt(t)
}
//-----------------------------------------------------------------------------
//Wait that subs is cleaned
mainCtrl.wait_subs_clean(t, e2SubsId, 10)
+
+ xappConn1.TestMsgCnt(t)
+ xappConn2.TestMsgCnt(t)
+ e2termConn.TestMsgCnt(t)
}
//-----------------------------------------------------------------------------
//Wait that subs is cleaned
mainCtrl.wait_subs_clean(t, e2SubsId, 10)
+
+ xappConn1.TestMsgCnt(t)
+ xappConn2.TestMsgCnt(t)
+ e2termConn.TestMsgCnt(t)
}
//-----------------------------------------------------------------------------
//Wait that subs is cleaned
mainCtrl.wait_subs_clean(t, e2SubsId, 10)
+
+ xappConn1.TestMsgCnt(t)
+ xappConn2.TestMsgCnt(t)
+ e2termConn.TestMsgCnt(t)
}
//-----------------------------------------------------------------------------
xappConn2.handle_xapp_subs_del_resp(t, deltrans2)
//Wait that subs is cleaned
mainCtrl.wait_subs_clean(t, e2SubsId2, 10)
+
+ xappConn1.TestMsgCnt(t)
+ xappConn2.TestMsgCnt(t)
+ e2termConn.TestMsgCnt(t)
}
//-----------------------------------------------------------------------------
xappConn1.handle_xapp_subs_del_resp(t, deltrans2)
//Wait that subs is cleaned
mainCtrl.wait_subs_clean(t, e2SubsId2, 10)
+
+ xappConn1.TestMsgCnt(t)
+ xappConn2.TestMsgCnt(t)
+ e2termConn.TestMsgCnt(t)
}
//-----------------------------------------------------------------------------
// Wait that subs is cleaned
mainCtrl.wait_subs_clean(t, e2SubsId, 10)
+
+ xappConn1.TestMsgCnt(t)
+ xappConn2.TestMsgCnt(t)
+ e2termConn.TestMsgCnt(t)
}
//-----------------------------------------------------------------------------
// Wait that subs is cleaned
mainCtrl.wait_subs_clean(t, int(delreq.RequestId.Seq), 10)
+
+ xappConn1.TestMsgCnt(t)
+ xappConn2.TestMsgCnt(t)
+ e2termConn.TestMsgCnt(t)
}
//-----------------------------------------------------------------------------
delreq, _ := e2termConn.handle_e2term_subs_del_req(t)
// Wait that subs is cleaned
- mainCtrl.wait_subs_clean(t, int(delreq.RequestId.Seq), 10)
+ mainCtrl.wait_subs_clean(t, int(delreq.RequestId.Seq), 15)
+
+ xappConn1.TestMsgCnt(t)
+ xappConn2.TestMsgCnt(t)
+ e2termConn.TestMsgCnt(t)
}
//-----------------------------------------------------------------------------
// Wait that subs is cleaned
mainCtrl.wait_subs_clean(t, e2SubsId, 10)
+
+ xappConn1.TestMsgCnt(t)
+ xappConn2.TestMsgCnt(t)
+ e2termConn.TestMsgCnt(t)
}
//-----------------------------------------------------------------------------
// Wait that subs is cleaned
mainCtrl.wait_subs_clean(t, e2SubsId, 10)
+
+ xappConn1.TestMsgCnt(t)
+ xappConn2.TestMsgCnt(t)
+ e2termConn.TestMsgCnt(t)
}
//-----------------------------------------------------------------------------
// Wait that subs is cleaned
mainCtrl.wait_subs_clean(t, e2SubsId, 10)
+
+ xappConn1.TestMsgCnt(t)
+ xappConn2.TestMsgCnt(t)
+ e2termConn.TestMsgCnt(t)
}
//-----------------------------------------------------------------------------
// Wait that subs is cleaned
mainCtrl.wait_subs_clean(t, e2SubsId, 10)
+
+ xappConn1.TestMsgCnt(t)
+ xappConn2.TestMsgCnt(t)
+ e2termConn.TestMsgCnt(t)
}