X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=pkg%2Frpe%2Frmr_test.go;h=fe6135615ba07200e6459b96d98859c47b44ead7;hb=bce67475ab8f92b42841dba561fff27b7d239820;hp=bd42d0b6a28adcf876ad1cae6d8ddf6f20c3cb47;hpb=761934a3d9f7a1426d1e14e34fb9a4c16599a237;p=ric-plt%2Frtmgr.git diff --git a/pkg/rpe/rmr_test.go b/pkg/rpe/rmr_test.go index bd42d0b..fe61356 100644 --- a/pkg/rpe/rmr_test.go +++ b/pkg/rpe/rmr_test.go @@ -22,7 +22,7 @@ ================================================================================== */ /* - Mnemonic: nngpub_test.go + Mnemonic: rmrpub_test.go Abstract: Date: 25 April 2019 */ @@ -47,8 +47,40 @@ RmrPush.GeneratePolicies() method is tested for happy path case */ func TestRmrPushGeneratePolicies(t *testing.T) { var rmrpush = RmrPush{} - resetTestDataset(stub.ValidEndpoints) + var pcs rtmgr.RicComponents + resetTestDataset(stub.ValidEndpoints1) + stub.ValidPlatformComponents = nil + rtmgr.Subs = *stub.ValidSubscriptions + rtmgr.PrsCfg = stub.DummyRoutes + stub.E2map["E2instance1.com"] = stub.ValidE2TInstance + pcs = stub.ValidRicComponents - rawrt := rmrpush.GeneratePolicies(rtmgr.Eps) + rawrt := rmrpush.GeneratePolicies(rtmgr.Eps, &pcs) t.Log(rawrt) } + +/* +getEndpointByUuid: Pass empty and valid values +*/ +func TestRmrgetEndpointByUuid(t *testing.T) { + var ep *rtmgr.Endpoint + ep = getEndpointByUuid("") + t.Logf("getEndpointByUuid() return was correct, got: %v, want: %v.", ep, "") + ep = getEndpointByUuid("10.0.0.1:0") +} + +/* +GetRpe Instance with empty and valid values +*/ +func TestRmrGetRpe(t *testing.T) { + _, _ = GetRpe("") + _, _ = GetRpe("rmrpush") +} + +/* +generateRouteTable with empty Platform components +*/ +func TestGenerateRouteTableRmrGetRpe(t *testing.T) { + rpe := Rpe{} + _ = rpe.generateRouteTable(stub.ValidEndPointsEmpty) +}