Adding Unit Test cases for rtmgr
[ric-plt/rtmgr.git] / pkg / stub / stub.go
index f57f70e..40df44a 100644 (file)
@@ -34,7 +34,7 @@ var ValidXApps = &[]rtmgr.XApp{
        {Name: "app1", Status: "", Version: "", Instances: []rtmgr.XAppInstance{{Name: "E2TERM", Status: "unknown", Ip: "10.0.0.1", Port: 0, TxMessages: []string{"HandoverPreparation", "HandoverCancel"}, RxMessages: []string{"HandoverPreparation", "HandoverCancel"}}}},
        {Name: "app2", Status: "", Version: "", Instances: []rtmgr.XAppInstance{{Name: "SUBMAN", Status: "unknown", Ip: "192.168.0.1", Port: 0, TxMessages: []string{"HandoverCancel", "HandoverPreparation"}, RxMessages: []string{"HandoverPreparation", "HandoverCancel"}}}},
        {Name: "app3", Status: "", Version: "", Instances: []rtmgr.XAppInstance{{Name: "E2MAN", Status: "unknown", Ip: "10.1.1.1", Port: 0, TxMessages: []string{"X2Setup"}, RxMessages: []string{"Reset", "UEContextRelease"}}}},
-       {Name: "app4", Status: "", Version: "", Instances: []rtmgr.XAppInstance{{Name: "UEMAN", Status: "unknown", Ip: "10.2.2.1", Port: 0, TxMessages: []string{"Reset", "UEContextRelease"}, RxMessages: []string{"", ""}}}},
+       {Name: "app4", Status: "", Version: "", Instances: []rtmgr.XAppInstance{{Name: "UEMAN", Status: "unknown", Ip: "10.2.2.1", Port: 0, TxMessages: []string{"Reset", "UEContextRelease"}, RxMessages: []string{"", ""}, Policies: []int32{1, 2}}}},
 }
 
 var ValidPlatformComponents = &rtmgr.PlatformComponents{
@@ -46,13 +46,29 @@ var ValidPlatformComponents = &rtmgr.PlatformComponents{
 
 var ValidEndpoints = []rtmgr.Endpoint{
        {Uuid: "10.0.0.1:0", Name: "E2TERM", XAppType: "app1", Ip: "", Port: 0, TxMessages: []string{"", ""}, RxMessages: []string{"", ""}, Socket: nil, IsReady: true, Keepalive: true},
+       {Uuid: "10.0.0.2:0", Name: "E2TERMINST", XAppType: "app2", Ip: "", Port: 0, TxMessages: []string{"", ""}, RxMessages: []string{"", ""}, Socket: nil, IsReady: true, Keepalive: true},
        {Uuid: "192.168.0.1:0", Name: "SUBMAN", XAppType: "app2", Ip: "", Port: 0, TxMessages: []string{"", ""}, RxMessages: []string{"", ""}, Socket: nil, IsReady: false, Keepalive: false},
        {Uuid: "10.1.1.1:0", Name: "E2MAN", XAppType: "app3", Ip: "", Port: 0, TxMessages: []string{"", ""}, RxMessages: []string{"", ""}, Socket: nil, IsReady: true, Keepalive: false},
-       {Uuid: "10.2.2.1:0", Name: "UEMAN", XAppType: "app4", Ip: "", Port: 0, TxMessages: []string{"", ""}, RxMessages: []string{"", ""}, Socket: nil, IsReady: false, Keepalive: true},
+       {Uuid: "10.2.2.1:0", Name: "UEMAN", XAppType: "app4", Ip: "", Port: 0, TxMessages: []string{"", ""}, RxMessages: []string{"", ""}, Policies: []int32{1, 2}, Socket: nil, IsReady: false, Keepalive: true},
 }
 
+var ValidE2TInstance = rtmgr.E2TInstance{
+       Name:    "E2Tinstance1",
+       Fqdn:    "10.10.10.10:100",
+       Ranlist: []string{"1", "2"},
+}
+
+var E2map = make(map[string]rtmgr.E2TInstance)
+
 var ValidRicComponents = rtmgr.RicComponents{
-       XApps: *ValidXApps, Pcs: *ValidPlatformComponents,
+       XApps: *ValidXApps, Pcs: *ValidPlatformComponents, E2Ts: E2map,
 }
 
 var ValidPolicies = &[]string{"", ""}
+
+var ValidSubscriptions = &[]rtmgr.Subscription{
+       {SubID: 1234, Fqdn: "10.0.0.1", Port: 0},
+       {SubID: 1235, Fqdn: "192.168.0.1", Port: 0},
+       {SubID: 1236, Fqdn: "10.1.1.1", Port: 0},
+       {SubID: 1237, Fqdn: "10.2.2.1", Port: 0},
+}