replace gerrit.o-ran-sc.org/r/ric-plt/sdlgo => gerrit.o-ran-sc.org/r/ric-plt/sdlgo.git v0.5.2
-replace gerrit.o-ran-sc.org/r/ric-plt/xapp-frame => gerrit.o-ran-sc.org/r/ric-plt/xapp-frame.git v0.7.3-1
+replace gerrit.o-ran-sc.org/r/ric-plt/xapp-frame => gerrit.o-ran-sc.org/r/ric-plt/xapp-frame.git v0.8.2
replace gerrit.o-ran-sc.org/r/com/golog => gerrit.o-ran-sc.org/r/com/golog.git v0.0.2
meidar += meid + " "
}
str = "mme_ar|" + e2tData.E2taddress + "|" + strings.TrimSuffix(meidar, " ")
- *meids = append(*meids, str)
+ *meids = append(*meids, str)
}
e2ts[e2tinst.Fqdn] = e2tinst
}
- xapp.Logger.Info("MEID's retrieved are %v", *meids)
+ xapp.Logger.Info("MEID's retrieved are %v", *meids)
}
func retrieveStartupData(xmurl string, nbiif string, fileName string, configfile string, e2murl string, sdlEngine sdl.Engine) error {
var subdata models.XappSubscriptionData
id := int32(sub_row.SubscriptionID)
subdata.SubscriptionID = &id
- for _, ep := range sub_row.Endpoint {
-
+ for _, ep := range sub_row.ClientEndpoint {
stringSlice := strings.Split(ep, ":")
subdata.Address = &stringSlice[0]
intportval, _ := strconv.Atoi(stringSlice[1])
type Consumer struct{}
-
func (m Consumer) Consume(params *xapp.RMRParams) (err error) {
xapp.Sdl.Store("myKey", params.Payload)
return nil
func TestValidateXappSubscriptionsData(t *testing.T) {
- rtmgr.RMRConnStatus = make(map[string]bool)
+ rtmgr.RMRConnStatus = make(map[string]bool)
ep := make(map[string]*rtmgr.Endpoint)
ep["dummy"] = &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}
p := uint16(1234)
}
func TestValidateE2tDataDNSLookUPfails(t *testing.T) {
- rtmgr.RMRConnStatus = make(map[string]bool)
+ rtmgr.RMRConnStatus = make(map[string]bool)
data := models.E2tData{
E2TAddress: swag.String("e2t.1com:1234"),
}
}
func TestValidateE2tDataInvalid(t *testing.T) {
- rtmgr.RMRConnStatus = make(map[string]bool)
+ rtmgr.RMRConnStatus = make(map[string]bool)
data := models.E2tData{
E2TAddress: swag.String("10.101.01.1"),
}
}
func TestValidateE2tDatavalid(t *testing.T) {
- rtmgr.RMRConnStatus = make(map[string]bool)
+ rtmgr.RMRConnStatus = make(map[string]bool)
data := models.E2tData{
E2TAddress: swag.String("10.101.01.1:8098"),
}
}
func TestValidateE2tDatavalidEndpointPresent(t *testing.T) {
- rtmgr.RMRConnStatus = make(map[string]bool)
+ rtmgr.RMRConnStatus = make(map[string]bool)
data := models.E2tData{
E2TAddress: swag.String("10.101.01.1:8098"),
}
func TestValidateDeleteE2tData(t *testing.T) {
- rtmgr.RMRConnStatus = make(map[string]bool)
+ rtmgr.RMRConnStatus = make(map[string]bool)
// test-1
data := models.E2tDeleteData{
E2TAddress: swag.String(""),
func TestPopulateSubscription(t *testing.T) {
var sublist xfmodel.SubscriptionList
- subdata := xfmodel.SubscriptionData{Endpoint: []string{"xapp1.com:3800"}, SubscriptionID: -1, Meid: ""}
- subdata2 := xfmodel.SubscriptionData{Endpoint: []string{"xapp2.com:3800"}, SubscriptionID: 11, Meid: ""}
- subdata3 := xfmodel.SubscriptionData{Endpoint: []string{"xapp3.com:3800"}, SubscriptionID: 221, Meid: ""}
+ subdata := xfmodel.SubscriptionData{ClientEndpoint: []string{"xapp1.com:3800"}, SubscriptionID: -1, Meid: ""}
+ subdata2 := xfmodel.SubscriptionData{ClientEndpoint: []string{"xapp2.com:3800"}, SubscriptionID: 11, Meid: ""}
+ subdata3 := xfmodel.SubscriptionData{ClientEndpoint: []string{"xapp3.com:3800"}, SubscriptionID: 221, Meid: ""}
sublist = append(sublist, &subdata)
sublist = append(sublist, &subdata2)
sublist = append(sublist, &subdata3)
for _, value := range rcs.MeidMap {
if _, v := keys[key+value+"\n"]; !v {
rawrt = append(rawrt, key+value+"\n")
- appendedindex := uint16(len(rawrt)-1)
- keys[key+value+"\n"] = RouteIndex{true,appendedindex}
+ appendedindex := uint16(len(rawrt) - 1)
+ keys[key+value+"\n"] = RouteIndex{true, appendedindex}
count++
}
- if strings.Contains(value,"mme_ar") {
- tmpstr := strings.Split(value,"|")
-
- MEID := strings.TrimSuffix(tmpstr[2],"\n")
-
- mapindex := "mme_del|"+MEID+"\n"
- i := keys[mapindex].index
- if keys[mapindex].flag {
- copy(rawrt[i:], rawrt[i+1:])
- rawrt[len(rawrt)-1] = ""
- rawrt = rawrt[:len(rawrt)-1]
- delete(keys,mapindex)
- count--
- }
- }
+ if strings.Contains(value, "mme_ar") {
+ tmpstr := strings.Split(value, "|")
+
+ //MEID entry for mme_ar must always contain 3 strings speartred by | i.e "mme_ar|<string1>|<string2>"
+ MEID := strings.TrimSuffix(tmpstr[2], "\n")
+
+ mapindex := "mme_del|" + MEID + "\n"
+ i := keys[mapindex].index
+ if keys[mapindex].flag {
+ copy(rawrt[i:], rawrt[i+1:])
+ rawrt[len(rawrt)-1] = ""
+ rawrt = rawrt[:len(rawrt)-1]
+ delete(keys, mapindex)
+ count--
+ }
+ }
}
rawrt = append(rawrt, key+"meid_map|end|"+strconv.Itoa(count)+"\n")
var ValidEndPointsEmpty = rtmgr.Endpoints{}
var ValidRicComponents = rtmgr.RicComponents{
- XApps: *ValidXApps, Pcs: *ValidPlatformComponents, E2Ts: E2map, MeidMap: []string{"mme_ar|e2t.com:1234"},
+ XApps: *ValidXApps, Pcs: *ValidPlatformComponents, E2Ts: E2map, MeidMap: []string{"mme_ar|e2t.com:1234|gnbID1"},
}
var ValidPolicies = &[]string{"", ""}
var ValidEndpoints1 = []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{"", ""}, Policies: []int32{1, 2}, Socket: nil, IsReady: false, Keepalive: true},
- {Uuid: "127.0.0.1:0", Name: "UEMAN1", XAppType: "app4", Ip: "", Port: 0, TxMessages: []string{"", ""}, RxMessages: []string{"", ""}, Policies: []int32{1, 2}, Socket: nil, IsReady: false, Keepalive: true},
+ {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{"", ""}, Policies: []int32{1, 2}, Socket: nil, IsReady: false, Keepalive: true},
+ {Uuid: "127.0.0.1:0", Name: "UEMAN1", XAppType: "app4", Ip: "", Port: 0, TxMessages: []string{"", ""}, RxMessages: []string{"", ""}, Policies: []int32{1, 2}, Socket: nil, IsReady: false, Keepalive: true},
}
var ValidSubscriptions = &[]rtmgr.Subscription{
var XappSubscriptionData_port = uint16(0)
var XappSubscriptionData_subid = int32(1)
-var XappSubData = models.XappSubscriptionData {
- Address: swag.String("10.0.0.1"), Port: &XappSubscriptionData_port, SubscriptionID: &XappSubscriptionData_subid,
+var XappSubData = models.XappSubscriptionData{
+ Address: swag.String("10.0.0.1"), Port: &XappSubscriptionData_port, SubscriptionID: &XappSubscriptionData_subid,
}