Xapp-frame updated to v0.8.1.
[ric-plt/submgr.git] / pkg / control / ut_messaging_test.go
index f4c7159..ff07a91 100644 (file)
@@ -129,7 +129,7 @@ func TestSubReqAndRouteUpdateNok(t *testing.T) {
        resp, _ := xapp.Subscription.QuerySubscriptions()
        assert.Equal(t, resp[0].SubscriptionID, int64(e2SubsId))
        assert.Equal(t, resp[0].Meid, "RAN_NAME_1")
-       assert.Equal(t, resp[0].Endpoint, []string{"localhost:13560"})
+       assert.Equal(t, resp[0].ClientEndpoint, []string{"localhost:13560"})
 
        waiter := rtmgrHttp.AllocNextEvent(false)
        newSubsId := mainCtrl.get_registry_next_subid(t)
@@ -205,7 +205,7 @@ func TestSubDelReqAndRouteDeleteNok(t *testing.T) {
        resp, _ := xapp.Subscription.QuerySubscriptions()
        assert.Equal(t, resp[0].SubscriptionID, int64(e2SubsId))
        assert.Equal(t, resp[0].Meid, "RAN_NAME_1")
-       assert.Equal(t, resp[0].Endpoint, []string{"localhost:13560"})
+       assert.Equal(t, resp[0].ClientEndpoint, []string{"localhost:13560"})
 
        deltrans := xappConn1.SendSubsDelReq(t, nil, e2SubsId)
        delreq, delmsg := e2termConn1.RecvSubsDelReq(t)
@@ -310,7 +310,7 @@ func TestSubMergeDelAndRouteUpdateNok(t *testing.T) {
        resp, _ := xapp.Subscription.QuerySubscriptions()
        assert.Equal(t, resp[0].SubscriptionID, int64(e2SubsId1))
        assert.Equal(t, resp[0].Meid, "RAN_NAME_1")
-       assert.Equal(t, resp[0].Endpoint, []string{"localhost:13560", "localhost:13660"})
+       assert.Equal(t, resp[0].ClientEndpoint, []string{"localhost:13560", "localhost:13660"})
 
        //Del1
        waiter := rtmgrHttp.AllocNextEvent(false)
@@ -394,7 +394,7 @@ func TestSubReqAndSubDelOk(t *testing.T) {
        resp, _ := xapp.Subscription.QuerySubscriptions()
        assert.Equal(t, resp[0].SubscriptionID, int64(e2SubsId))
        assert.Equal(t, resp[0].Meid, "RAN_NAME_1")
-       assert.Equal(t, resp[0].Endpoint, []string{"localhost:13560"})
+       assert.Equal(t, resp[0].ClientEndpoint, []string{"localhost:13560"})
 
        deltrans := xappConn1.SendSubsDelReq(t, nil, e2SubsId)
        delreq, delmsg := e2termConn1.RecvSubsDelReq(t)
@@ -1003,12 +1003,6 @@ func TestSubReqTwoRetriesNoRespAtAllInSubmgr(t *testing.T) {
 //     |              |      SubFail |
 //     |              |<-------------|
 //     |              |              |
-//     |              | SubDelReq    |
-//     |              |------------->|
-//     |              |              |
-//     |              |   SubDelResp |
-//     |              |<-------------|
-//     |              |              |
 //     |      SubFail |              |
 //     |<-------------|              |
 //     |              |              |
@@ -1022,8 +1016,6 @@ func TestSubReqSubFailRespInSubmgr(t *testing.T) {
                Counter{cSubReqFromXapp, 1},
                Counter{cSubReqToE2, 1},
                Counter{cSubFailFromE2, 1},
-               Counter{cSubDelReqToE2, 1},
-               Counter{cSubDelRespFromE2, 1},
                Counter{cSubFailToXapp, 1},
        })
 
@@ -1036,10 +1028,6 @@ func TestSubReqSubFailRespInSubmgr(t *testing.T) {
        fparams1.Set(crereq1)
        e2termConn1.SendSubsFail(t, fparams1, cremsg1)
 
-       // E2t: Receive SubsDelReq and send SubsDelResp (internal first)
-       delreq1, delmsg1 := e2termConn1.RecvSubsDelReq(t)
-       e2termConn1.SendSubsDelResp(t, delreq1, delmsg1)
-
        // Xapp: Receive SubsFail
        e2SubsId := xappConn1.RecvSubsFail(t, cretrans)
 
@@ -1321,7 +1309,7 @@ func TestSubReqAndSubDelOkSameAction(t *testing.T) {
        resp, _ := xapp.Subscription.QuerySubscriptions()
        assert.Equal(t, resp[0].SubscriptionID, int64(e2SubsId1))
        assert.Equal(t, resp[0].Meid, "RAN_NAME_1")
-       assert.Equal(t, resp[0].Endpoint, []string{"localhost:13560", "localhost:13660"})
+       assert.Equal(t, resp[0].ClientEndpoint, []string{"localhost:13560", "localhost:13660"})
 
        //Del1
        deltrans1 := xappConn1.SendSubsDelReq(t, nil, e2SubsId1)
@@ -1451,11 +1439,6 @@ func TestSubReqAndSubDelOkSameActionParallel(t *testing.T) {
 //     |             |              |    SubFail1  |
 //     |             |              |<-------------|
 //     |             |              |              |
-//     |             |              | SubDelReq    |
-//     |             |              |------------->|
-//     |             |              |   SubDelResp |
-//     |             |              |<-------------|
-//     |             |              |              |
 //     |             |    SubFail1  |              |
 //     |             |<-------------|              |
 //     |             |              |              |
@@ -1486,10 +1469,6 @@ func TestSubReqAndSubDelNokSameActionParallel(t *testing.T) {
        fparams1.Set(crereq1)
        e2termConn1.SendSubsFail(t, fparams1, cremsg1)
 
-       // E2t: internal delete
-       delreq, delmsg := e2termConn1.RecvSubsDelReq(t)
-       e2termConn1.SendSubsDelResp(t, delreq, delmsg)
-
        //Fail1
        e2SubsId1 := xappConn1.RecvSubsFail(t, cretrans1)
        //Fail2
@@ -1957,7 +1936,7 @@ func TestSubReqNokAndSubDelOkWithRestartInMiddle(t *testing.T) {
 
        resp, _ := xapp.Subscription.QuerySubscriptions()
        assert.Equal(t, resp[0].Meid, "RAN_NAME_1")
-       assert.Equal(t, resp[0].Endpoint, []string{"localhost:13560"})
+       assert.Equal(t, resp[0].ClientEndpoint, []string{"localhost:13560"})
        e2SubsId := uint32(resp[0].SubscriptionID)
        t.Logf("e2SubsId = %v", e2SubsId)
 
@@ -2024,7 +2003,7 @@ func TestSubReqAndSubDelOkWithRestartInMiddle(t *testing.T) {
        resp, _ := xapp.Subscription.QuerySubscriptions()
        assert.Equal(t, resp[0].SubscriptionID, int64(e2SubsId))
        assert.Equal(t, resp[0].Meid, "RAN_NAME_1")
-       assert.Equal(t, resp[0].Endpoint, []string{"localhost:13560"})
+       assert.Equal(t, resp[0].ClientEndpoint, []string{"localhost:13560"})
 
        mainCtrl.SimulateRestart(t)
 
@@ -2032,7 +2011,7 @@ func TestSubReqAndSubDelOkWithRestartInMiddle(t *testing.T) {
        resp, _ = xapp.Subscription.QuerySubscriptions()
        assert.Equal(t, resp[0].SubscriptionID, int64(e2SubsId))
        assert.Equal(t, resp[0].Meid, "RAN_NAME_1")
-       assert.Equal(t, resp[0].Endpoint, []string{"localhost:13560"})
+       assert.Equal(t, resp[0].ClientEndpoint, []string{"localhost:13560"})
 
        deltrans := xappConn1.SendSubsDelReq(t, nil, e2SubsId)
        delreq, delmsg := e2termConn1.RecvSubsDelReq(t)
@@ -2125,7 +2104,7 @@ func TestSubReqAndSubDelOkSameActionWithRestartsInMiddle(t *testing.T) {
        resp, _ := xapp.Subscription.QuerySubscriptions() ////////////////////////////////
        assert.Equal(t, resp[0].SubscriptionID, int64(e2SubsId1))
        assert.Equal(t, resp[0].Meid, "RAN_NAME_1")
-       assert.Equal(t, resp[0].Endpoint, []string{"localhost:13560", "localhost:13660"})
+       assert.Equal(t, resp[0].ClientEndpoint, []string{"localhost:13560", "localhost:13660"})
 
        mainCtrl.SimulateRestart(t)
 
@@ -2133,7 +2112,7 @@ func TestSubReqAndSubDelOkSameActionWithRestartsInMiddle(t *testing.T) {
        resp, _ = xapp.Subscription.QuerySubscriptions()
        assert.Equal(t, resp[0].SubscriptionID, int64(e2SubsId1))
        assert.Equal(t, resp[0].Meid, "RAN_NAME_1")
-       assert.Equal(t, resp[0].Endpoint, []string{"localhost:13560", "localhost:13660"})
+       assert.Equal(t, resp[0].ClientEndpoint, []string{"localhost:13560", "localhost:13660"})
 
        //Del1
        deltrans1 := xappConn1.SendSubsDelReq(t, nil, e2SubsId1)