X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=E2Manager%2Fhandlers%2Frmrmsghandlers%2Fe2_setup_request_notification_handler_test.go;h=aff0ebba6a7360e13d277a928583a8eda8d9122d;hb=0f06f71ca88aeedf1239fdc0f3f4cb7fa0ab9823;hp=d3a7ae269258c4e248c4fa426c8b4e25b00b24d8;hpb=44ec41750c0592938e23f89b9b5ba1044062366c;p=ric-plt%2Fe2mgr.git
diff --git a/E2Manager/handlers/rmrmsghandlers/e2_setup_request_notification_handler_test.go b/E2Manager/handlers/rmrmsghandlers/e2_setup_request_notification_handler_test.go
index d3a7ae2..aff0ebb 100644
--- a/E2Manager/handlers/rmrmsghandlers/e2_setup_request_notification_handler_test.go
+++ b/E2Manager/handlers/rmrmsghandlers/e2_setup_request_notification_handler_test.go
@@ -1,7 +1,7 @@
//
// Copyright 2019 AT&T Intellectual Property
// Copyright 2019 Nokia
-// Copyright (c) 2020 Samsung Electronics Co., Ltd. All Rights Reserved.
+// Copyright (c) 2022 Samsung Electronics Co., Ltd. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -32,11 +32,12 @@ import (
"e2mgr/utils"
"encoding/xml"
"errors"
+ "testing"
+
"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/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
- "testing"
)
const (
@@ -50,9 +51,9 @@ const (
NgEnbSetupRequestXmlPath = "../../tests/resources/setupRequest/setupRequest_ng-eNB.xml"
EnbSetupRequestXmlPath = "../../tests/resources/setupRequest/setupRequest_enb.xml"
GnbWithoutFunctionsSetupRequestXmlPath = "../../tests/resources/setupRequest/setupRequest_gnb_without_functions.xml"
- E2SetupFailureResponseWithMiscCause = "1131"
- E2SetupFailureResponseWithTransportCause = "1131"
- E2SetupFailureResponseWithRicCause = "1131"
+ E2SetupFailureResponseWithMiscCause = "1491131"
+ E2SetupFailureResponseWithTransportCause = "1491131"
+ E2SetupFailureResponseWithRicCause = "1491131"
StateChangeMessageChannel = "RAN_CONNECTION_STATUS_CHANGE"
)
@@ -468,6 +469,7 @@ func getExpectedGnbNodebForNewRan(payload []byte) *entities.NodebInfo {
Gnb: &entities.Gnb{
GnbType: entities.GnbType_GNB,
RanFunctions: setupRequest.ExtractRanFunctionsList(),
+ NodeConfigs: setupRequest.ExtractE2NodeConfigList(),
},
},
GlobalNbId: &entities.GlobalNbId{
@@ -491,7 +493,8 @@ func getExpectedEnbNodebForNewRan(payload []byte) *entities.NodebInfo {
NodeType: entities.Node_ENB,
Configuration: &entities.NodebInfo_Enb{
Enb: &entities.Enb{
- EnbType: entities.EnbType_MACRO_ENB,
+ EnbType: entities.EnbType_MACRO_ENB,
+ NodeConfigs: setupRequest.ExtractE2NodeConfigList(),
},
},
GlobalNbId: &entities.GlobalNbId{
@@ -515,13 +518,26 @@ func getExpectedNodebForExistingRan(nodeb *entities.NodebInfo, payload []byte) *
nb := *nodeb
if nodeb.NodeType == entities.Node_ENB {
+ if e2NodeConfig := setupRequest.ExtractE2NodeConfigList(); e2NodeConfig != nil {
+ updatedEnb := *nodeb.GetEnb()
+ updatedEnb.NodeConfigs = e2NodeConfig
+ nb.Configuration = &entities.NodebInfo_Enb{Enb: &updatedEnb}
+ }
+
return &nb
}
if ranFuncs := setupRequest.ExtractRanFunctionsList(); ranFuncs != nil {
updatedGnb := *nodeb.GetGnb()
updatedGnb.RanFunctions = ranFuncs
- nb.Configuration =&entities.NodebInfo_Gnb{Gnb: &updatedGnb}
+ nb.Configuration = &entities.NodebInfo_Gnb{Gnb: &updatedGnb}
+ }
+
+ if e2NodeConfig := setupRequest.ExtractE2NodeConfigList(); e2NodeConfig != nil {
+ updatedGnb := *nodeb.GetGnb()
+ updatedGnb.RanFunctions = nb.GetGnb().RanFunctions
+ updatedGnb.NodeConfigs = e2NodeConfig
+ nb.Configuration = &entities.NodebInfo_Gnb{Gnb: &updatedGnb}
}
return &nb
@@ -687,6 +703,16 @@ func TestE2SetupRequestNotificationHandler_HandleExistingConnectedGnbRoutingMana
gnb := nodebInfo.GetGnb()
gnb.RanFunctions = []*entities.RanFunction{{RanFunctionId: 2, RanFunctionRevision: 2}}
+ gnb.NodeConfigs = []*entities.E2NodeComponentConfig{{
+ E2NodeComponentID: &entities.E2NodeComponentConfig_E2NodeComponentInterfaceTypeNG{
+ E2NodeComponentInterfaceTypeNG: &entities.E2NodeComponentInterfaceNG{
+ AmfName: "nginterf",
+ },
+ },
+ E2NodeComponentInterfaceType: entities.E2NodeComponentInterfaceType_ng,
+ E2NodeComponentRequestPart: []byte("72 65 73 70 61 72 74"),
+ E2NodeComponentResponsePart: []byte("72 65 73 70 61 72 74"),
+ }}
readerMock.On("GetNodeb", gnbNodebRanName).Return(nodebInfo, nil)
routingManagerClientMock.On("AssociateRanToE2TInstance", e2tInstanceFullAddress, mock.Anything).Return(errors.New("association error"))