db := sdlgo.NewDatabase()
sdl := sdlgo.NewSdlInstance("e2Manager", db)
defer sdl.Close()
- rnibDataService := services.NewRnibDataService(logger, config, reader.GetRNibReader(sdl), rNibWriter.GetRNibWriter(sdl))
+ rnibDataService := services.NewRnibDataService(logger, config, reader.GetRNibReader(sdl), rNibWriter.GetRNibWriter(sdl, config.RnibWriter))
var msgImpl *rmrCgo.Context
rmrMessenger := msgImpl.Init("tcp:"+strconv.Itoa(config.Rmr.Port), config.Rmr.MaxMsgSize, 0, logger)
rmrSender := rmrsender.NewRmrSender(logger, rmrMessenger)
routingManagerClient := clients.NewRoutingManagerClient(logger, config, clients.NewHttpClient())
ranListManager := managers.NewRanListManager(logger)
ranAlarmService := services.NewRanAlarmService(logger, config)
- ranConnectStatusChangeManager := managers.NewRanConnectStatusChangeManager(logger, rnibDataService,ranListManager, ranAlarmService)
+ ranConnectStatusChangeManager := managers.NewRanConnectStatusChangeManager(logger, rnibDataService, ranListManager, ranAlarmService)
e2tAssociationManager := managers.NewE2TAssociationManager(logger, rnibDataService, e2tInstancesManager, routingManagerClient, ranConnectStatusChangeManager)
e2tShutdownManager := managers.NewE2TShutdownManager(logger, config, rnibDataService, e2tInstancesManager, e2tAssociationManager, kubernetes, ranConnectStatusChangeManager)
e2tKeepAliveWorker := managers.NewE2TKeepAliveWorker(logger, rmrSender, e2tInstancesManager, e2tShutdownManager, config)
"strconv"
)
+type RnibWriterConfig struct {
+ StateChangeMessageChannel string
+ RanManipulationMessageChannel string
+}
+
type Configuration struct {
Logging struct {
LogLevel string
Mcc string
Mnc string
}
- StateChangeMessageChannel string
+ RnibWriter RnibWriterConfig
}
func ParseConfiguration() *Configuration {
config.KeepAliveDelayMs = viper.GetInt("KeepAliveDelayMs")
config.E2TInstanceDeletionTimeoutMs = viper.GetInt("e2tInstanceDeletionTimeoutMs")
config.populateGlobalRicIdConfig(viper.Sub("globalRicId"))
- config.StateChangeMessageChannel = viper.GetString("stateChangeMessageChannel")
+ config.populateRnibWriterConfig(viper.Sub("rnibWriter"))
return &config
}
c.RoutingManager.BaseUrl = rmConfig.GetString("baseUrl")
}
+func (c *Configuration) populateRnibWriterConfig(rnibWriterConfig *viper.Viper) {
+ if rnibWriterConfig == nil {
+ panic(fmt.Sprintf("#configuration.populateRnibWriterConfig - failed to populate Rnib Writer configuration: The entry 'rnibWriter' not found\n"))
+ }
+ c.RnibWriter.StateChangeMessageChannel = rnibWriterConfig.GetString("stateChangeMessageChannel")
+ c.RnibWriter.RanManipulationMessageChannel = rnibWriterConfig.GetString("ranManipulationMessageChannel")
+}
+
func (c *Configuration) populateGlobalRicIdConfig(globalRicIdConfig *viper.Viper) {
err := validateGlobalRicIdConfig(globalRicIdConfig)
if err != nil {
return err
}
-
return nil
}
func validateMcc(mcc string) error {
- if len(mcc) == 0{
+ if len(mcc) == 0 {
return errors.New("#configuration.validateMcc - mcc is missing or empty\n")
}
- if len(mcc) != 3{
+ if len(mcc) != 3 {
return errors.New("#configuration.validateMcc - mcc is not 3 digits\n")
}
mccInt, err := strconv.Atoi(mcc)
- if err != nil{
+ if err != nil {
return errors.New("#configuration.validateMcc - mcc is not a number\n")
}
func validateMnc(mnc string) error {
- if len(mnc) == 0{
+ if len(mnc) == 0 {
return errors.New("#configuration.validateMnc - mnc is missing or empty\n")
}
- if len(mnc) < 2 || len(mnc) >3 {
+ if len(mnc) < 2 || len(mnc) > 3 {
return errors.New("#configuration.validateMnc - mnc is not 2 or 3 digits\n")
}
mncAsInt, err := strconv.Atoi(mnc)
- if err != nil{
+ if err != nil {
return errors.New("#configuration.validateMnc - mnc is not a number\n")
}
return nil
}
-func validateRicId(ricId string) error{
+func validateRicId(ricId string) error {
- if len(ricId) == 0{
+ if len(ricId) == 0 {
return errors.New("#configuration.validateRicId - ricId is missing or empty\n")
}
return nil
}
-
func (c *Configuration) String() string {
return fmt.Sprintf("{logging.logLevel: %s, http.port: %d, rmr: { port: %d, maxMsgSize: %d}, routingManager.baseUrl: %s, "+
"notificationResponseBuffer: %d, bigRedButtonTimeoutSec: %d, maxRnibConnectionAttempts: %d, "+
"rnibRetryIntervalMs: %d, keepAliveResponseTimeoutMs: %d, keepAliveDelayMs: %d, e2tInstanceDeletionTimeoutMs: %d, "+
- "globalRicId: { ricId: %s, mcc: %s, mnc: %s}, StateChangeMessageChannel: %s",
+ "globalRicId: { ricId: %s, mcc: %s, mnc: %s}, rnibWriter: { stateChangeMessageChannel: %s, ranManipulationChannel: %s}",
c.Logging.LogLevel,
c.Http.Port,
c.Rmr.Port,
c.GlobalRicId.RicId,
c.GlobalRicId.Mcc,
c.GlobalRicId.Mnc,
- c.StateChangeMessageChannel,
+ c.RnibWriter.StateChangeMessageChannel,
+ c.RnibWriter.RanManipulationMessageChannel,
)
}
// This source code is part of the near-RT RIC (RAN Intelligent Controller)
// platform project (RICP).
-
package configuration
import (
assert.Equal(t, "AACCE", config.GlobalRicId.RicId)
assert.Equal(t, "310", config.GlobalRicId.Mcc)
assert.Equal(t, "411", config.GlobalRicId.Mnc)
- assert.Equal(t, "RAN_CONNECTION_STATUS_CHANGE", config.StateChangeMessageChannel)
+ assert.Equal(t, "RAN_CONNECTION_STATUS_CHANGE", config.RnibWriter.StateChangeMessageChannel)
+ assert.Equal(t, "RAN_MANIPULATION", config.RnibWriter.RanManipulationMessageChannel)
}
func TestStringer(t *testing.T) {
}
}()
yamlMap := map[string]interface{}{
- "logging": map[string]interface{}{"logLevel": "info"},
- "http": map[string]interface{}{"port": 3800},
- "routingManager": map[string]interface{}{"baseUrl": "http://localhost:8080/ric/v1/handles/"},
+ "logging": map[string]interface{}{"logLevel": "info"},
+ "http": map[string]interface{}{"port": 3800},
+ "routingManager": map[string]interface{}{"baseUrl": "http://localhost:8080/ric/v1/handles/"},
"globalRicId": map[string]interface{}{"plmnId": "131014", "ricNearRtId": "556670"},
}
buf, err := yaml.Marshal(yamlMap)
}
}()
yamlMap := map[string]interface{}{
- "rmr": map[string]interface{}{"port": 3801, "maxMsgSize": 4096},
- "http": map[string]interface{}{"port": 3800},
- "routingManager": map[string]interface{}{"baseUrl": "http://localhost:8080/ric/v1/handles/"},
+ "rmr": map[string]interface{}{"port": 3801, "maxMsgSize": 4096},
+ "http": map[string]interface{}{"port": 3800},
+ "routingManager": map[string]interface{}{"baseUrl": "http://localhost:8080/ric/v1/handles/"},
"globalRicId": map[string]interface{}{"plmnId": "131014", "ricNearRtId": "556670"},
}
buf, err := yaml.Marshal(yamlMap)
}
}()
yamlMap := map[string]interface{}{
- "rmr": map[string]interface{}{"port": 3801, "maxMsgSize": 4096},
- "logging": map[string]interface{}{"logLevel": "info"},
- "routingManager": map[string]interface{}{"baseUrl": "http://localhost:8080/ric/v1/handles/"},
+ "rmr": map[string]interface{}{"port": 3801, "maxMsgSize": 4096},
+ "logging": map[string]interface{}{"logLevel": "info"},
+ "routingManager": map[string]interface{}{"baseUrl": "http://localhost:8080/ric/v1/handles/"},
"globalRicId": map[string]interface{}{"plmnId": "131014", "ricNearRtId": "556670"},
}
buf, err := yaml.Marshal(yamlMap)
}
}()
yamlMap := map[string]interface{}{
- "rmr": map[string]interface{}{"port": 3801, "maxMsgSize": 4096},
- "logging": map[string]interface{}{"logLevel": "info"},
- "http": map[string]interface{}{"port": 3800},
- "globalRicId": map[string]interface{}{"mcc": 327, "mnc": 94, "ricId": "AACCE"},
+ "rmr": map[string]interface{}{"port": 3801, "maxMsgSize": 4096},
+ "logging": map[string]interface{}{"logLevel": "info"},
+ "http": map[string]interface{}{"port": 3800},
+ "globalRicId": map[string]interface{}{"mcc": 327, "mnc": 94, "ricId": "AACCE"},
}
buf, err := yaml.Marshal(yamlMap)
if err != nil {
}
}()
yamlMap := map[string]interface{}{
- "rmr": map[string]interface{}{"port": 3801, "maxMsgSize": 4096},
- "logging": map[string]interface{}{"logLevel": "info"},
- "http": map[string]interface{}{"port": 3800},
- "routingManager": map[string]interface{}{"baseUrl": "http://localhost:8080/ric/v1/handles/"},
+ "rmr": map[string]interface{}{"port": 3801, "maxMsgSize": 4096},
+ "logging": map[string]interface{}{"logLevel": "info"},
+ "http": map[string]interface{}{"port": 3800},
+ "routingManager": map[string]interface{}{"baseUrl": "http://localhost:8080/ric/v1/handles/"},
}
buf, err := yaml.Marshal(yamlMap)
if err != nil {
}
func TestEmptyRicIdFailure(t *testing.T) {
-configPath := "../resources/configuration.yaml"
-configPathTmp := "../resources/configuration.yaml_tmp"
-err := os.Rename(configPath, configPathTmp)
-if err != nil {
-t.Errorf("#TestEmptyRicIdFailure - failed to rename configuration file: %s\n", configPath)
-}
-defer func() {
-err = os.Rename(configPathTmp, configPath)
-if err != nil {
-t.Errorf("#TestEmptyRicIdFailure - failed to rename configuration file: %s\n", configPath)
-}
-}()
-yamlMap := map[string]interface{}{
-"rmr": map[string]interface{}{"port": 3801, "maxMsgSize": 4096},
-"logging": map[string]interface{}{"logLevel": "info"},
-"http": map[string]interface{}{"port": 3800},
-"globalRicId": map[string]interface{}{"mcc": "327", "mnc": "94", "ricId": ""},
-"routingManager": map[string]interface{}{"baseUrl": "http://localhost:8080/ric/v1/handles/"},
-}
-buf, err := yaml.Marshal(yamlMap)
-if err != nil {
-t.Errorf("#TestEmptyRicIdFailure - failed to marshal configuration map\n")
-}
-err = ioutil.WriteFile("../resources/configuration.yaml", buf, 0644)
-if err != nil {
-t.Errorf("#TestEmptyRicIdFailure - failed to write configuration file: %s\n", configPath)
-}
-assert.PanicsWithValue(t, "#configuration.validateRicId - ricId is missing or empty\n",
-func() { ParseConfiguration() })
+ configPath := "../resources/configuration.yaml"
+ configPathTmp := "../resources/configuration.yaml_tmp"
+ err := os.Rename(configPath, configPathTmp)
+ if err != nil {
+ t.Errorf("#TestEmptyRicIdFailure - failed to rename configuration file: %s\n", configPath)
+ }
+ defer func() {
+ err = os.Rename(configPathTmp, configPath)
+ if err != nil {
+ t.Errorf("#TestEmptyRicIdFailure - failed to rename configuration file: %s\n", configPath)
+ }
+ }()
+ yamlMap := map[string]interface{}{
+ "rmr": map[string]interface{}{"port": 3801, "maxMsgSize": 4096},
+ "logging": map[string]interface{}{"logLevel": "info"},
+ "http": map[string]interface{}{"port": 3800},
+ "globalRicId": map[string]interface{}{"mcc": "327", "mnc": "94", "ricId": ""},
+ "routingManager": map[string]interface{}{"baseUrl": "http://localhost:8080/ric/v1/handles/"},
+ }
+ buf, err := yaml.Marshal(yamlMap)
+ if err != nil {
+ t.Errorf("#TestEmptyRicIdFailure - failed to marshal configuration map\n")
+ }
+ err = ioutil.WriteFile("../resources/configuration.yaml", buf, 0644)
+ if err != nil {
+ t.Errorf("#TestEmptyRicIdFailure - failed to write configuration file: %s\n", configPath)
+ }
+ assert.PanicsWithValue(t, "#configuration.validateRicId - ricId is missing or empty\n",
+ func() { ParseConfiguration() })
}
func TestMissingRicIdFailure(t *testing.T) {
}
}()
yamlMap := map[string]interface{}{
- "rmr": map[string]interface{}{"port": 3801, "maxMsgSize": 4096},
- "logging": map[string]interface{}{"logLevel": "info"},
- "http": map[string]interface{}{"port": 3800},
+ "rmr": map[string]interface{}{"port": 3801, "maxMsgSize": 4096},
+ "logging": map[string]interface{}{"logLevel": "info"},
+ "http": map[string]interface{}{"port": 3800},
"globalRicId": map[string]interface{}{"mcc": "327", "mnc": "94"},
- "routingManager": map[string]interface{}{"baseUrl": "http://localhost:8080/ric/v1/handles/"},
+ "routingManager": map[string]interface{}{"baseUrl": "http://localhost:8080/ric/v1/handles/"},
}
buf, err := yaml.Marshal(yamlMap)
if err != nil {
}
}()
yamlMap := map[string]interface{}{
- "rmr": map[string]interface{}{"port": 3801, "maxMsgSize": 4096},
- "logging": map[string]interface{}{"logLevel": "info"},
- "http": map[string]interface{}{"port": 3800},
+ "rmr": map[string]interface{}{"port": 3801, "maxMsgSize": 4096},
+ "logging": map[string]interface{}{"logLevel": "info"},
+ "http": map[string]interface{}{"port": 3800},
"globalRicId": map[string]interface{}{"mcc": "327", "mnc": "94", "ricId": "TEST1"},
- "routingManager": map[string]interface{}{"baseUrl": "http://localhost:8080/ric/v1/handles/"},
+ "routingManager": map[string]interface{}{"baseUrl": "http://localhost:8080/ric/v1/handles/"},
}
buf, err := yaml.Marshal(yamlMap)
if err != nil {
}
}()
yamlMap := map[string]interface{}{
- "rmr": map[string]interface{}{"port": 3801, "maxMsgSize": 4096},
- "logging": map[string]interface{}{"logLevel": "info"},
- "http": map[string]interface{}{"port": 3800},
+ "rmr": map[string]interface{}{"port": 3801, "maxMsgSize": 4096},
+ "logging": map[string]interface{}{"logLevel": "info"},
+ "http": map[string]interface{}{"port": 3800},
"globalRicId": map[string]interface{}{"mcc": "327", "mnc": "94", "ricId": "AA43"},
- "routingManager": map[string]interface{}{"baseUrl": "http://localhost:8080/ric/v1/handles/"},
+ "routingManager": map[string]interface{}{"baseUrl": "http://localhost:8080/ric/v1/handles/"},
}
buf, err := yaml.Marshal(yamlMap)
if err != nil {
}
}()
yamlMap := map[string]interface{}{
- "rmr": map[string]interface{}{"port": 3801, "maxMsgSize": 4096},
- "logging": map[string]interface{}{"logLevel": "info"},
- "http": map[string]interface{}{"port": 3800},
+ "rmr": map[string]interface{}{"port": 3801, "maxMsgSize": 4096},
+ "logging": map[string]interface{}{"logLevel": "info"},
+ "http": map[string]interface{}{"port": 3800},
"globalRicId": map[string]interface{}{"mcc": "31", "mnc": "94", "ricId": "AA443"},
- "routingManager": map[string]interface{}{"baseUrl": "http://localhost:8080/ric/v1/handles/"},
+ "routingManager": map[string]interface{}{"baseUrl": "http://localhost:8080/ric/v1/handles/"},
}
buf, err := yaml.Marshal(yamlMap)
if err != nil {
}
}()
yamlMap := map[string]interface{}{
- "rmr": map[string]interface{}{"port": 3801, "maxMsgSize": 4096},
- "logging": map[string]interface{}{"logLevel": "info"},
- "http": map[string]interface{}{"port": 3800},
+ "rmr": map[string]interface{}{"port": 3801, "maxMsgSize": 4096},
+ "logging": map[string]interface{}{"logLevel": "info"},
+ "http": map[string]interface{}{"port": 3800},
"globalRicId": map[string]interface{}{"mcc": "310", "mnc": "6794", "ricId": "AA443"},
- "routingManager": map[string]interface{}{"baseUrl": "http://localhost:8080/ric/v1/handles/"},
+ "routingManager": map[string]interface{}{"baseUrl": "http://localhost:8080/ric/v1/handles/"},
}
buf, err := yaml.Marshal(yamlMap)
if err != nil {
}
}()
yamlMap := map[string]interface{}{
- "rmr": map[string]interface{}{"port": 3801, "maxMsgSize": 4096},
- "logging": map[string]interface{}{"logLevel": "info"},
- "http": map[string]interface{}{"port": 3800},
+ "rmr": map[string]interface{}{"port": 3801, "maxMsgSize": 4096},
+ "logging": map[string]interface{}{"logLevel": "info"},
+ "http": map[string]interface{}{"port": 3800},
"globalRicId": map[string]interface{}{"mcc": "310", "mnc": "4", "ricId": "AA443"},
- "routingManager": map[string]interface{}{"baseUrl": "http://localhost:8080/ric/v1/handles/"},
+ "routingManager": map[string]interface{}{"baseUrl": "http://localhost:8080/ric/v1/handles/"},
}
buf, err := yaml.Marshal(yamlMap)
if err != nil {
}
}()
yamlMap := map[string]interface{}{
- "rmr": map[string]interface{}{"port": 3801, "maxMsgSize": 4096},
- "logging": map[string]interface{}{"logLevel": "info"},
- "http": map[string]interface{}{"port": 3800},
+ "rmr": map[string]interface{}{"port": 3801, "maxMsgSize": 4096},
+ "logging": map[string]interface{}{"logLevel": "info"},
+ "http": map[string]interface{}{"port": 3800},
"globalRicId": map[string]interface{}{"mcc": "310", "mnc": "-2", "ricId": "AA443"},
- "routingManager": map[string]interface{}{"baseUrl": "http://localhost:8080/ric/v1/handles/"},
+ "routingManager": map[string]interface{}{"baseUrl": "http://localhost:8080/ric/v1/handles/"},
}
buf, err := yaml.Marshal(yamlMap)
if err != nil {
}
}()
yamlMap := map[string]interface{}{
- "rmr": map[string]interface{}{"port": 3801, "maxMsgSize": 4096},
- "logging": map[string]interface{}{"logLevel": "info"},
- "http": map[string]interface{}{"port": 3800},
+ "rmr": map[string]interface{}{"port": 3801, "maxMsgSize": 4096},
+ "logging": map[string]interface{}{"logLevel": "info"},
+ "http": map[string]interface{}{"port": 3800},
"globalRicId": map[string]interface{}{"mcc": "-31", "mnc": "222", "ricId": "AA443"},
- "routingManager": map[string]interface{}{"baseUrl": "http://localhost:8080/ric/v1/handles/"},
+ "routingManager": map[string]interface{}{"baseUrl": "http://localhost:8080/ric/v1/handles/"},
}
buf, err := yaml.Marshal(yamlMap)
if err != nil {
}
}()
yamlMap := map[string]interface{}{
- "rmr": map[string]interface{}{"port": 3801, "maxMsgSize": 4096},
- "logging": map[string]interface{}{"logLevel": "info"},
- "http": map[string]interface{}{"port": 3800},
+ "rmr": map[string]interface{}{"port": 3801, "maxMsgSize": 4096},
+ "logging": map[string]interface{}{"logLevel": "info"},
+ "http": map[string]interface{}{"port": 3800},
"globalRicId": map[string]interface{}{"mcc": "1W2", "mnc": "222", "ricId": "AA443"},
- "routingManager": map[string]interface{}{"baseUrl": "http://localhost:8080/ric/v1/handles/"},
+ "routingManager": map[string]interface{}{"baseUrl": "http://localhost:8080/ric/v1/handles/"},
}
buf, err := yaml.Marshal(yamlMap)
if err != nil {
}
}()
yamlMap := map[string]interface{}{
- "rmr": map[string]interface{}{"port": 3801, "maxMsgSize": 4096},
- "logging": map[string]interface{}{"logLevel": "info"},
- "http": map[string]interface{}{"port": 3800},
+ "rmr": map[string]interface{}{"port": 3801, "maxMsgSize": 4096},
+ "logging": map[string]interface{}{"logLevel": "info"},
+ "http": map[string]interface{}{"port": 3800},
"globalRicId": map[string]interface{}{"mcc": "111", "mnc": "2A8", "ricId": "AA443"},
- "routingManager": map[string]interface{}{"baseUrl": "http://localhost:8080/ric/v1/handles/"},
+ "routingManager": map[string]interface{}{"baseUrl": "http://localhost:8080/ric/v1/handles/"},
}
buf, err := yaml.Marshal(yamlMap)
if err != nil {
}
}()
yamlMap := map[string]interface{}{
- "rmr": map[string]interface{}{"port": 3801, "maxMsgSize": 4096},
- "logging": map[string]interface{}{"logLevel": "info"},
- "http": map[string]interface{}{"port": 3800},
+ "rmr": map[string]interface{}{"port": 3801, "maxMsgSize": 4096},
+ "logging": map[string]interface{}{"logLevel": "info"},
+ "http": map[string]interface{}{"port": 3800},
"globalRicId": map[string]interface{}{"mnc": "94", "ricId": "AABB3"},
- "routingManager": map[string]interface{}{"baseUrl": "http://localhost:8080/ric/v1/handles/"},
+ "routingManager": map[string]interface{}{"baseUrl": "http://localhost:8080/ric/v1/handles/"},
}
buf, err := yaml.Marshal(yamlMap)
if err != nil {
func() { ParseConfiguration() })
}
-
func TestEmptyMmcFailure(t *testing.T) {
configPath := "../resources/configuration.yaml"
configPathTmp := "../resources/configuration.yaml_tmp"
}
}()
yamlMap := map[string]interface{}{
- "rmr": map[string]interface{}{"port": 3801, "maxMsgSize": 4096},
- "logging": map[string]interface{}{"logLevel": "info"},
- "http": map[string]interface{}{"port": 3800},
+ "rmr": map[string]interface{}{"port": 3801, "maxMsgSize": 4096},
+ "logging": map[string]interface{}{"logLevel": "info"},
+ "http": map[string]interface{}{"port": 3800},
"globalRicId": map[string]interface{}{"mcc": "", "mnc": "94", "ricId": "AABB3"},
- "routingManager": map[string]interface{}{"baseUrl": "http://localhost:8080/ric/v1/handles/"},
+ "routingManager": map[string]interface{}{"baseUrl": "http://localhost:8080/ric/v1/handles/"},
}
buf, err := yaml.Marshal(yamlMap)
if err != nil {
}
}()
yamlMap := map[string]interface{}{
- "rmr": map[string]interface{}{"port": 3801, "maxMsgSize": 4096},
- "logging": map[string]interface{}{"logLevel": "info"},
- "http": map[string]interface{}{"port": 3800},
+ "rmr": map[string]interface{}{"port": 3801, "maxMsgSize": 4096},
+ "logging": map[string]interface{}{"logLevel": "info"},
+ "http": map[string]interface{}{"port": 3800},
"globalRicId": map[string]interface{}{"mcc": "111", "mnc": "", "ricId": "AABB3"},
- "routingManager": map[string]interface{}{"baseUrl": "http://localhost:8080/ric/v1/handles/"},
+ "routingManager": map[string]interface{}{"baseUrl": "http://localhost:8080/ric/v1/handles/"},
}
buf, err := yaml.Marshal(yamlMap)
if err != nil {
}
}()
yamlMap := map[string]interface{}{
- "rmr": map[string]interface{}{"port": 3801, "maxMsgSize": 4096},
- "logging": map[string]interface{}{"logLevel": "info"},
- "http": map[string]interface{}{"port": 3800},
+ "rmr": map[string]interface{}{"port": 3801, "maxMsgSize": 4096},
+ "logging": map[string]interface{}{"logLevel": "info"},
+ "http": map[string]interface{}{"port": 3800},
"globalRicId": map[string]interface{}{"mcc": "111", "ricId": "AABB3"},
- "routingManager": map[string]interface{}{"baseUrl": "http://localhost:8080/ric/v1/handles/"},
+ "routingManager": map[string]interface{}{"baseUrl": "http://localhost:8080/ric/v1/handles/"},
}
buf, err := yaml.Marshal(yamlMap)
if err != nil {
# The Jenkins job requires a tag to build the Docker image.
# Global-JJB script assumes this file is in the repo root.
---
-tag: 5.2.5
+tag: 5.2.6
UpdateGnb(writer http.ResponseWriter, r *http.Request)
GetNodebIdList(writer http.ResponseWriter, r *http.Request)
SetGeneralConfiguration(writer http.ResponseWriter, r *http.Request)
+ AddEnb(writer http.ResponseWriter, r *http.Request)
}
type NodebController struct {
func (c *NodebController) GetNodebIdList(writer http.ResponseWriter, r *http.Request) {
c.logger.Infof("[Client -> E2 Manager] #NodebController.GetNodebIdList - request: %v", c.prettifyRequest(r))
- c.handleRequest(writer, &r.Header, httpmsghandlerprovider.GetNodebIdListRequest, nil, false)
+ c.handleRequest(writer, &r.Header, httpmsghandlerprovider.GetNodebIdListRequest, nil, false, http.StatusOK)
}
func (c *NodebController) GetNodeb(writer http.ResponseWriter, r *http.Request) {
vars := mux.Vars(r)
ranName := vars["ranName"]
request := models.GetNodebRequest{RanName: ranName}
- c.handleRequest(writer, &r.Header, httpmsghandlerprovider.GetNodebRequest, request, false)
+ c.handleRequest(writer, &r.Header, httpmsghandlerprovider.GetNodebRequest, request, false, http.StatusOK)
}
func (c *NodebController) UpdateGnb(writer http.ResponseWriter, r *http.Request) {
request.Gnb = &gnb
request.RanName = ranName
- c.handleRequest(writer, &r.Header, httpmsghandlerprovider.UpdateGnbRequest, request, true)
+ c.handleRequest(writer, &r.Header, httpmsghandlerprovider.UpdateGnbRequest, request, true, http.StatusOK)
+}
+
+func (c *NodebController) AddEnb(writer http.ResponseWriter, r *http.Request) {
+ c.logger.Infof("[Client -> E2 Manager] #NodebController.AddEnb - request: %v", c.prettifyRequest(r))
+
+ defer r.Body.Close()
+ body, err := ioutil.ReadAll(io.LimitReader(r.Body, LimitRequest))
+
+ if err != nil {
+ c.logger.Errorf("[Client -> E2 Manager] #NodebController.AddEnb - unable to read request body - error: %s", err)
+ c.handleErrorResponse(e2managererrors.NewInvalidJsonError(), writer)
+ return
+ }
+
+ addEnbRequest := models.AddEnbRequest{}
+ err = json.Unmarshal(body, &addEnbRequest)
+
+ if err != nil {
+ c.logger.Errorf("[Client -> E2 Manager] #NodebController.AddEnb - unable to unmarshal json - error: %s", err)
+ c.handleErrorResponse(e2managererrors.NewInvalidJsonError(), writer)
+ return
+ }
+
+ c.handleRequest(writer, &r.Header, httpmsghandlerprovider.AddEnbRequest, &addEnbRequest, true, http.StatusCreated)
}
func (c *NodebController) SetGeneralConfiguration(writer http.ResponseWriter, r *http.Request) {
request := models.GeneralConfigurationRequest{}
- if !c.extractJsonBodyDisallowUnknownFields(r, &request, writer){
+ if !c.extractJsonBodyDisallowUnknownFields(r, &request, writer) {
return
}
- c.handleRequest(writer, &r.Header, httpmsghandlerprovider.SetGeneralConfigurationRequest, request, false)
+ c.handleRequest(writer, &r.Header, httpmsghandlerprovider.SetGeneralConfigurationRequest, request, false, http.StatusOK)
}
func (c *NodebController) Shutdown(writer http.ResponseWriter, r *http.Request) {
c.logger.Infof("[Client -> E2 Manager] #NodebController.Shutdown - request: %v", c.prettifyRequest(r))
- c.handleRequest(writer, &r.Header, httpmsghandlerprovider.ShutdownRequest, nil, false)
+ c.handleRequest(writer, &r.Header, httpmsghandlerprovider.ShutdownRequest, nil, false, http.StatusNoContent)
}
func (c *NodebController) X2Reset(writer http.ResponseWriter, r *http.Request) {
vars := mux.Vars(r)
ranName := vars[ParamRanName]
- if r.ContentLength > 0 && !c.extractJsonBody(r, &request, writer) {
+ if err := c.extractJsonBody(r, &request); err != nil {
+ c.handleErrorResponse(err, writer)
return
}
request.RanName = ranName
- c.handleRequest(writer, &r.Header, httpmsghandlerprovider.ResetRequest, request, false)
+ c.handleRequest(writer, &r.Header, httpmsghandlerprovider.ResetRequest, request, false, http.StatusNoContent)
}
-func (c *NodebController) extractRequestBodyToProto(r *http.Request, pb proto.Message , writer http.ResponseWriter) bool {
+func (c *NodebController) extractRequestBodyToProto(r *http.Request, pb proto.Message, writer http.ResponseWriter) bool {
defer r.Body.Close()
err := jsonpb.Unmarshal(r.Body, pb)
return true
}
-func (c *NodebController) extractJsonBody(r *http.Request, request models.Request, writer http.ResponseWriter) bool {
+func (c *NodebController) extractJsonBody(r *http.Request, request models.Request) error {
defer r.Body.Close()
body, err := ioutil.ReadAll(io.LimitReader(r.Body, LimitRequest))
if err != nil {
c.logger.Errorf("[Client -> E2 Manager] #NodebController.extractJsonBody - unable to extract json body - error: %s", err)
- c.handleErrorResponse(e2managererrors.NewInvalidJsonError(), writer)
- return false
+ return e2managererrors.NewInvalidJsonError()
}
err = json.Unmarshal(body, &request)
if err != nil {
c.logger.Errorf("[Client -> E2 Manager] #NodebController.extractJsonBody - unable to extract json body - error: %s", err)
- c.handleErrorResponse(e2managererrors.NewInvalidJsonError(), writer)
- return false
+ return e2managererrors.NewInvalidJsonError()
}
- return true
+ return nil
}
-func (c *NodebController) handleRequest(writer http.ResponseWriter, header *http.Header, requestName httpmsghandlerprovider.IncomingRequest, request models.Request, validateRequestHeaders bool) {
+func (c *NodebController) handleRequest(writer http.ResponseWriter, header *http.Header, requestName httpmsghandlerprovider.IncomingRequest, request models.Request, validateRequestHeaders bool, successStatusCode int) {
if validateRequestHeaders {
return
}
- if response == nil {
- writer.WriteHeader(http.StatusNoContent)
+ if successStatusCode == http.StatusNoContent {
+ writer.WriteHeader(successStatusCode)
c.logger.Infof("[E2 Manager -> Client] #NodebController.handleRequest - status response: %v", http.StatusNoContent)
return
}
c.logger.Infof("[E2 Manager -> Client] #NodebController.handleRequest - response: %s", result)
writer.Header().Set(ContentType, ApplicationJson)
+ writer.WriteHeader(successStatusCode)
writer.Write(result)
}
AssociatedE2TInstanceAddress = "10.0.2.15:38000"
ValidationFailureJson = "{\"errorCode\":402,\"errorMessage\":\"Validation error\"}"
ResourceNotFoundJson = "{\"errorCode\":404,\"errorMessage\":\"Resource not found\"}"
+ NodebExistsJson = "{\"errorCode\":406,\"errorMessage\":\"Nodeb already exists\"}"
RnibErrorJson = "{\"errorCode\":500,\"errorMessage\":\"RNIB error\"}"
InternalErrorJson = "{\"errorCode\":501,\"errorMessage\":\"Internal Server Error. Please try again later\"}"
+ AddEnbUrl = "/nodeb/enb"
)
var (
ServedNrCellInformationRequiredFields = []string{"cellId", "choiceNrMode", "nrMode", "nrPci", "servedPlmns"}
NrNeighbourInformationRequiredFields = []string{"nrCgi", "choiceNrMode", "nrMode", "nrPci"}
+ EnbRequiredFields = []string{"enbType", "servedCells"}
+ ServedCellRequiredFields = []string{"broadcastPlmns", "cellId", "choiceEutraMode", "eutraMode", "pci", "tac"}
)
type controllerGetNodebTestContext struct {
err error
}
+type saveNodebParams struct {
+ nodebInfo *entities.NodebInfo
+ nbIdentity *entities.NbIdentity
+ err error
+}
+
type removeServedNrCellsParams struct {
servedNrCells []*entities.ServedNRCell
err error
expectedJsonResponse string
}
+type controllerAddEnbTestContext struct {
+ getNodebInfoResult *getNodebInfoResult
+ saveNodebParams *saveNodebParams
+ requestBody map[string]interface{}
+ expectedStatusCode int
+ expectedJsonResponse string
+}
+
func generateServedNrCells(cellIds ...string) []*entities.ServedNRCell {
servedNrCells := []*entities.ServedNRCell{}
return ret
}
+func buildServedCell(propToOmit string) map[string]interface{} {
+ ret := map[string]interface{}{
+ "cellId": "whatever",
+ "choiceEutraMode": map[string]interface{}{
+ "fdd": map[string]interface{}{},
+ },
+ "eutraMode": 1,
+ "pci": 1,
+ "tac": "whatever3",
+ "broadcastPlmns": []interface{}{
+ "whatever",
+ },
+ }
+
+ if len(propToOmit) != 0 {
+ delete(ret, propToOmit)
+ }
+
+ return ret
+}
+
func setupControllerTest(t *testing.T) (*NodebController, *mocks.RnibReaderMock, *mocks.RnibWriterMock, *mocks.RmrMessengerMock, *mocks.E2TInstancesManagerMock) {
log := initLog(t)
config := configuration.ParseConfiguration()
assert.Equal(t, context.expectedJsonResponse, string(bodyBytes))
readerMock.AssertExpectations(t)
writerMock.AssertExpectations(t)
+}
- if context.getNodebInfoResult != nil {
- readerMock.AssertNotCalled(t, "GetNodeb")
- }
-
- if context.updateGnbCellsParams != nil {
- writerMock.AssertNotCalled(t, "UpdateGnb")
- }
-
- if context.removeServedNrCellsParams != nil {
- writerMock.AssertNotCalled(t, "RemoveServedNrCells")
- }
+func assertControllerAddEnb(t *testing.T, context *controllerAddEnbTestContext, writer *httptest.ResponseRecorder, readerMock *mocks.RnibReaderMock, writerMock *mocks.RnibWriterMock) {
+ assert.Equal(t, context.expectedStatusCode, writer.Result().StatusCode)
+ bodyBytes, _ := ioutil.ReadAll(writer.Body)
+ assert.Equal(t, context.expectedJsonResponse, string(bodyBytes))
+ readerMock.AssertExpectations(t)
+ writerMock.AssertExpectations(t)
}
func buildUpdateGnbRequest(context *controllerUpdateGnbTestContext) *http.Request {
updateGnbUrl := fmt.Sprintf("/nodeb/%s/update", RanName)
requestBody := getJsonRequestAsBuffer(context.requestBody)
- req, _ := http.NewRequest(http.MethodGet, updateGnbUrl, requestBody)
+ req, _ := http.NewRequest(http.MethodPut, updateGnbUrl, requestBody)
req.Header.Set("Content-Type", "application/json")
req = mux.SetURLVars(req, map[string]string{"ranName": RanName})
return req
}
+func buildAddEnbRequest(context *controllerAddEnbTestContext) *http.Request {
+ requestBody := getJsonRequestAsBuffer(context.requestBody)
+ req, _ := http.NewRequest(http.MethodPost, AddEnbUrl, requestBody)
+ req.Header.Set("Content-Type", "application/json")
+ return req
+}
+
func controllerUpdateGnbTestExecuter(t *testing.T, context *controllerUpdateGnbTestContext) {
controller, readerMock, writerMock, _, _ := setupControllerTest(t)
writer := httptest.NewRecorder()
assertControllerUpdateGnb(t, context, writer, readerMock, writerMock)
}
+func activateControllerAddEnbMocks(context *controllerAddEnbTestContext, readerMock *mocks.RnibReaderMock, writerMock *mocks.RnibWriterMock, addEnbRequest *models.AddEnbRequest) {
+ if context.getNodebInfoResult != nil {
+ readerMock.On("GetNodeb", RanName).Return(context.getNodebInfoResult.nodebInfo, context.getNodebInfoResult.rnibError)
+ }
+
+ if context.saveNodebParams != nil {
+ nodebInfo := entities.NodebInfo{
+ RanName: addEnbRequest.RanName,
+ Ip: addEnbRequest.Ip,
+ Port: addEnbRequest.Port,
+ GlobalNbId: addEnbRequest.GlobalNbId,
+ Configuration: &entities.NodebInfo_Enb{Enb: addEnbRequest.Enb},
+ ConnectionStatus: entities.ConnectionStatus_DISCONNECTED,
+ }
+
+ nbIdentity := entities.NbIdentity{InventoryName: addEnbRequest.RanName, GlobalNbId: addEnbRequest.GlobalNbId}
+
+ writerMock.On("SaveNodeb",&nbIdentity, &nodebInfo).Return(context.saveNodebParams.err)
+ }
+}
+
+func controllerAddEnbTestExecuter(t *testing.T, context *controllerAddEnbTestContext) {
+ controller, readerMock, writerMock, _, _ := setupControllerTest(t)
+ writer := httptest.NewRecorder()
+ r := buildAddEnbRequest(context)
+ defer r.Body.Close()
+ body, _ := ioutil.ReadAll(io.LimitReader(r.Body, LimitRequest))
+
+ addEnbRequest := models.AddEnbRequest{}
+
+ _ = json.Unmarshal(body, &addEnbRequest)
+ activateControllerAddEnbMocks(context, readerMock, writerMock, &addEnbRequest)
+ controller.AddEnb(writer, buildAddEnbRequest(context))
+ assertControllerAddEnb(t, context, writer, readerMock, writerMock)
+}
+
func TestControllerUpdateGnbEmptyServedNrCells(t *testing.T) {
context := controllerUpdateGnbTestContext{
getNodebInfoResult: nil,
controllerUpdateGnbTestExecuter(t, &context)
}
+func TestControllerAddEnbSuccess(t *testing.T) {
+ context := controllerAddEnbTestContext{
+ saveNodebParams: &saveNodebParams{
+ err: nil,
+ },
+ getNodebInfoResult: &getNodebInfoResult{
+ nodebInfo: nil,
+ rnibError: common.NewResourceNotFoundError("#reader.GetNodeb - Not found Error"),
+ },
+ requestBody: map[string]interface{}{
+ "ranName": RanName,
+ "globalNbId": map[string]interface{}{
+ "plmnId": "whatever",
+ "nbId": "whatever2",
+ },
+ "enb": map[string]interface{}{
+ "enbType": 1,
+ "servedCells": []interface{}{
+ buildServedCell(""),
+ },
+ },
+ },
+ expectedStatusCode: http.StatusCreated,
+ expectedJsonResponse: "{\"ranName\":\"test\",\"connectionStatus\":\"DISCONNECTED\",\"globalNbId\":{\"plmnId\":\"whatever\",\"nbId\":\"whatever2\"},\"enb\":{\"enbType\":\"MACRO_ENB\",\"servedCells\":[{\"pci\":1,\"cellId\":\"whatever\",\"tac\":\"whatever3\",\"broadcastPlmns\":[\"whatever\"],\"choiceEutraMode\":{\"fdd\":{}},\"eutraMode\":\"FDD\"}]}}",
+ }
+
+ controllerAddEnbTestExecuter(t, &context)
+}
+
func getJsonRequestAsBuffer(requestJson map[string]interface{}) *bytes.Buffer {
b := new(bytes.Buffer)
_ = json.NewEncoder(b).Encode(requestJson)
header := &http.Header{}
- controller.handleRequest(writer, header, httpmsghandlerprovider.ShutdownRequest, nil, true)
+ controller.handleRequest(writer, header, httpmsghandlerprovider.ShutdownRequest, nil, true, 0)
var errorResponse = parseJsonRequest(t, writer.Body)
err := e2managererrors.NewHeaderValidationError()
// no body
b := new(bytes.Buffer)
+ data4Req := map[string]interface{}{}
+ _ = json.NewEncoder(b).Encode(data4Req)
req, _ := http.NewRequest("PUT", "https://localhost:3800/nodeb-reset", b)
req = mux.SetURLVars(req, map[string]string{"ranName": ranName})
controller.X2Reset(writer, req)
assert.Equal(t, http.StatusNoContent, writer.Result().StatusCode)
-
}
func TestX2ResetHandleFailureInvalidBody(t *testing.T) {
--- /dev/null
+//
+// Copyright 2019 AT&T Intellectual Property
+// Copyright 2019 Nokia
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// This source code is part of the near-RT RIC (RAN Intelligent Controller)
+// platform project (RICP).
+
+
+package e2managererrors
+
+type NodebExistsError struct {
+ *BaseError
+}
+
+func NewNodebExistsError() *NodebExistsError {
+ return &NodebExistsError{
+ &BaseError{
+ Code: 406,
+ Message: "Nodeb already exists",
+ },
+ }
+}
+
+func (e *NodebExistsError) Error() string {
+ return e.Message
+}
--- /dev/null
+//
+// Copyright 2019 AT&T Intellectual Property
+// Copyright 2019 Nokia
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// This source code is part of the near-RT RIC (RAN Intelligent Controller)
+// platform project (RICP).
+
+package httpmsghandlers
+
+import (
+ "e2mgr/e2managererrors"
+ "e2mgr/logger"
+ "e2mgr/models"
+ "e2mgr/services"
+ "gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/common"
+ "gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/entities"
+ "github.com/pkg/errors"
+)
+
+type AddEnbRequestHandler struct {
+ logger *logger.Logger
+ rNibDataService services.RNibDataService
+}
+
+func NewAddEnbRequestHandler(logger *logger.Logger, rNibDataService services.RNibDataService) *AddEnbRequestHandler {
+ return &AddEnbRequestHandler{
+ logger: logger,
+ rNibDataService: rNibDataService,
+ }
+}
+
+func (h *AddEnbRequestHandler) Handle(request models.Request) (models.IResponse, error) {
+
+ addEnbRequest := request.(*models.AddEnbRequest)
+
+ h.logger.Infof("#AddEnbRequestHandler.Handle - Ran name: %s", addEnbRequest.RanName)
+
+ err := h.validateRequestBody(addEnbRequest)
+
+ if err != nil {
+ h.logger.Errorf("#AddEnbRequestHandler.Handle - validation failure: %s is a mandatory field and cannot be empty", err)
+ return nil, e2managererrors.NewRequestValidationError()
+ }
+
+ _, err = h.rNibDataService.GetNodeb(addEnbRequest.RanName)
+
+ if err == nil {
+ h.logger.Errorf("#AddEnbRequestHandler.Handle - RAN name: %s - RAN already exists. quit", addEnbRequest.RanName)
+ return nil, e2managererrors.NewNodebExistsError()
+ }
+
+ _, ok := err.(*common.ResourceNotFoundError)
+ if !ok {
+ h.logger.Errorf("#AddEnbRequestHandler.Handle - RAN name: %s - failed to get nodeb entity from RNIB. Error: %s", addEnbRequest.RanName, err)
+ return nil, e2managererrors.NewRnibDbError()
+ }
+
+ nbIdentity := h.createNbIdentity(addEnbRequest)
+ nodebInfo := h.createNodebInfo(addEnbRequest)
+
+ err = h.rNibDataService.SaveNodeb(nbIdentity, nodebInfo)
+
+ if err != nil {
+ h.logger.Errorf("#AddEnbRequestHandler.Handle - RAN name: %s - failed to save nodeb entity in RNIB. Error: %s", addEnbRequest.RanName, err)
+ return nil, e2managererrors.NewRnibDbError()
+ }
+
+ return models.NewAddEnbResponse(nodebInfo), nil
+}
+
+func (h *AddEnbRequestHandler) createNodebInfo(addEnbRequest *models.AddEnbRequest) *entities.NodebInfo {
+ nodebInfo := entities.NodebInfo{
+ RanName: addEnbRequest.RanName,
+ Ip: addEnbRequest.Ip,
+ Port: addEnbRequest.Port,
+ GlobalNbId: addEnbRequest.GlobalNbId,
+ Configuration: &entities.NodebInfo_Enb{Enb: addEnbRequest.Enb},
+ ConnectionStatus: entities.ConnectionStatus_DISCONNECTED,
+ }
+
+ return &nodebInfo
+}
+
+func (h *AddEnbRequestHandler) createNbIdentity(addEnbRequest *models.AddEnbRequest) *entities.NbIdentity {
+ nbIdentity := entities.NbIdentity{
+ GlobalNbId: addEnbRequest.GlobalNbId,
+ InventoryName: addEnbRequest.RanName,
+ }
+
+ return &nbIdentity
+}
+
+func (h *AddEnbRequestHandler) validateRequestBody(addEnbRequest *models.AddEnbRequest) error {
+
+ if addEnbRequest.RanName == "" {
+ return errors.New("ranName")
+ }
+
+ if addEnbRequest.GlobalNbId == nil {
+ return errors.New("globalNbId")
+ }
+
+ if err := isGlobalNbIdValid(addEnbRequest.GlobalNbId); err != nil {
+ return err
+ }
+
+ if addEnbRequest.Enb == nil {
+ return errors.New("enb")
+ }
+
+ if err := isEnbValid(addEnbRequest.Enb); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+func isGlobalNbIdValid(globalNbId *entities.GlobalNbId) error {
+ if globalNbId.PlmnId == "" {
+ return errors.New("globalNbId.plmnId")
+ }
+
+ if globalNbId.NbId == "" {
+ return errors.New("globalNbId.nbId")
+ }
+
+ return nil
+}
+
+func isEnbValid(enb *entities.Enb) error {
+ if enb.EnbType == entities.EnbType_UNKNOWN_ENB_TYPE {
+ return errors.New("enb.enbType")
+ }
+
+ if enb.ServedCells == nil || len(enb.ServedCells) == 0 {
+ return errors.New("enb.servedCells")
+ }
+
+ for _, servedCell := range enb.ServedCells {
+ err := isServedCellValid(servedCell)
+
+ if err != nil {
+ return err
+ }
+ }
+
+ return nil
+}
+
+func isServedCellValid(servedCell *entities.ServedCellInfo) error {
+
+ if servedCell.CellId == "" {
+ return errors.New("servedCell.cellId")
+ }
+
+ if servedCell.EutraMode == entities.Eutra_UNKNOWN {
+ return errors.New("servedCell.eutraMode")
+ }
+
+ if servedCell.Tac == "" {
+ return errors.New("servedCell.tac")
+ }
+
+ if servedCell.BroadcastPlmns == nil || len(servedCell.BroadcastPlmns) == 0 {
+ return errors.New("servedCell.broadcastPlmns")
+ }
+
+ if servedCell.ChoiceEutraMode == nil {
+ return errors.New("servedCell.choiceEutraMode")
+ }
+
+ return isChoiceEutraModeValid(servedCell.ChoiceEutraMode)
+}
+
+func isChoiceEutraModeValid(choiceEutraMode *entities.ChoiceEUTRAMode) error {
+ if choiceEutraMode.Fdd != nil {
+ return isFddInfoValid(choiceEutraMode.Fdd)
+ }
+
+ if choiceEutraMode.Tdd != nil {
+ return isTddInfoValid(choiceEutraMode.Tdd)
+ }
+
+ return errors.New("servedCell.fdd / servedCell.tdd")
+}
+
+func isTddInfoValid(tdd *entities.TddInfo) error {
+ return nil
+}
+
+func isFddInfoValid(fdd *entities.FddInfo) error {
+ return nil
+}
func setupDeleteAllRequestHandlerTest(t *testing.T) (*DeleteAllRequestHandler, *mocks.RnibReaderMock, *mocks.RnibWriterMock, *mocks.RmrMessengerMock, *mocks.HttpClientMock) {
log := initLog(t)
- config := &configuration.Configuration{StateChangeMessageChannel: "RAN_CONNECTION_STATUS_CHANGE"}
+ config := &configuration.Configuration{RnibWriter: configuration.RnibWriterConfig{ StateChangeMessageChannel: "RAN_CONNECTION_STATUS_CHANGE"}}
config.BigRedButtonTimeoutSec = 1
config.RoutingManager.BaseUrl = BaseRMUrl
config := &configuration.Configuration{
RnibRetryIntervalMs: 10,
MaxRnibConnectionAttempts: 3,
- StateChangeMessageChannel: StateChangeMessageChannel,
+ RnibWriter: configuration.RnibWriterConfig{
+ StateChangeMessageChannel: StateChangeMessageChannel,
+ },
GlobalRicId: struct {
RicId string
Mcc string
config := &configuration.Configuration{
RnibRetryIntervalMs: 10,
MaxRnibConnectionAttempts: 3,
- StateChangeMessageChannel: StateChangeMessageChannel,
+ RnibWriter: configuration.RnibWriterConfig{
+ StateChangeMessageChannel: StateChangeMessageChannel,
+ },
GlobalRicId: struct {
RicId string
Mcc string
config := &configuration.Configuration{
RnibRetryIntervalMs: 10,
MaxRnibConnectionAttempts: 3,
- StateChangeMessageChannel: StateChangeMessageChannel,
+ RnibWriter: configuration.RnibWriterConfig {
+ StateChangeMessageChannel: StateChangeMessageChannel,
+ },
}
readerMock := &mocks.RnibReaderMock{}
func Run(log *logger.Logger, port int, rootController controllers.IRootController, nodebController controllers.INodebController, e2tController controllers.IE2TController) error {
- router := mux.NewRouter();
+ router := mux.NewRouter()
initializeRoutes(router, rootController, nodebController, e2tController)
addr := fmt.Sprintf(":%d", port)
rr := r.PathPrefix("/nodeb").Subrouter()
rr.HandleFunc("/ids", nodebController.GetNodebIdList).Methods(http.MethodGet)
rr.HandleFunc("/{ranName}", nodebController.GetNodeb).Methods(http.MethodGet)
+ rr.HandleFunc("/enb", nodebController.AddEnb).Methods(http.MethodPost)
rr.HandleFunc("/{ranName}/update", nodebController.UpdateGnb).Methods(http.MethodPut)
rr.HandleFunc("/shutdown", nodebController.Shutdown).Methods(http.MethodPut)
rr.HandleFunc("/parameters", nodebController.SetGeneralConfiguration).Methods(http.MethodPut)
func initE2TAssociationManagerTest(t *testing.T) (*E2TAssociationManager, *mocks.RnibReaderMock, *mocks.RnibWriterMock, *mocks.HttpClientMock) {
log := initLog(t)
- config := &configuration.Configuration{RnibRetryIntervalMs: 10, MaxRnibConnectionAttempts: 3, StateChangeMessageChannel: StateChangeMessageChannel}
+ config := &configuration.Configuration{RnibRetryIntervalMs: 10, MaxRnibConnectionAttempts: 3, RnibWriter: configuration.RnibWriterConfig{ StateChangeMessageChannel: StateChangeMessageChannel}}
readerMock := &mocks.RnibReaderMock{}
writerMock := &mocks.RnibWriterMock{}
func initE2TShutdownManagerTest(t *testing.T) (*E2TShutdownManager, *mocks.RnibReaderMock, *mocks.RnibWriterMock, *mocks.HttpClientMock, *KubernetesManager) {
log := initLog(t)
- config := &configuration.Configuration{RnibRetryIntervalMs: 10, MaxRnibConnectionAttempts: 3, E2TInstanceDeletionTimeoutMs: 15000, StateChangeMessageChannel: "RAN_CONNECTION_STATUS_CHANGE"}
+ config := &configuration.Configuration{RnibRetryIntervalMs: 10, MaxRnibConnectionAttempts: 3, E2TInstanceDeletionTimeoutMs: 15000, RnibWriter: configuration.RnibWriterConfig{StateChangeMessageChannel: "RAN_CONNECTION_STATUS_CHANGE"}}
readerMock := &mocks.RnibReaderMock{}
writerMock := &mocks.RnibWriterMock{}
ranListManager := NewRanListManager(log)
ranAlarmService := services.NewRanAlarmService(log, config)
- ranConnectStatusChangeManager := NewRanConnectStatusChangeManager(log, rnibDataService,ranListManager, ranAlarmService)
+ ranConnectStatusChangeManager := NewRanConnectStatusChangeManager(log, rnibDataService, ranListManager, ranAlarmService)
associationManager := NewE2TAssociationManager(log, rnibDataService, e2tInstancesManager, rmClient, ranConnectStatusChangeManager)
//kubernetesManager := initKubernetesManagerTest(t)
}
func TestShutdownSuccess1OutOf3Instances(t *testing.T) {
- shutdownManager, readerMock, writerMock, httpClientMock,_ := initE2TShutdownManagerTest(t)
+ shutdownManager, readerMock, writerMock, httpClientMock, _ := initE2TShutdownManagerTest(t)
e2tInstance1 := entities.NewE2TInstance(E2TAddress, PodName)
e2tInstance1.State = entities.Active
e2tInstance3.AssociatedRanList = []string{"test4"}
writerMock.On("SaveE2TInstance", mock.MatchedBy(func(e2tInstance *entities.E2TInstance) bool { return e2tInstance.Address == E2TAddress && e2tInstance.State == entities.ToBeDeleted })).Return(nil)
- nodeb1 := &entities.NodebInfo{RanName:"test1", AssociatedE2TInstanceAddress:E2TAddress, ConnectionStatus:entities.ConnectionStatus_CONNECTED, E2ApplicationProtocol:entities.E2ApplicationProtocol_X2_SETUP_REQUEST}
+ nodeb1 := &entities.NodebInfo{RanName: "test1", AssociatedE2TInstanceAddress: E2TAddress, ConnectionStatus: entities.ConnectionStatus_CONNECTED, E2ApplicationProtocol: entities.E2ApplicationProtocol_X2_SETUP_REQUEST}
readerMock.On("GetNodeb", "test1").Return(nodeb1, nil)
- nodeb2 := &entities.NodebInfo{RanName:"test2", AssociatedE2TInstanceAddress:E2TAddress, ConnectionStatus:entities.ConnectionStatus_SHUTTING_DOWN, E2ApplicationProtocol:entities.E2ApplicationProtocol_X2_SETUP_REQUEST}
+ nodeb2 := &entities.NodebInfo{RanName: "test2", AssociatedE2TInstanceAddress: E2TAddress, ConnectionStatus: entities.ConnectionStatus_SHUTTING_DOWN, E2ApplicationProtocol: entities.E2ApplicationProtocol_X2_SETUP_REQUEST}
readerMock.On("GetNodeb", "test2").Return(nodeb2, nil)
- nodeb5 := &entities.NodebInfo{RanName:"test5", AssociatedE2TInstanceAddress:E2TAddress, ConnectionStatus:entities.ConnectionStatus_CONNECTED, E2ApplicationProtocol:entities.E2ApplicationProtocol_X2_SETUP_REQUEST}
+ nodeb5 := &entities.NodebInfo{RanName: "test5", AssociatedE2TInstanceAddress: E2TAddress, ConnectionStatus: entities.ConnectionStatus_CONNECTED, E2ApplicationProtocol: entities.E2ApplicationProtocol_X2_SETUP_REQUEST}
readerMock.On("GetNodeb", "test5").Return(nodeb5, nil)
- e2tAddresses := []string{E2TAddress, E2TAddress2,E2TAddress3}
+ e2tAddresses := []string{E2TAddress, E2TAddress2, E2TAddress3}
readerMock.On("GetE2TAddresses").Return(e2tAddresses, nil)
data := models.NewRoutingManagerDeleteRequestModel(E2TAddress, e2tInstance1.AssociatedRanList, nil)
httpClientMock.On("Delete", "e2t", "application/json", body).Return(&http.Response{StatusCode: http.StatusCreated, Body: respBody}, nil)
writerMock.On("RemoveE2TInstance", E2TAddress).Return(nil)
- writerMock.On("SaveE2TAddresses", []string{E2TAddress2,E2TAddress3}).Return(nil)
+ writerMock.On("SaveE2TAddresses", []string{E2TAddress2, E2TAddress3}).Return(nil)
/*** nodeb 1 ***/
nodeb1connected := *nodeb1
}
func TestShutdownSuccess1InstanceWithoutRans(t *testing.T) {
- shutdownManager, readerMock, writerMock, httpClientMock,_ := initE2TShutdownManagerTest(t)
+ shutdownManager, readerMock, writerMock, httpClientMock, _ := initE2TShutdownManagerTest(t)
e2tInstance1 := entities.NewE2TInstance(E2TAddress, PodName)
e2tInstance1.State = entities.Active
}
func TestShutdownSuccess1Instance2Rans(t *testing.T) {
- shutdownManager, readerMock, writerMock, httpClientMock,_ := initE2TShutdownManagerTest(t)
+ shutdownManager, readerMock, writerMock, httpClientMock, _ := initE2TShutdownManagerTest(t)
e2tInstance1 := entities.NewE2TInstance(E2TAddress, PodName)
e2tInstance1.State = entities.Active
e2tInstance1.AssociatedRanList = []string{"test1", "test2"}
writerMock.On("SaveE2TInstance", mock.MatchedBy(func(e2tInstance *entities.E2TInstance) bool { return e2tInstance.Address == E2TAddress && e2tInstance.State == entities.ToBeDeleted })).Return(nil)
- nodeb1 := &entities.NodebInfo{RanName:"test1", AssociatedE2TInstanceAddress:E2TAddress, ConnectionStatus:entities.ConnectionStatus_CONNECTED, E2ApplicationProtocol:entities.E2ApplicationProtocol_X2_SETUP_REQUEST}
+ nodeb1 := &entities.NodebInfo{RanName: "test1", AssociatedE2TInstanceAddress: E2TAddress, ConnectionStatus: entities.ConnectionStatus_CONNECTED, E2ApplicationProtocol: entities.E2ApplicationProtocol_X2_SETUP_REQUEST}
readerMock.On("GetNodeb", "test1").Return(nodeb1, nil)
- nodeb2 := &entities.NodebInfo{RanName:"test2", AssociatedE2TInstanceAddress:E2TAddress, ConnectionStatus:entities.ConnectionStatus_DISCONNECTED, E2ApplicationProtocol:entities.E2ApplicationProtocol_X2_SETUP_REQUEST}
+ nodeb2 := &entities.NodebInfo{RanName: "test2", AssociatedE2TInstanceAddress: E2TAddress, ConnectionStatus: entities.ConnectionStatus_DISCONNECTED, E2ApplicationProtocol: entities.E2ApplicationProtocol_X2_SETUP_REQUEST}
readerMock.On("GetNodeb", "test2").Return(nodeb2, nil)
data := models.NewRoutingManagerDeleteRequestModel(E2TAddress, []string{"test1", "test2"}, nil)
}
func TestShutdownE2tInstanceAlreadyBeingDeleted(t *testing.T) {
- shutdownManager, readerMock, writerMock, httpClientMock,_ := initE2TShutdownManagerTest(t)
+ shutdownManager, readerMock, writerMock, httpClientMock, _ := initE2TShutdownManagerTest(t)
e2tInstance1 := entities.NewE2TInstance(E2TAddress, PodName)
e2tInstance1.State = entities.ToBeDeleted
}
func TestShutdownFailureMarkInstanceAsToBeDeleted(t *testing.T) {
- shutdownManager, readerMock, writerMock, httpClientMock,_ := initE2TShutdownManagerTest(t)
+ shutdownManager, readerMock, writerMock, httpClientMock, _ := initE2TShutdownManagerTest(t)
e2tInstance1 := entities.NewE2TInstance(E2TAddress, PodName)
e2tInstance1.State = entities.Active
}
func TestShutdownFailureRoutingManagerError(t *testing.T) {
- shutdownManager, readerMock, writerMock, httpClientMock,_ := initE2TShutdownManagerTest(t)
+ shutdownManager, readerMock, writerMock, httpClientMock, _ := initE2TShutdownManagerTest(t)
e2tInstance1 := entities.NewE2TInstance(E2TAddress, PodName)
e2tInstance1.State = entities.Active
e2tInstance3.AssociatedRanList = []string{"test4"}
writerMock.On("SaveE2TInstance", mock.MatchedBy(func(e2tInstance *entities.E2TInstance) bool { return e2tInstance.Address == E2TAddress && e2tInstance.State == entities.ToBeDeleted })).Return(nil)
- nodeb1 := &entities.NodebInfo{RanName:"test1", AssociatedE2TInstanceAddress:E2TAddress, ConnectionStatus:entities.ConnectionStatus_CONNECTED, E2ApplicationProtocol:entities.E2ApplicationProtocol_X2_SETUP_REQUEST}
+ nodeb1 := &entities.NodebInfo{RanName: "test1", AssociatedE2TInstanceAddress: E2TAddress, ConnectionStatus: entities.ConnectionStatus_CONNECTED, E2ApplicationProtocol: entities.E2ApplicationProtocol_X2_SETUP_REQUEST}
readerMock.On("GetNodeb", "test1").Return(nodeb1, nil)
- nodeb2 := &entities.NodebInfo{RanName:"test2", AssociatedE2TInstanceAddress:E2TAddress, ConnectionStatus:entities.ConnectionStatus_SHUTTING_DOWN, E2ApplicationProtocol:entities.E2ApplicationProtocol_X2_SETUP_REQUEST}
+ nodeb2 := &entities.NodebInfo{RanName: "test2", AssociatedE2TInstanceAddress: E2TAddress, ConnectionStatus: entities.ConnectionStatus_SHUTTING_DOWN, E2ApplicationProtocol: entities.E2ApplicationProtocol_X2_SETUP_REQUEST}
readerMock.On("GetNodeb", "test2").Return(nodeb2, nil)
- nodeb5 := &entities.NodebInfo{RanName:"test5", AssociatedE2TInstanceAddress:E2TAddress, ConnectionStatus:entities.ConnectionStatus_CONNECTED, E2ApplicationProtocol:entities.E2ApplicationProtocol_X2_SETUP_REQUEST}
+ nodeb5 := &entities.NodebInfo{RanName: "test5", AssociatedE2TInstanceAddress: E2TAddress, ConnectionStatus: entities.ConnectionStatus_CONNECTED, E2ApplicationProtocol: entities.E2ApplicationProtocol_X2_SETUP_REQUEST}
readerMock.On("GetNodeb", "test5").Return(nodeb5, nil)
- e2tAddresses := []string{E2TAddress, E2TAddress2,E2TAddress3}
+ e2tAddresses := []string{E2TAddress, E2TAddress2, E2TAddress3}
readerMock.On("GetE2TAddresses").Return(e2tAddresses, nil)
data := models.NewRoutingManagerDeleteRequestModel(E2TAddress, e2tInstance1.AssociatedRanList, nil)
httpClientMock.On("Delete", "e2t", "application/json", body).Return(&http.Response{StatusCode: http.StatusBadRequest, Body: respBody}, nil)
writerMock.On("RemoveE2TInstance", E2TAddress).Return(nil)
- writerMock.On("SaveE2TAddresses", []string{E2TAddress2,E2TAddress3}).Return(nil)
+ writerMock.On("SaveE2TAddresses", []string{E2TAddress2, E2TAddress3}).Return(nil)
/*** nodeb 1 connected ***/
nodeb1connected := *nodeb1
}
func TestShutdownFailureInClearNodebsAssociation(t *testing.T) {
- shutdownManager, readerMock, writerMock, httpClientMock,_ := initE2TShutdownManagerTest(t)
+ shutdownManager, readerMock, writerMock, httpClientMock, _ := initE2TShutdownManagerTest(t)
e2tInstance1 := entities.NewE2TInstance(E2TAddress, PodName)
e2tInstance1.State = entities.Active
e2tInstance1.AssociatedRanList = []string{"test1", "test2"}
writerMock.On("SaveE2TInstance", mock.MatchedBy(func(e2tInstance *entities.E2TInstance) bool { return e2tInstance.Address == E2TAddress && e2tInstance.State == entities.ToBeDeleted })).Return(nil)
- nodeb1 := &entities.NodebInfo{RanName:"test1", AssociatedE2TInstanceAddress:E2TAddress, ConnectionStatus:entities.ConnectionStatus_CONNECTED, E2ApplicationProtocol:entities.E2ApplicationProtocol_X2_SETUP_REQUEST}
+ nodeb1 := &entities.NodebInfo{RanName: "test1", AssociatedE2TInstanceAddress: E2TAddress, ConnectionStatus: entities.ConnectionStatus_CONNECTED, E2ApplicationProtocol: entities.E2ApplicationProtocol_X2_SETUP_REQUEST}
readerMock.On("GetNodeb", "test1").Return(nodeb1, nil)
nodeb1new := *nodeb1
}
func TestShutdownFailureInClearNodebsAssociation_UpdateConnectionStatus(t *testing.T) {
- shutdownManager, readerMock, writerMock, httpClientMock,_ := initE2TShutdownManagerTest(t)
+ shutdownManager, readerMock, writerMock, httpClientMock, _ := initE2TShutdownManagerTest(t)
e2tInstance1 := entities.NewE2TInstance(E2TAddress, PodName)
e2tInstance1.State = entities.Active
e2tInstance1.AssociatedRanList = []string{"test1", "test2"}
writerMock.On("SaveE2TInstance", mock.MatchedBy(func(e2tInstance *entities.E2TInstance) bool { return e2tInstance.Address == E2TAddress && e2tInstance.State == entities.ToBeDeleted })).Return(nil)
- nodeb1 := &entities.NodebInfo{RanName:"test1", AssociatedE2TInstanceAddress:E2TAddress, ConnectionStatus:entities.ConnectionStatus_CONNECTED, E2ApplicationProtocol:entities.E2ApplicationProtocol_X2_SETUP_REQUEST}
+ nodeb1 := &entities.NodebInfo{RanName: "test1", AssociatedE2TInstanceAddress: E2TAddress, ConnectionStatus: entities.ConnectionStatus_CONNECTED, E2ApplicationProtocol: entities.E2ApplicationProtocol_X2_SETUP_REQUEST}
readerMock.On("GetNodeb", "test1").Return(nodeb1, nil)
nodeb1new := *nodeb1
}
func TestShutdownResourceNotFoundErrorInGetNodeb(t *testing.T) {
- shutdownManager, readerMock, writerMock, httpClientMock,_ := initE2TShutdownManagerTest(t)
+ shutdownManager, readerMock, writerMock, httpClientMock, _ := initE2TShutdownManagerTest(t)
e2tInstance1 := entities.NewE2TInstance(E2TAddress, PodName)
e2tInstance1.State = entities.Active
e2tInstance1.AssociatedRanList = []string{"test1", "test2"}
writerMock.On("SaveE2TInstance", mock.MatchedBy(func(e2tInstance *entities.E2TInstance) bool { return e2tInstance.Address == E2TAddress && e2tInstance.State == entities.ToBeDeleted })).Return(nil)
- nodeb1 := &entities.NodebInfo{RanName:"test1", AssociatedE2TInstanceAddress:E2TAddress, ConnectionStatus:entities.ConnectionStatus_CONNECTED, E2ApplicationProtocol:entities.E2ApplicationProtocol_X2_SETUP_REQUEST}
+ nodeb1 := &entities.NodebInfo{RanName: "test1", AssociatedE2TInstanceAddress: E2TAddress, ConnectionStatus: entities.ConnectionStatus_CONNECTED, E2ApplicationProtocol: entities.E2ApplicationProtocol_X2_SETUP_REQUEST}
readerMock.On("GetNodeb", "test1").Return(nodeb1, nil)
var nodeb2 *entities.NodebInfo
readerMock.On("GetNodeb", "test2").Return(nodeb2, common.NewResourceNotFoundError("for testing"))
}
func TestShutdownResourceGeneralErrorInGetNodeb(t *testing.T) {
- shutdownManager, readerMock, writerMock, httpClientMock,_ := initE2TShutdownManagerTest(t)
+ shutdownManager, readerMock, writerMock, httpClientMock, _ := initE2TShutdownManagerTest(t)
e2tInstance1 := entities.NewE2TInstance(E2TAddress, PodName)
e2tInstance1.State = entities.Active
var nodeb1 *entities.NodebInfo
readerMock.On("GetNodeb", "test1").Return(nodeb1, common.NewInternalError(fmt.Errorf("for testing")))
- nodeb2 := &entities.NodebInfo{RanName:"test2", AssociatedE2TInstanceAddress:E2TAddress, ConnectionStatus:entities.ConnectionStatus_DISCONNECTED, E2ApplicationProtocol:entities.E2ApplicationProtocol_X2_SETUP_REQUEST}
+ nodeb2 := &entities.NodebInfo{RanName: "test2", AssociatedE2TInstanceAddress: E2TAddress, ConnectionStatus: entities.ConnectionStatus_DISCONNECTED, E2ApplicationProtocol: entities.E2ApplicationProtocol_X2_SETUP_REQUEST}
readerMock.On("GetNodeb", "test2").Return(nodeb2, nil)
data := models.NewRoutingManagerDeleteRequestModel(E2TAddress, []string{"test1", "test2"}, nil)
}
func TestShutdownFailureInRemoveE2TInstance(t *testing.T) {
- shutdownManager, readerMock, writerMock, httpClientMock,_ := initE2TShutdownManagerTest(t)
+ shutdownManager, readerMock, writerMock, httpClientMock, _ := initE2TShutdownManagerTest(t)
e2tInstance1 := entities.NewE2TInstance(E2TAddress, PodName)
e2tInstance1.State = entities.Active
e2tInstance3.AssociatedRanList = []string{"test4"}
writerMock.On("SaveE2TInstance", mock.MatchedBy(func(e2tInstance *entities.E2TInstance) bool { return e2tInstance.Address == E2TAddress && e2tInstance.State == entities.ToBeDeleted })).Return(nil)
- nodeb1 := &entities.NodebInfo{RanName:"test1", AssociatedE2TInstanceAddress:E2TAddress, ConnectionStatus:entities.ConnectionStatus_CONNECTED, E2ApplicationProtocol:entities.E2ApplicationProtocol_X2_SETUP_REQUEST}
+ nodeb1 := &entities.NodebInfo{RanName: "test1", AssociatedE2TInstanceAddress: E2TAddress, ConnectionStatus: entities.ConnectionStatus_CONNECTED, E2ApplicationProtocol: entities.E2ApplicationProtocol_X2_SETUP_REQUEST}
readerMock.On("GetNodeb", "test1").Return(nodeb1, nil)
- nodeb2 := &entities.NodebInfo{RanName:"test2", AssociatedE2TInstanceAddress:E2TAddress, ConnectionStatus:entities.ConnectionStatus_SHUTTING_DOWN, E2ApplicationProtocol:entities.E2ApplicationProtocol_X2_SETUP_REQUEST}
+ nodeb2 := &entities.NodebInfo{RanName: "test2", AssociatedE2TInstanceAddress: E2TAddress, ConnectionStatus: entities.ConnectionStatus_SHUTTING_DOWN, E2ApplicationProtocol: entities.E2ApplicationProtocol_X2_SETUP_REQUEST}
readerMock.On("GetNodeb", "test2").Return(nodeb2, nil)
- nodeb5 := &entities.NodebInfo{RanName:"test5", AssociatedE2TInstanceAddress:E2TAddress, ConnectionStatus:entities.ConnectionStatus_CONNECTED, E2ApplicationProtocol:entities.E2ApplicationProtocol_X2_SETUP_REQUEST}
+ nodeb5 := &entities.NodebInfo{RanName: "test5", AssociatedE2TInstanceAddress: E2TAddress, ConnectionStatus: entities.ConnectionStatus_CONNECTED, E2ApplicationProtocol: entities.E2ApplicationProtocol_X2_SETUP_REQUEST}
readerMock.On("GetNodeb", "test5").Return(nodeb5, nil)
data := models.NewRoutingManagerDeleteRequestModel(E2TAddress, e2tInstance1.AssociatedRanList, nil)
readerMock.AssertExpectations(t)
writerMock.AssertExpectations(t)
httpClientMock.AssertExpectations(t)
-}
\ No newline at end of file
+}
if err != nil {
t.Errorf("#... - failed to initialize log, error: %s", err)
}
- config := &configuration.Configuration{RnibRetryIntervalMs: 10, MaxRnibConnectionAttempts: 3, StateChangeMessageChannel: EventChannelForTest}
+ config := &configuration.Configuration{RnibRetryIntervalMs: 10, MaxRnibConnectionAttempts: 3,
+ RnibWriter: configuration.RnibWriterConfig{
+ StateChangeMessageChannel: EventChannelForTest,
+ },
+ }
readerMock := &mocks.RnibReaderMock{}
writerMock := &mocks.RnibWriterMock{}
origNodebInfo := &entities.NodebInfo{RanName: RanName, ConnectionStatus: entities.ConnectionStatus_UNKNOWN_CONNECTION_STATUS}
updatedNodebInfo := *origNodebInfo
updatedNodebInfo.ConnectionStatus = entities.ConnectionStatus_CONNECTED
- writerMock.On("UpdateNodebInfoOnConnectionStatusInversion", &updatedNodebInfo, EventChannelForTest, RanName + "_" + CONNECTED_RAW_EVENT).Return(nil)
+ writerMock.On("UpdateNodebInfoOnConnectionStatusInversion", &updatedNodebInfo, EventChannelForTest, RanName+"_"+CONNECTED_RAW_EVENT).Return(nil)
ranListManagerMock.On("UpdateRanState", &updatedNodebInfo).Return(nil)
ranAlarmServiceMock.On("SetConnectivityChangeAlarm", &updatedNodebInfo).Return(nil)
err := ranConnectStatusChangeManager.ChangeStatus(origNodebInfo, entities.ConnectionStatus_CONNECTED)
origNodebInfo := &entities.NodebInfo{RanName: RanName, ConnectionStatus: entities.ConnectionStatus_DISCONNECTED}
updatedNodebInfo := *origNodebInfo
updatedNodebInfo.ConnectionStatus = entities.ConnectionStatus_CONNECTED
- writerMock.On("UpdateNodebInfoOnConnectionStatusInversion", &updatedNodebInfo, EventChannelForTest, RanName + "_" + CONNECTED_RAW_EVENT).Return(nil)
+ writerMock.On("UpdateNodebInfoOnConnectionStatusInversion", &updatedNodebInfo, EventChannelForTest, RanName+"_"+CONNECTED_RAW_EVENT).Return(nil)
ranListManagerMock.On("UpdateRanState", &updatedNodebInfo).Return(nil)
ranAlarmServiceMock.On("SetConnectivityChangeAlarm", &updatedNodebInfo).Return(nil)
err := ranConnectStatusChangeManager.ChangeStatus(origNodebInfo, entities.ConnectionStatus_CONNECTED)
origNodebInfo := &entities.NodebInfo{RanName: RanName, ConnectionStatus: entities.ConnectionStatus_CONNECTED}
updatedNodebInfo := *origNodebInfo
updatedNodebInfo.ConnectionStatus = entities.ConnectionStatus_DISCONNECTED
- writerMock.On("UpdateNodebInfoOnConnectionStatusInversion", &updatedNodebInfo, EventChannelForTest, RanName + "_" + DISCONNECTED_RAW_EVENT).Return(nil)
+ writerMock.On("UpdateNodebInfoOnConnectionStatusInversion", &updatedNodebInfo, EventChannelForTest, RanName+"_"+DISCONNECTED_RAW_EVENT).Return(nil)
ranListManagerMock.On("UpdateRanState", &updatedNodebInfo).Return(nil)
ranAlarmServiceMock.On("SetConnectivityChangeAlarm", &updatedNodebInfo).Return(nil)
err := ranConnectStatusChangeManager.ChangeStatus(origNodebInfo, entities.ConnectionStatus_DISCONNECTED)
origNodebInfo := &entities.NodebInfo{RanName: RanName, ConnectionStatus: entities.ConnectionStatus_DISCONNECTED}
updatedNodebInfo := *origNodebInfo
updatedNodebInfo.ConnectionStatus = entities.ConnectionStatus_CONNECTED
- writerMock.On("UpdateNodebInfoOnConnectionStatusInversion", &updatedNodebInfo, EventChannelForTest, RanName + "_" + CONNECTED_RAW_EVENT).Return(common.NewInternalError(errors.New("Error")))
+ writerMock.On("UpdateNodebInfoOnConnectionStatusInversion", &updatedNodebInfo, EventChannelForTest, RanName+"_"+CONNECTED_RAW_EVENT).Return(common.NewInternalError(errors.New("Error")))
err := ranConnectStatusChangeManager.ChangeStatus(origNodebInfo, entities.ConnectionStatus_CONNECTED)
assert.NotNil(t, err)
writerMock.AssertExpectations(t)
origNodebInfo := &entities.NodebInfo{RanName: ranName, ConnectionStatus: entities.ConnectionStatus_DISCONNECTED}
updatedNodebInfo := *origNodebInfo
updatedNodebInfo.ConnectionStatus = entities.ConnectionStatus_CONNECTED
- writerMock.On("UpdateNodebInfoOnConnectionStatusInversion", &updatedNodebInfo, EventChannelForTest, RanName + "_" + CONNECTED_RAW_EVENT).Return(nil)
+ writerMock.On("UpdateNodebInfoOnConnectionStatusInversion", &updatedNodebInfo, EventChannelForTest, RanName+"_"+CONNECTED_RAW_EVENT).Return(nil)
ranListManagerMock.On("UpdateRanState", &updatedNodebInfo).Return(nil)
ranAlarmServiceMock.On("SetConnectivityChangeAlarm", &updatedNodebInfo).Return(common.NewInternalError(errors.New("Error")))
err := ranConnectStatusChangeManager.ChangeStatus(origNodebInfo, entities.ConnectionStatus_CONNECTED)
writerMock.AssertExpectations(t)
ranListManagerMock.AssertExpectations(t)
ranAlarmServiceMock.AssertExpectations(t)
-}
\ No newline at end of file
+}
c.Called()
}
-func (c *NodebControllerMock) X2Setup(writer http.ResponseWriter, r *http.Request) {
- writer.Header().Set("Content-Type", "application/json")
- writer.WriteHeader(http.StatusOK)
-
- c.Called()
-}
-
-func (c *NodebControllerMock) EndcSetup(writer http.ResponseWriter, r *http.Request) {
+func (c *NodebControllerMock) UpdateGnb(writer http.ResponseWriter, r *http.Request) {
writer.Header().Set("Content-Type", "application/json")
writer.WriteHeader(http.StatusOK)
c.Called()
}
-func (c *NodebControllerMock) UpdateGnb(writer http.ResponseWriter, r *http.Request) {
+func (c *NodebControllerMock) AddEnb(writer http.ResponseWriter, r *http.Request) {
writer.Header().Set("Content-Type", "application/json")
writer.WriteHeader(http.StatusOK)
-
c.Called()
}
writer.WriteHeader(http.StatusOK)
c.Called()
-}
\ No newline at end of file
+}
--- /dev/null
+//
+// Copyright 2019 AT&T Intellectual Property
+// Copyright 2019 Nokia
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// This source code is part of the near-RT RIC (RAN Intelligent Controller)
+// platform project (RICP).
+
+package models
+
+import (
+ "encoding/json"
+ "gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/entities"
+ "github.com/golang/protobuf/jsonpb"
+)
+
+type AddEnbRawRequest struct {
+ RanName string
+ GlobalNbId json.RawMessage
+ Ip string
+ Port uint32
+ Enb json.RawMessage
+}
+
+type AddEnbRequest struct {
+ RanName string
+ GlobalNbId *entities.GlobalNbId
+ Ip string
+ Port uint32
+ Enb *entities.Enb
+}
+
+func (r *AddEnbRequest) UnmarshalJSON(data []byte) error {
+ addEnbRawRequest := AddEnbRawRequest{}
+ err := json.Unmarshal(data, &addEnbRawRequest)
+
+ if err != nil {
+ return err
+ }
+
+ r.RanName = addEnbRawRequest.RanName
+ r.Ip = addEnbRawRequest.Ip
+ r.Port = addEnbRawRequest.Port
+
+ globalNbId := entities.GlobalNbId{}
+ err = jsonpb.UnmarshalString(string(addEnbRawRequest.GlobalNbId), &globalNbId)
+
+ if err != nil {
+ return err
+ }
+
+ r.GlobalNbId = &globalNbId
+
+ enb := entities.Enb{}
+ err = jsonpb.UnmarshalString(string(addEnbRawRequest.Enb), &enb)
+
+ if err != nil {
+ return err
+ }
+
+ r.Enb = &enb
+ return nil
+}
\ No newline at end of file
--- /dev/null
+//
+// Copyright 2019 AT&T Intellectual Property
+// Copyright 2019 Nokia
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// This source code is part of the near-RT RIC (RAN Intelligent Controller)
+// platform project (RICP).
+
+package models
+
+import (
+ "e2mgr/e2managererrors"
+ "gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/entities"
+ "github.com/golang/protobuf/jsonpb"
+)
+
+type AddEnbResponse struct {
+ nodebInfo *entities.NodebInfo
+}
+
+func NewAddEnbResponse(nodebInfo *entities.NodebInfo) *AddEnbResponse {
+ return &AddEnbResponse{
+ nodebInfo: nodebInfo,
+ }
+}
+
+func (response *AddEnbResponse) Marshal() ([]byte, error) {
+ m := jsonpb.Marshaler{}
+ result, err := m.MarshalToString(response.nodebInfo)
+
+ if err != nil {
+ return nil, e2managererrors.NewInternalError()
+ }
+
+ return []byte(result), nil
+}
}
return []byte(result), nil
-
}
GetNodebIdListRequest IncomingRequest = "GetNodebIdListRequest"
GetE2TInstancesRequest IncomingRequest = "GetE2TInstancesRequest"
UpdateGnbRequest IncomingRequest = "UpdateGnbRequest"
+ AddEnbRequest IncomingRequest = "AddEnbRequest"
)
type IncomingRequestHandlerProvider struct {
GetNodebIdListRequest: httpmsghandlers.NewGetNodebIdListRequestHandler(logger, rNibDataService),
GetE2TInstancesRequest: httpmsghandlers.NewGetE2TInstancesRequestHandler(logger, e2tInstancesManager),
UpdateGnbRequest: httpmsghandlers.NewUpdateGnbRequestHandler(logger, rNibDataService),
+ AddEnbRequest: httpmsghandlers.NewAddEnbRequestHandler(logger, rNibDataService),
}
}
func setupTest(t *testing.T) *IncomingRequestHandlerProvider {
rmrMessengerMock := &mocks.RmrMessengerMock{}
log := initLog(t)
- config := &configuration.Configuration{RnibRetryIntervalMs: 10, MaxRnibConnectionAttempts: 3}
+ config := &configuration.Configuration{RnibRetryIntervalMs: 10, MaxRnibConnectionAttempts: 3, RnibWriter: configuration.RnibWriterConfig{StateChangeMessageChannel: "RAN_CONNECTION_STATUS_CHANGE", RanManipulationMessageChannel: "RAN_MANIPULATION"}}
config.RoutingManager.BaseUrl = "http://10.10.2.15:12020/routingmanager"
readerMock := &mocks.RnibReaderMock{}
writerMock := &mocks.RnibWriterMock{}
func initTestCase(t *testing.T) (*logger.Logger, *configuration.Configuration, services.RNibDataService, *rmrsender.RmrSender, managers.IE2TInstancesManager, clients.IRoutingManagerClient, *managers.E2TAssociationManager, managers.IRanConnectStatusChangeManager) {
logger := initLog(t)
- config := &configuration.Configuration{RnibRetryIntervalMs: 10, MaxRnibConnectionAttempts: 3}
+ config := &configuration.Configuration{RnibRetryIntervalMs: 10, MaxRnibConnectionAttempts: 3, RnibWriter: configuration.RnibWriterConfig{StateChangeMessageChannel: "RAN_CONNECTION_STATUS_CHANGE", RanManipulationMessageChannel: "RAN_MANIPULATION"}}
readerMock := &mocks.RnibReaderMock{}
writerMock := &mocks.RnibWriterMock{}
package rNibWriter
import (
+ "e2mgr/configuration"
"encoding/json"
"fmt"
"gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/common"
"github.com/golang/protobuf/proto"
)
-const E2TAddressesKey = "E2TAddresses"
+const (
+ E2TAddressesKey = "E2TAddresses"
+ RanAddedEvent = "ADDED"
+ RanUpdatedEvent = "UPDATED"
+ RanDeletedEvent = "DELETED"
+)
type rNibWriterInstance struct {
- sdl common.ISdlInstance
+ sdl common.ISdlInstance
+ rnibWriterConfig configuration.RnibWriterConfig
}
/*
GetRNibWriter returns reference to RNibWriter
*/
-func GetRNibWriter(sdl common.ISdlInstance) RNibWriter {
- return &rNibWriterInstance{sdl: sdl}
+func GetRNibWriter(sdl common.ISdlInstance, rnibWriterConfig configuration.RnibWriterConfig) RNibWriter {
+ return &rNibWriterInstance{sdl: sdl, rnibWriterConfig: rnibWriterConfig}
}
-
func (w *rNibWriterInstance) RemoveServedNrCells(inventoryName string, servedNrCells []*entities.ServedNRCell) error {
cellKeysToRemove := buildCellKeysToRemove(inventoryName, servedNrCells)
err := w.sdl.Remove(cellKeysToRemove)
func (w *rNibWriterInstance) SaveNodeb(nbIdentity *entities.NbIdentity, entity *entities.NodebInfo) error {
isNotEmptyIdentity := isNotEmpty(nbIdentity)
- if isNotEmptyIdentity && entity.GetNodeType() == entities.Node_UNKNOWN {
+ nodeType := entity.GetNodeType()
+
+ if isNotEmptyIdentity && nodeType == entities.Node_UNKNOWN {
return common.NewValidationError(fmt.Sprintf("#rNibWriter.saveNodeB - Unknown responding node type, entity: %v", entity))
}
+
data, err := proto.Marshal(entity)
+
if err != nil {
return common.NewInternalError(err)
}
+
var pairs []interface{}
key, rNibErr := common.ValidateAndBuildNodeBNameKey(nbIdentity.InventoryName)
+
if rNibErr != nil {
return rNibErr
}
+
pairs = append(pairs, key, data)
if isNotEmptyIdentity {
- key, rNibErr = common.ValidateAndBuildNodeBIdKey(entity.GetNodeType().String(), nbIdentity.GlobalNbId.GetPlmnId(), nbIdentity.GlobalNbId.GetNbId())
+
+ key, rNibErr = common.ValidateAndBuildNodeBIdKey(nodeType.String(), nbIdentity.GlobalNbId.GetPlmnId(), nbIdentity.GlobalNbId.GetNbId())
if rNibErr != nil {
return rNibErr
}
return rNibErr
}
}
+
if entity.GetGnb() != nil {
pairs, rNibErr = appendGnbCells(nbIdentity.InventoryName, entity.GetGnb().GetServedNrCells(), pairs)
if rNibErr != nil {
return rNibErr
}
}
- err = w.sdl.Set(pairs)
+
+ if nodeType == entities.Node_ENB {
+ err = w.sdl.SetAndPublish([]string{w.rnibWriterConfig.RanManipulationMessageChannel, fmt.Sprintf("%s_%s", entity.RanName, RanAddedEvent)}, pairs)
+ } else {
+ err = w.sdl.Set(pairs)
+ }
+
if err != nil {
return common.NewInternalError(err)
}
}
nbIdData, err := proto.Marshal(nbIdentity)
+
if err != nil {
return common.NewInternalError(err)
}
- err = w.sdl.AddMember(entity.GetNodeType().String(), nbIdData)
+
+ err = w.sdl.AddMember(nodeType.String(), nbIdData)
+
if err != nil {
return common.NewInternalError(err)
}
func isNotEmpty(nbIdentity *entities.NbIdentity) bool {
return nbIdentity.GlobalNbId != nil && nbIdentity.GlobalNbId.PlmnId != "" && nbIdentity.GlobalNbId.NbId != ""
-}
\ No newline at end of file
+}
package rNibWriter
import (
+ "e2mgr/configuration"
"e2mgr/mocks"
"encoding/json"
"errors"
)
var namespace = "namespace"
+
const (
RanName = "test"
)
func initSdlInstanceMock(namespace string) (w RNibWriter, sdlInstanceMock *mocks.MockSdlInstance) {
sdlInstanceMock = new(mocks.MockSdlInstance)
- w = GetRNibWriter(sdlInstanceMock)
+ w = GetRNibWriter(sdlInstanceMock, configuration.RnibWriterConfig{StateChangeMessageChannel: "RAN_CONNECTION_STATUS_CHANGE", RanManipulationMessageChannel: "RAN_MANIPULATION"})
return
}
ranName := "RAN:" + name
w, sdlInstanceMock := initSdlInstanceMock(namespace)
nb := entities.NodebInfo{}
+ nb.RanName = name
nb.NodeType = entities.Node_ENB
nb.ConnectionStatus = 1
nb.Ip = "localhost"
setExpected = append(setExpected, fmt.Sprintf("CELL:%s", cell.GetCellId()), cellData)
setExpected = append(setExpected, fmt.Sprintf("PCI:%s:%02x", name, cell.GetPci()), cellData)
- sdlInstanceMock.On("Set", []interface{}{setExpected}).Return(e)
+ sdlInstanceMock.On("SetAndPublish", []string{"RAN_MANIPULATION", name + "_" + RanAddedEvent}, []interface{}{setExpected}).Return(e)
nbIdData, err := proto.Marshal(&entities.NbIdentity{InventoryName: name})
if err != nil {
nbId := "4a952a0a"
channelName := "RAN_CONNECT_STATE_CHANGE"
eventName := inventoryName + "_" + "CONNECTED"
- w, sdlInstanceMock := initSdlInstanceMock(namespace)
+ w, sdlInstanceMock := initSdlInstanceMock(namespace)
nodebInfo := generateNodebInfo(inventoryName, entities.Node_ENB, plmnId, nbId)
data, err := proto.Marshal(nodebInfo)
if err != nil {
configuration := &entities.GeneralConfiguration{}
configuration.EnableRic = true
- sdlInstanceMock.On("Set",[]interface{}{[]interface{}{key, []byte(configurationData)}}).Return(nil)
+ sdlInstanceMock.On("Set", []interface{}{[]interface{}{key, []byte(configurationData)}}).Return(nil)
rNibErr := w.SaveGeneralConfiguration(configuration)
assert.Nil(t, rNibErr)
expectedErr := errors.New("expected error")
- sdlInstanceMock.On("Set",[]interface{}{[]interface{}{key, []byte(configurationData)}}).Return(expectedErr)
+ sdlInstanceMock.On("Set", []interface{}{[]interface{}{key, []byte(configurationData)}}).Return(expectedErr)
rNibErr := w.SaveGeneralConfiguration(configuration)
assert.NotNil(t, rNibErr)
port: 3801
maxMsgSize: 65536
routingManager:
- baseUrl: http://10.0.2.15:12020/ric/v1/handles/
+ baseUrl: http://10.0.2.15:31000/ric/v1/handles/
notificationResponseBuffer: 100
bigRedButtonTimeoutSec: 5
maxRnibConnectionAttempts: 3
ricId: "AACCE"
mcc: "310"
mnc: "411"
-stateChangeMessageChannel: RAN_CONNECTION_STATUS_CHANGE
\ No newline at end of file
+rnibWriter:
+ stateChangeMessageChannel: RAN_CONNECTION_STATUS_CHANGE
+ ranManipulationMessageChannel: RAN_MANIPULATION
\ No newline at end of file
newrt|start
-rte|10060|10.0.2.15:38000
-rte|10360|10.0.2.15:38000
-rte|10070|10.0.2.15:38000
-rte|10071|10.0.2.15:38000
+rte|10060|10.0.2.15:30500
+rte|10360|10.0.2.15:30500
+rte|10070|10.0.2.15:30500
+rte|10071|10.0.2.15:30500
rte|10061|10.0.2.15:3801
rte|10361|10.0.2.15:3801
rte|10062|10.0.2.15:3801
rte|1080|10.0.2.15:3801
rte|10020|10.0.2.15:3801
rte|10370|10.0.2.15:3801
-rte|10371|10.0.2.15:38000
-rte|10372|10.0.2.15:38000
+rte|10371|10.0.2.15:30500
+rte|10372|10.0.2.15:30500
rte|10080|10.0.2.15:3801
-rte|10081|10.0.2.15:38000
-rte|10082|10.0.2.15:38000
-rte|1090|10.0.2.15:38000
-rte|1200|10.0.2.15:4801
-rte|1210|10.0.2.15:4801
-rte|1220|10.0.2.15:4801
-rte|10090|10.0.2.15:38000
-rte|1101|10.0.2.15:38000
-rte|12002|10.0.2.15:38000
-rte|12003|10.0.2.15:38000
-mse|12002,10.0.2.15:38000|-1|gnb:208-092-303030
-mse|12003,10.0.2.15:38000|-1|gnb:208-092-303030
+rte|10081|10.0.2.15:30500
+rte|10082|10.0.2.15:30500
+rte|1090|10.0.2.15:30500
+rte|10090|10.0.2.15:30500
+rte|1101|10.0.2.15:30500
+rte|12002|10.0.2.15:30500
+rte|12003|10.0.2.15:30500
+mse|12002,10.0.2.15:30500|-1|gnb:208-092-303030
+mse|12003,10.0.2.15:30500|-1|gnb:208-092-303030
newrt|end
}
type rNibDataService struct {
- logger *logger.Logger
- rnibReader reader.RNibReader
- rnibWriter rNibWriter.RNibWriter
- maxAttempts int
- retryInterval time.Duration
- stateChangeMessageChannel string
+ logger *logger.Logger
+ rnibReader reader.RNibReader
+ rnibWriter rNibWriter.RNibWriter
+ maxAttempts int
+ retryInterval time.Duration
+ rnibWriterConfig configuration.RnibWriterConfig
}
func NewRnibDataService(logger *logger.Logger, config *configuration.Configuration, rnibReader reader.RNibReader, rnibWriter rNibWriter.RNibWriter) *rNibDataService {
return &rNibDataService{
- logger: logger,
- rnibReader: rnibReader,
- rnibWriter: rnibWriter,
- maxAttempts: config.MaxRnibConnectionAttempts,
- retryInterval: time.Duration(config.RnibRetryIntervalMs) * time.Millisecond,
- stateChangeMessageChannel: config.StateChangeMessageChannel,
+ logger: logger,
+ rnibReader: rnibReader,
+ rnibWriter: rnibWriter,
+ maxAttempts: config.MaxRnibConnectionAttempts,
+ retryInterval: time.Duration(config.RnibRetryIntervalMs) * time.Millisecond,
+ rnibWriterConfig: config.RnibWriter,
}
}
}
func (w *rNibDataService) UpdateNodebInfoOnConnectionStatusInversion(nodebInfo *entities.NodebInfo, event string) error {
- w.logger.Infof("#RnibDataService.UpdateNodebInfoOnConnectionStatusInversion - stateChangeMessageChannel: %s, event: %s, nodebInfo: %s", w.stateChangeMessageChannel, event, nodebInfo)
+ w.logger.Infof("#RnibDataService.UpdateNodebInfoOnConnectionStatusInversion - stateChangeMessageChannel: %s, event: %s, nodebInfo: %s", w.rnibWriterConfig.StateChangeMessageChannel, event, nodebInfo)
err := w.retry("UpdateNodebInfoOnConnectionStatusInversion", func() (err error) {
- err = w.rnibWriter.UpdateNodebInfoOnConnectionStatusInversion(nodebInfo, w.stateChangeMessageChannel, event)
+ err = w.rnibWriter.UpdateNodebInfoOnConnectionStatusInversion(nodebInfo, w.rnibWriterConfig.StateChangeMessageChannel, event)
return
})
"testing"
)
-const CHANNEL_NAME = "channel"
-
func setupRnibDataServiceTest(t *testing.T) (*rNibDataService, *mocks.RnibReaderMock, *mocks.RnibWriterMock) {
return setupRnibDataServiceTestWithMaxAttempts(t, 3)
}
t.Errorf("#... - failed to initialize logger, error: %s", err)
}
- config := &configuration.Configuration{RnibRetryIntervalMs: 10, MaxRnibConnectionAttempts: maxAttempts, StateChangeMessageChannel: CHANNEL_NAME}
+ config := &configuration.Configuration{RnibRetryIntervalMs: 10, MaxRnibConnectionAttempts: maxAttempts, RnibWriter: configuration.RnibWriterConfig{RanManipulationMessageChannel: "RAN_MANIPULATION", StateChangeMessageChannel: "RAN_CONNECTION_STATUS_CHANGE"}}
readerMock := &mocks.RnibReaderMock{}
event := "event"
nodebInfo := &entities.NodebInfo{}
- writerMock.On("UpdateNodebInfoOnConnectionStatusInversion", nodebInfo, CHANNEL_NAME, event).Return(nil)
+ writerMock.On("UpdateNodebInfoOnConnectionStatusInversion", nodebInfo, "RAN_CONNECTION_STATUS_CHANGE", event).Return(nil)
rnibDataService.UpdateNodebInfoOnConnectionStatusInversion(nodebInfo, event)
writerMock.AssertNumberOfCalls(t, "UpdateNodebInfoOnConnectionStatusInversion", 1)
nodebInfo := &entities.NodebInfo{}
mockErr := &common.InternalError{Err: &net.OpError{Err: fmt.Errorf("connection error")}}
- writerMock.On("UpdateNodebInfoOnConnectionStatusInversion", nodebInfo, CHANNEL_NAME, event).Return(mockErr)
+ writerMock.On("UpdateNodebInfoOnConnectionStatusInversion", nodebInfo, "RAN_CONNECTION_STATUS_CHANGE", event).Return(mockErr)
rnibDataService.UpdateNodebInfoOnConnectionStatusInversion(nodebInfo, event)
writerMock.AssertNumberOfCalls(t, "UpdateNodebInfoOnConnectionStatusInversion", 3)
--- /dev/null
+################################################################################
+# Copyright (c) 2019 AT&T Intellectual Property. #
+# Copyright (c) 2019 Nokia. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+################################################################################
+
+apiVersion: v1
+kind: ConfigMap
+metadata:
+ name: configmap-ricplt-e2term-env-alpha
+data:
+ RMR_SRC_ID: service-ricplt-e2term-rmr-alpha.ricplt
+ SERVICE_RICPLT_E2TERM_RMR_ALPHA_SERVICE_HOST: "10.0.2.15"
+ RMR_RTG_SVC: "4561"
+ RMR_VCTL_FILE: "/tmp/rmr_verbose"
+ sctp: "36422"
+ nano: "30500"
+ print: "1"
+ volume: /data/outgoing/
--- /dev/null
+#
+#==================================================================================
+# Copyright (c) 2019 AT&T Intellectual Property.
+# Copyright (c) 2019 Nokia
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#==================================================================================
+#
+#
+# Abstract: Configuration values for the routing manager
+# Date: 29 May 2019
+#
+apiVersion: v1
+kind: ConfigMap
+metadata:
+ name: configmap-ricplt-rtmgr-rtmgrcfg
+data:
+ # FQDN and port info of the platform components for routing manager to form
+ # and distribute corresponding routes to them
+ rtmgrcfg: |
+ "PlatformComponents":
+ -
+ "name": "SUBMAN"
+ "fqdn": "service-ricplt-submgr-rmr.ricplt"
+ "port": 4560
+ -
+ "name": "E2MAN"
+ "fqdn": "10.0.2.15"
+ "port": 3801
+ -
+ "name": "RSM"
+ "fqdn": "service-ricplt-rsm-rmr.ricplt"
+ "port": 4801
+ -
+ "name": "A1MEDIATOR"
+ "fqdn": "service-ricplt-a1mediator-rmr.ricplt"
+ "port": 4562
+ "XMURL":
+ "http://service-ricplt-appmgr-http:8080/ric/v1/xapps"
+ "E2MURL":
+ "http://10.0.2.15:3800/v1/e2t/list"
+ "RTFILE":
+ "/db/rt.json"
+ "CFGFILE":
+ "/cfg/rtmgr-config.yaml"
+ "RPE":
+ "rmrpush"
+ "SBI":
+ "nngpush"
+ "SBIURL":
+ "0.0.0.0"
+ "NBI":
+ "httpRESTful"
+ "NBIURL":
+ "http://10.0.2.15:31000"
+ "SDL":
+ "file"
+ "local":
+ "host": ":8080"
+ "logger":
+ "level": 4
+ "rmr":
+ "protPort": "tcp:31500"
+ "maxSize": 4096
+ "numWorkers": 1
+ "threadType": 1
+ "maxrecord": 50
+ "PlatformRoutes": [
+ { 'messagetype': 'RIC_SUB_REQ', 'senderendpoint': 'SUBMAN', 'subscriptionid': -1, 'endpoint': '', 'meid': '%meid'},
+ { 'messagetype': 'RIC_SUB_DEL_REQ', 'senderendpoint': 'SUBMAN', 'subscriptionid': -1,'endpoint': '', 'meid': '%meid'},
+ { 'messagetype': 'RIC_SUB_RESP', 'senderendpoint': '', 'subscriptionid': -1, 'endpoint': 'SUBMAN', 'meid': ''},
+ { 'messagetype': 'RIC_SUB_DEL_RESP', 'senderendpoint': '', 'subscriptionid': -1, 'endpoint': 'SUBMAN', 'meid': ''},
+ { 'messagetype': 'RIC_SUB_FAILURE', 'senderendpoint': '', 'subscriptionid': -1, 'endpoint': 'SUBMAN', 'meid': ''},
+ { 'messagetype': 'RIC_SUB_DEL_FAILURE', 'senderendpoint': '', 'subscriptionid': -1, 'endpoint': 'SUBMAN', 'meid': ''},
+ { 'messagetype': 'RIC_X2_SETUP_REQ', 'senderendpoint': 'E2MAN', 'subscriptionid': -1, 'endpoint': '', 'meid': '%meid'},
+ { 'messagetype': 'RIC_X2_RESET', 'senderendpoint': 'E2MAN', 'subscriptionid': -1, 'endpoint': '', 'meid': '%meid'},
+ { 'messagetype': 'RIC_X2_RESET_RESP', 'senderendpoint': 'E2MAN', 'subscriptionid': -1, 'endpoint': '', 'meid': '%meid'},
+ { 'messagetype': 'RIC_ENDC_X2_SETUP_REQ', 'senderendpoint': 'E2MAN', 'subscriptionid': -1, 'endpoint': '', 'meid': '%meid'},
+ { 'messagetype': 'RIC_ENB_CONF_UPDATE_ACK', 'senderendpoint': 'E2MAN', 'subscriptionid': -1, 'endpoint': '', 'meid': '%meid'},
+ { 'messagetype': 'RIC_ENB_CONF_UPDATE_FAILURE', 'senderendpoint': 'E2MAN', 'subscriptionid': -1, 'endpoint': '', 'meid': '%meid'},
+ { 'messagetype': 'RIC_ENDC_CONF_UPDATE_ACK', 'senderendpoint': 'E2MAN', 'subscriptionid': -1, 'endpoint': '', 'meid': '%meid'},
+ { 'messagetype': 'RIC_ENDC_CONF_UPDATE_FAILURE', 'senderendpoint': 'E2MAN', 'subscriptionid': -1, 'endpoint': '', 'meid': '%meid'},
+ { 'messagetype': 'RIC_E2_SETUP_REQ', 'senderendpoint': '', 'subscriptionid': -1, 'endpoint': 'E2MAN', 'meid': ''},
+ { 'messagetype': 'E2_TERM_INIT', 'senderendpoint': '', 'subscriptionid': -1, 'endpoint': 'E2MAN', 'meid': ''},
+ { 'messagetype': 'RIC_X2_SETUP_RESP', 'senderendpoint': '', 'subscriptionid': -1, 'endpoint': 'E2MAN', 'meid': ''},
+ { 'messagetype': 'RIC_X2_SETUP_FAILURE', 'senderendpoint': '', 'subscriptionid': -1, 'endpoint': 'E2MAN', 'meid': ''},
+ { 'messagetype': 'RIC_X2_RESET', 'senderendpoint': '', 'subscriptionid': -1, 'endpoint': 'E2MAN', 'meid': ''},
+ { 'messagetype': 'RIC_X2_RESET_RESP', 'senderendpoint': '', 'subscriptionid': -1, 'endpoint': 'E2MAN', 'meid': ''},
+ { 'messagetype': 'RIC_ENDC_X2_SETUP_RESP', 'senderendpoint': '', 'subscriptionid': -1, 'endpoint': 'E2MAN', 'meid': ''},
+ { 'messagetype': 'RIC_ENDC_X2_SETUP_FAILURE', 'senderendpoint': '', 'subscriptionid': -1, 'endpoint': 'E2MAN', 'meid': ''},
+ { 'messagetype': 'RIC_ENDC_CONF_UPDATE', 'senderendpoint': '', 'subscriptionid': -1, 'endpoint': 'E2MAN', 'meid': ''},
+ { 'messagetype': 'RIC_SCTP_CONNECTION_FAILURE', 'senderendpoint': '', 'subscriptionid': -1, 'endpoint': 'E2MAN', 'meid': ''},
+ { 'messagetype': 'RIC_ERROR_INDICATION', 'senderendpoint': '', 'subscriptionid': -1, 'endpoint': 'E2MAN', 'meid': ''},
+ { 'messagetype': 'RIC_ENB_CONF_UPDATE', 'senderendpoint': '', 'subscriptionid': -1, 'endpoint': 'E2MAN', 'meid': ''},
+ { 'messagetype': 'RIC_ENB_LOAD_INFORMATION', 'senderendpoint': '', 'subscriptionid': -1, 'endpoint': 'E2MAN', 'meid': ''},
+ { 'messagetype': 'E2_TERM_KEEP_ALIVE_RESP', 'senderendpoint': '', 'subscriptionid': -1, 'endpoint': 'E2MAN', 'meid': ''},
+ { 'messagetype': 'RAN_CONNECTED', 'senderendpoint': 'E2MAN', 'subscriptionid': -1, 'endpoint': 'RSM', 'meid': ''},
+ { 'messagetype': 'RAN_RESTARTED', 'senderendpoint': 'E2MAN', 'subscriptionid': -1, 'endpoint': 'RSM', 'meid': ''},
+ { 'messagetype': 'RAN_RECONFIGURED', 'senderendpoint': 'E2MAN', 'subscriptionid': -1, 'endpoint': 'RSM', 'meid': ''},
+ { 'messagetype': 'RIC_RES_STATUS_REQ', 'senderendpoint': 'RSM', 'subscriptionid': -1, 'endpoint': '', 'meid': '%meid'},
+ { 'messagetype': 'RIC_RES_STATUS_RESP', 'senderendpoint': '', 'subscriptionid': -1, 'endpoint': 'RSM', 'meid': ''},
+ { 'messagetype': 'RIC_RES_STATUS_FAILURE', 'senderendpoint': '', 'subscriptionid': -1, 'endpoint': 'RSM', 'meid': ''},
+ { 'messagetype': 'A1_POLICY_QUERY', 'senderendpoint': '', 'subscriptionid': -1, 'endpoint': 'A1MEDIATOR', 'meid': ''},
+ { 'messagetype': 'A1_POLICY_RESP', 'senderendpoint': '', 'subscriptionid': -1, 'endpoint': 'A1MEDIATOR', 'meid': ''},
+ ]
+
--- /dev/null
+###############################################################################
+# Copyright (c) 2019 AT&T Intellectual Property. #
+# Copyright (c) 2019 Nokia. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+################################################################################
+apiVersion: v1
+kind: ConfigMap
+metadata:
+ name: configmap-ricplt-rtmgr-env
+data:
+ RMR_SEED_RT: /uta_rtg_ric.rt
+ RMR_RTG_SVC: "32000"
+ CFGFILE: /cfg/rtmgr-config.yaml
+ RMR_SRC_ID: 10.0.2.15
+ XMURL: http://service-ricplt-appmgr-http:8080/ric/v1/xapps
--- /dev/null
+################################################################################
+# Copyright (c) 2019 AT&T Intellectual Property. #
+# Copyright (c) 2019 Nokia. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+################################################################################
+
+apiVersion: v1
+kind: ConfigMap
+metadata:
+ name: configmap-ricplt-e2term-env-alpha
+data:
+ RMR_SRC_ID: service-ricplt-e2term-rmr-alpha.ricplt
+ RMR_RTG_SVC: "4561"
+ RMR_SEED_RT: "router.txt"
+ RMR_VCTL_FILE: "/tmp/rmr_verbose"
+ sctp: "36422"
+ nano: "38000"
+ print: "1"
+ volume: /data/outgoing/
--- /dev/null
+#
+#==================================================================================
+# Copyright (c) 2019 AT&T Intellectual Property.
+# Copyright (c) 2019 Nokia
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#==================================================================================
+#
+#
+# Abstract: Configuration values for the routing manager
+# Date: 29 May 2019
+#
+apiVersion: v1
+kind: ConfigMap
+metadata:
+ name: configmap-ricplt-rtmgr-rtmgrcfg
+data:
+ # FQDN and port info of the platform components for routing manager to form
+ # and distribute corresponding routes to them
+ rtmgrcfg: |
+ "PlatformComponents":
+ -
+ "name": "SUBMAN"
+ "fqdn": "service-ricplt-submgr-rmr.ricplt"
+ "port": 4560
+ -
+ "name": "E2MAN"
+ "fqdn": "service-ricplt-e2mgr-rmr.ricplt"
+ "port": 3801
+ -
+ "name": "RSM"
+ "fqdn": "service-ricplt-rsm-rmr.ricplt"
+ "port": 4801
+ -
+ "name": "A1MEDIATOR"
+ "fqdn": "service-ricplt-a1mediator-rmr.ricplt"
+ "port": 4562
+ "XMURL":
+ "http://service-ricplt-appmgr-http:8080/ric/v1/xapps"
+ "E2MURL":
+ "http://service-ricplt-e2mgr-http:3800/v1/e2t/list"
+ "RTFILE":
+ "/db/rt.json"
+ "CFGFILE":
+ "/cfg/rtmgr-config.yaml"
+ "RPE":
+ "rmrpush"
+ "SBI":
+ "nngpush"
+ "SBIURL":
+ "0.0.0.0"
+ "NBI":
+ "httpRESTful"
+ "NBIURL":
+ "http://service-ricplt-rtmgr-http:3800"
+ "SDL":
+ "file"
+ "local":
+ "host": ":8080"
+ "logger":
+ "level": 4
+ "rmr":
+ "protPort": "tcp:4560"
+ "maxSize": 4096
+ "numWorkers": 1
+ "threadType": 1
+ "maxrecord": 50
+ "PlatformRoutes": [
+ { 'messagetype': 'RIC_SUB_REQ', 'senderendpoint': 'SUBMAN', 'subscriptionid': -1, 'endpoint': '', 'meid': '%meid'},
+ { 'messagetype': 'RIC_SUB_DEL_REQ', 'senderendpoint': 'SUBMAN', 'subscriptionid': -1,'endpoint': '', 'meid': '%meid'},
+ { 'messagetype': 'RIC_SUB_RESP', 'senderendpoint': '', 'subscriptionid': -1, 'endpoint': 'SUBMAN', 'meid': ''},
+ { 'messagetype': 'RIC_SUB_DEL_RESP', 'senderendpoint': '', 'subscriptionid': -1, 'endpoint': 'SUBMAN', 'meid': ''},
+ { 'messagetype': 'RIC_SUB_FAILURE', 'senderendpoint': '', 'subscriptionid': -1, 'endpoint': 'SUBMAN', 'meid': ''},
+ { 'messagetype': 'RIC_SUB_DEL_FAILURE', 'senderendpoint': '', 'subscriptionid': -1, 'endpoint': 'SUBMAN', 'meid': ''},
+ { 'messagetype': 'RIC_X2_SETUP_REQ', 'senderendpoint': 'E2MAN', 'subscriptionid': -1, 'endpoint': '', 'meid': '%meid'},
+ { 'messagetype': 'RIC_X2_RESET', 'senderendpoint': 'E2MAN', 'subscriptionid': -1, 'endpoint': '', 'meid': '%meid'},
+ { 'messagetype': 'RIC_X2_RESET_RESP', 'senderendpoint': 'E2MAN', 'subscriptionid': -1, 'endpoint': '', 'meid': '%meid'},
+ { 'messagetype': 'RIC_ENDC_X2_SETUP_REQ', 'senderendpoint': 'E2MAN', 'subscriptionid': -1, 'endpoint': '', 'meid': '%meid'},
+ { 'messagetype': 'RIC_ENB_CONF_UPDATE_ACK', 'senderendpoint': 'E2MAN', 'subscriptionid': -1, 'endpoint': '', 'meid': '%meid'},
+ { 'messagetype': 'RIC_ENB_CONF_UPDATE_FAILURE', 'senderendpoint': 'E2MAN', 'subscriptionid': -1, 'endpoint': '', 'meid': '%meid'},
+ { 'messagetype': 'RIC_ENDC_CONF_UPDATE_ACK', 'senderendpoint': 'E2MAN', 'subscriptionid': -1, 'endpoint': '', 'meid': '%meid'},
+ { 'messagetype': 'RIC_ENDC_CONF_UPDATE_FAILURE', 'senderendpoint': 'E2MAN', 'subscriptionid': -1, 'endpoint': '', 'meid': '%meid'},
+ { 'messagetype': 'RIC_E2_SETUP_REQ', 'senderendpoint': '', 'subscriptionid': -1, 'endpoint': 'E2MAN', 'meid': ''},
+ { 'messagetype': 'E2_TERM_INIT', 'senderendpoint': '', 'subscriptionid': -1, 'endpoint': 'E2MAN', 'meid': ''},
+ { 'messagetype': 'RIC_X2_SETUP_RESP', 'senderendpoint': '', 'subscriptionid': -1, 'endpoint': 'E2MAN', 'meid': ''},
+ { 'messagetype': 'RIC_X2_SETUP_FAILURE', 'senderendpoint': '', 'subscriptionid': -1, 'endpoint': 'E2MAN', 'meid': ''},
+ { 'messagetype': 'RIC_X2_RESET', 'senderendpoint': '', 'subscriptionid': -1, 'endpoint': 'E2MAN', 'meid': ''},
+ { 'messagetype': 'RIC_X2_RESET_RESP', 'senderendpoint': '', 'subscriptionid': -1, 'endpoint': 'E2MAN', 'meid': ''},
+ { 'messagetype': 'RIC_ENDC_X2_SETUP_RESP', 'senderendpoint': '', 'subscriptionid': -1, 'endpoint': 'E2MAN', 'meid': ''},
+ { 'messagetype': 'RIC_ENDC_X2_SETUP_FAILURE', 'senderendpoint': '', 'subscriptionid': -1, 'endpoint': 'E2MAN', 'meid': ''},
+ { 'messagetype': 'RIC_ENDC_CONF_UPDATE', 'senderendpoint': '', 'subscriptionid': -1, 'endpoint': 'E2MAN', 'meid': ''},
+ { 'messagetype': 'RIC_SCTP_CONNECTION_FAILURE', 'senderendpoint': '', 'subscriptionid': -1, 'endpoint': 'E2MAN', 'meid': ''},
+ { 'messagetype': 'RIC_ERROR_INDICATION', 'senderendpoint': '', 'subscriptionid': -1, 'endpoint': 'E2MAN', 'meid': ''},
+ { 'messagetype': 'RIC_ENB_CONF_UPDATE', 'senderendpoint': '', 'subscriptionid': -1, 'endpoint': 'E2MAN', 'meid': ''},
+ { 'messagetype': 'RIC_ENB_LOAD_INFORMATION', 'senderendpoint': '', 'subscriptionid': -1, 'endpoint': 'E2MAN', 'meid': ''},
+ { 'messagetype': 'E2_TERM_KEEP_ALIVE_RESP', 'senderendpoint': '', 'subscriptionid': -1, 'endpoint': 'E2MAN', 'meid': ''},
+ { 'messagetype': 'RAN_CONNECTED', 'senderendpoint': 'E2MAN', 'subscriptionid': -1, 'endpoint': 'RSM', 'meid': ''},
+ { 'messagetype': 'RAN_RESTARTED', 'senderendpoint': 'E2MAN', 'subscriptionid': -1, 'endpoint': 'RSM', 'meid': ''},
+ { 'messagetype': 'RAN_RECONFIGURED', 'senderendpoint': 'E2MAN', 'subscriptionid': -1, 'endpoint': 'RSM', 'meid': ''},
+ { 'messagetype': 'RIC_RES_STATUS_REQ', 'senderendpoint': 'RSM', 'subscriptionid': -1, 'endpoint': '', 'meid': '%meid'},
+ { 'messagetype': 'RIC_RES_STATUS_RESP', 'senderendpoint': '', 'subscriptionid': -1, 'endpoint': 'RSM', 'meid': ''},
+ { 'messagetype': 'RIC_RES_STATUS_FAILURE', 'senderendpoint': '', 'subscriptionid': -1, 'endpoint': 'RSM', 'meid': ''},
+ { 'messagetype': 'A1_POLICY_QUERY', 'senderendpoint': '', 'subscriptionid': -1, 'endpoint': 'A1MEDIATOR', 'meid': ''},
+ { 'messagetype': 'A1_POLICY_RESP', 'senderendpoint': '', 'subscriptionid': -1, 'endpoint': 'A1MEDIATOR', 'meid': ''},
+ ]
+
--- /dev/null
+###############################################################################
+# Copyright (c) 2019 AT&T Intellectual Property. #
+# Copyright (c) 2019 Nokia. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+################################################################################
+apiVersion: v1
+kind: ConfigMap
+metadata:
+ name: configmap-ricplt-rtmgr-env
+data:
+ RMR_SEED_RT: /uta_rtg_ric.rt
+ RMR_RTG_SVC: "4561"
+ CFGFILE: /cfg/rtmgr-config.yaml
+ RMR_SRC_ID: service-ricplt-rtmgr-rmr.ricplt
+ XMURL: http://service-ricplt-appmgr-http:8080/ric/v1/xapps
--- /dev/null
+# Please edit the object below. Lines beginning with a '#' will be ignored,
+# and an empty file will abort the edit. If an error occurs while saving this file will be
+# reopened with the relevant failures.
+#
+apiVersion: v1
+data:
+ RMR_RTG_SVC: "4561"
+ RMR_SRC_ID: service-ricplt-e2term-rmr-alpha.ricplt
+ RMR_VCTL_FILE: /tmp/rmr_verbose
+ nano: "30500"
+ print: "1"
+ sctp: "36422"
+ volume: /data/outgoing/
+ SERVICE_RICPLT_E2TERM_RMR_ALPHA_SERVICE_HOST: "10.0.2.15"
+kind: ConfigMap
+metadata:
+ creationTimestamp: "2020-06-29T11:02:03Z"
+ name: configmap-ricplt-e2term-env-alpha
+ namespace: ricplt
+ resourceVersion: "1503723"
+ selfLink: /api/v1/namespaces/ricplt/configmaps/configmap-ricplt-e2term-env-alpha
+ uid: e0f50ef9-8690-4a48-a9ff-f3c747f9fdd5
--- /dev/null
+################################################################################
+# Copyright (c) 2019 AT&T Intellectual Property. #
+# Copyright (c) 2019 Nokia. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+################################################################################
+#
+apiVersion: v1
+kind: Service
+metadata:
+ name: service-ricplt-dbaas-node-port
+ namespace: ricplt
+ labels:
+ app: ricplt-dbaas
+ chart: dbass-2.0.0
+ release: r4-dbaas
+ heritage: Tiller
+spec:
+ type: NodePort
+ ports:
+ - port: 6379
+ nodePort: 30000
+ protocol: "TCP"
+ targetPort: 6379
+ name: "dbass-node-port"
+ selector:
+ app: ricplt-dbaas
+ release: r4-dbaas
+
--- /dev/null
+################################################################################
+# Copyright (c) 2019 AT&T Intellectual Property. #
+# Copyright (c) 2019 Nokia. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+################################################################################
+#
+apiVersion: v1
+kind: Service
+metadata:
+ name: service-ricplt-e2term-rmr-alpha-nodeport
+ namespace: ricplt
+ labels:
+ app: ricplt-e2term
+ chart: e2term-3.0.0
+ release: r4-e2term
+ heritage: Tiller
+spec:
+ type: NodePort
+ ports:
+ - port: 30500
+ nodePort: 30500
+ protocol: "TCP"
+ targetPort: 30500
+ name: "e2term-rmr-tcp-nodeport"
+ selector:
+ app: ricplt-e2term
+ release: r4-e2term
+
--- /dev/null
+################################################################################
+# Copyright (c) 2019 AT&T Intellectual Property. #
+# Copyright (c) 2019 Nokia. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+################################################################################
+#
+apiVersion: v1
+kind: Service
+metadata:
+ name: service-ricplt-rtmgr-http-nodeport
+ namespace: ricplt
+ labels:
+ app: ricplt-rtmgr
+ chart: rtmgr-3.0.0
+ release: r4-rtmgr
+ heritage: Tiller
+spec:
+ type: NodePort
+ ports:
+ - port: 31000
+ nodePort: 31000
+ protocol: "TCP"
+ targetPort: 31000
+ name: "rtmgr-http-nodeport"
+ selector:
+ app: ricplt-rtmgr
+ release: r4-rtmgr
+
--- /dev/null
+################################################################################
+# Copyright (c) 2019 AT&T Intellectual Property. #
+# Copyright (c) 2019 Nokia. #
+# #
+# Licensed under the Apache License, Version 2.0 (the "License"); #
+# you may not use this file except in compliance with the License. #
+# You may obtain a copy of the License at #
+# #
+# http://www.apache.org/licenses/LICENSE-2.0 #
+# #
+# Unless required by applicable law or agreed to in writing, software #
+# distributed under the License is distributed on an "AS IS" BASIS, #
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
+# See the License for the specific language governing permissions and #
+# limitations under the License. #
+################################################################################
+#
+apiVersion: v1
+kind: Service
+metadata:
+ name: service-ricplt-rtmgr-rmr-nodeport
+ namespace: ricplt
+ labels:
+ app: ricplt-rtmgr
+ chart: rtmgr-3.0.0
+ release: r4-rtmgr
+ heritage: Tiller
+spec:
+ type: NodePort
+ ports:
+ - port: 31500
+ nodePort: 31500
+ protocol: "TCP"
+ targetPort: 31500
+ name: "rtmgr-rmr-nodeport"
+ - port: 32000
+ nodePort: 32000
+ protocol: "TCP"
+ targetPort: 32000
+ name: "rtmgr-rmr-route-nodeport"
+
+ selector:
+ app: ricplt-rtmgr
+ release: r4-rtmgr
+