Code Review
/
ric-plt
/
submgr.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Fix for E2 Connection status counters
[ric-plt/submgr.git]
/
pkg
/
control
/
ut_messaging_test.go
diff --git
a/pkg/control/ut_messaging_test.go
b/pkg/control/ut_messaging_test.go
index
10e10b7
..
79eccd2
100644
(file)
--- a/
pkg/control/ut_messaging_test.go
+++ b/
pkg/control/ut_messaging_test.go
@@
-46,6
+46,10
@@
func TestSuiteSetup(t *testing.T) {
}
func TestRanStatusChangeViaSDLNotification(t *testing.T) {
}
func TestRanStatusChangeViaSDLNotification(t *testing.T) {
+ mainCtrl.CounterValuesToBeVeriefied(t, CountersToBeAdded{
+ Counter{cE2StateChangedToUp, 3},
+ })
+
// Current UT test cases use these ran names
xappRnibMock.CreateGnb("RAN_NAME_1", entities.ConnectionStatus_DISCONNECTED)
xappRnibMock.CreateGnb("RAN_NAME_11", entities.ConnectionStatus_DISCONNECTED)
// Current UT test cases use these ran names
xappRnibMock.CreateGnb("RAN_NAME_1", entities.ConnectionStatus_DISCONNECTED)
xappRnibMock.CreateGnb("RAN_NAME_11", entities.ConnectionStatus_DISCONNECTED)
@@
-57,6
+61,8
@@
func TestRanStatusChangeViaSDLNotification(t *testing.T) {
mainCtrl.SetE2State(t, "RAN_NAME_1_CONNECTED")
mainCtrl.SetE2State(t, "RAN_NAME_2_CONNECTED")
mainCtrl.SetE2State(t, "RAN_NAME_11_CONNECTED")
mainCtrl.SetE2State(t, "RAN_NAME_1_CONNECTED")
mainCtrl.SetE2State(t, "RAN_NAME_2_CONNECTED")
mainCtrl.SetE2State(t, "RAN_NAME_11_CONNECTED")
+
+ mainCtrl.VerifyCounterValues(t)
}
//-----------------------------------------------------------------------------
}
//-----------------------------------------------------------------------------
@@
-83,6
+89,8
@@
func TestRESTSubReqAfterE2ConnBreak(t *testing.T) {
mainCtrl.CounterValuesToBeVeriefied(t, CountersToBeAdded{
Counter{cRestSubReqFromXapp, 1},
Counter{cRestReqRejDueE2Down, 1},
mainCtrl.CounterValuesToBeVeriefied(t, CountersToBeAdded{
Counter{cRestSubReqFromXapp, 1},
Counter{cRestReqRejDueE2Down, 1},
+ Counter{cE2StateChangedToDown, 1},
+ Counter{cE2StateChangedToUp, 1},
})
// E2 disconnect after E2term has received response
})
// E2 disconnect after E2term has received response
@@
-95,8
+103,8
@@
func TestRESTSubReqAfterE2ConnBreak(t *testing.T) {
// Restore E2 connection for following test cases
mainCtrl.SetE2State(t, "RAN_NAME_1_CONNECTED")
// Restore E2 connection for following test cases
mainCtrl.SetE2State(t, "RAN_NAME_1_CONNECTED")
- mainCtrl.VerifyCounterValues(t)
mainCtrl.VerifyAllClean(t)
mainCtrl.VerifyAllClean(t)
+ mainCtrl.VerifyCounterValues(t)
//os.Exit(0)
}
//os.Exit(0)
}
@@
-135,6
+143,8
@@
func TestRESTSubReqE2ConnBreak(t *testing.T) {
Counter{cSubReqToE2, 1},
Counter{cSubRespFromE2, 1},
Counter{cRestSubFailNotifToXapp, 1},
Counter{cSubReqToE2, 1},
Counter{cSubRespFromE2, 1},
Counter{cRestSubFailNotifToXapp, 1},
+ Counter{cE2StateChangedToDown, 1},
+ Counter{cE2StateChangedToUp, 1},
})
// Req
})
// Req
@@
-212,6
+222,8
@@
func TestRESTSubscriptionDeleteAfterE2ConnectionBreak(t *testing.T) {
Counter{cRestSubNotifToXapp, 1},
Counter{cRestSubDelReqFromXapp, 1},
Counter{cRestSubDelRespToXapp, 1},
Counter{cRestSubNotifToXapp, 1},
Counter{cRestSubDelReqFromXapp, 1},
Counter{cRestSubDelRespToXapp, 1},
+ Counter{cE2StateChangedToDown, 1},
+ Counter{cE2StateChangedToUp, 1},
})
// Req
})
// Req
@@
-289,6
+301,7
@@
func TestRESTOtherE2ConnectionChanges(t *testing.T) {
Counter{cSubDelReqToE2, 1},
Counter{cSubDelRespFromE2, 1},
Counter{cRestSubDelRespToXapp, 1},
Counter{cSubDelReqToE2, 1},
Counter{cSubDelRespFromE2, 1},
Counter{cRestSubDelRespToXapp, 1},
+ Counter{cE2StateChangedToUp, 1},
})
// Req
})
// Req
@@
-300,7
+313,7
@@
func TestRESTOtherE2ConnectionChanges(t *testing.T) {
e2termConn1.SendSubsResp(t, crereq, cremsg)
e2SubsId := xappConn1.WaitRESTNotification(t, restSubId)
e2termConn1.SendSubsResp(t, crereq, cremsg)
e2SubsId := xappConn1.WaitRESTNotification(t, restSubId)
- // Submgr should not react any other connection state changes than CONNECTED and DISCONNECTED
+ // Submgr should not react
to
any other connection state changes than CONNECTED and DISCONNECTED
mainCtrl.SetE2State(t, "RAN_NAME_1_CONNECTED_SETUP_FAILED")
mainCtrl.SetE2State(t, "RAN_NAME_1_CONNECTING")
mainCtrl.SetE2State(t, "RAN_NAME_1_SHUTTING_DOWN")
mainCtrl.SetE2State(t, "RAN_NAME_1_CONNECTED_SETUP_FAILED")
mainCtrl.SetE2State(t, "RAN_NAME_1_CONNECTING")
mainCtrl.SetE2State(t, "RAN_NAME_1_SHUTTING_DOWN")
@@
-5259,12
+5272,9
@@
func TestRESTSubReqAndSubDelOkSameActionWithRestartsInMiddle(t *testing.T) {
<-time.After(time.Second * 1)
// Delete subscription 1, and wait until it has removed the first endpoint
<-time.After(time.Second * 1)
// Delete subscription 1, and wait until it has removed the first endpoint
- subepcnt := mainCtrl.get_subs_entrypoint_cnt(t, e2SubsId1)
xappConn1.SendRESTSubsDelReq(t, &restSubId1)
xappConn1.SendRESTSubsDelReq(t, &restSubId1)
- mainCtrl.wait_subs_entrypoint_cnt_change(t, e2SubsId1, subepcnt, 10)
-
+ mainCtrl.WaitRESTSubscriptionDelete(restSubId1)
// Above wait does not work correctly anymore as this delay makes this test case work
// Above wait does not work correctly anymore as this delay makes this test case work
- //<-time.After(time.Second * 1)
mainCtrl.SimulateRestart(t)
xapp.Logger.Debug("mainCtrl.SimulateRestart done 2")
mainCtrl.SimulateRestart(t)
xapp.Logger.Debug("mainCtrl.SimulateRestart done 2")