[RIC-584] reject update enb when enb type is one of ng types 20/4520/2
authorss412g <shuky.har-noy@intl.att.com>
Thu, 6 Aug 2020 21:20:09 +0000 (21:20 +0000)
committerShuky Har-Noy <shuky.har-noy@intl.att.com>
Thu, 6 Aug 2020 21:42:46 +0000 (21:42 +0000)
Change-Id: Ib9f1ae39deb34283844325561050408b88187b5d
Signed-off-by: ss412g <shuky.har-noy@intl.att.com>
15 files changed:
Automation/Tests/Add_ENB/Add_ENB_Unhappy.robot [new file with mode: 0644]
Automation/Tests/Delete_ENB/Delete_ENB_Test.robot
Automation/Tests/Resource/Keywords.robot
Automation/Tests/Resource/resource.robot
Automation/Tests/Update_ENB/Update_ENB_Created_From_Network.robot [new file with mode: 0644]
Automation/Tests/Update_ENB/Update_ENB_Created_From_Rest.robot [moved from Automation/Tests/Update_ENB/Update_ENB.robot with 100% similarity]
Automation/Tests/Update_ENB/Update_ENB_Unhappy.robot [new file with mode: 0644]
Automation/Tests/Update_ENB/__init__.robot
E2Manager/container-tag.yaml
E2Manager/controllers/nodeb_controller_test.go
E2Manager/handlers/httpmsghandlers/update_nodeb_request_handler.go
E2Manager/managers/i_update_nodeb_manager.go
E2Manager/managers/update_enb_manager.go
E2Manager/managers/update_gnb_manager.go
E2Manager/services/rnib_data_service.go

diff --git a/Automation/Tests/Add_ENB/Add_ENB_Unhappy.robot b/Automation/Tests/Add_ENB/Add_ENB_Unhappy.robot
new file mode 100644 (file)
index 0000000..4653eab
--- /dev/null
@@ -0,0 +1,47 @@
+##############################################################################
+#
+#   Copyright (c) 2019 AT&T Intellectual Property.
+#
+#   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).
+#
+
+
+*** Settings ***
+Variables  ../Scripts/variables.py
+Resource   ../Resource/resource.robot
+Resource   ../Resource/Keywords.robot
+Library     OperatingSystem
+Library     ../Scripts/log_scripts.py
+Library     REST        ${url}
+
+
+*** Variables ***
+${url}  ${e2mgr_address}
+
+*** Test Cases ***
+[Setup]
+    Prepare Enviorment  ${False}
+
+Add eNB
+    Sleep  2s
+    Add eNb Request    ${add_enb_type_ng_request_body}
+    Integer  response status  400
+
+prepare logs for tests
+    Remove log files
+    Save logs
\ No newline at end of file
index 2e28630..edfa645 100644 (file)
@@ -49,6 +49,10 @@ Delete eNb
     Delete eNb Request
     Integer  response status  204
 
+Get eNB
+    Sleep    2s
+    Get Request nodeb    ${enb_ran_name}
+    Integer  response status  404
 
 prepare logs for tests
     Remove log files
@@ -61,5 +65,22 @@ E2M Logs - Verify Deletion
 Redis Monitor Logs - Verify Publish
     Redis Monitor Logs - Verify Publish To Manipulation Channel    ${enb_ran_name}    DELETED
 
+Send eNB setup request via e2adapter
+    Send eNB Setup Request
+
+Delete eNb
+    Sleep    5s
+    Delete eNb Request
+    Integer  response status  400
+
+Get eNB
+    Sleep    2s
+    Get Request nodeb    ${enb_ran_name}
+    Integer  response status  200
+
+prepare logs for tests
+    Remove log files
+    Save logs
+
 [Teardown]
     Stop Redis Monitor
\ No newline at end of file
index 29b933b..192438c 100644 (file)
@@ -40,16 +40,18 @@ Update Gnb request
     PUT    ${update_gnb_url}   ${update_gnb_body}
 
 Add eNb Request
+    [Arguments]    ${request}=${add_enb_request_body}
     Sleep  1s
-    POST    ${enb_url}   ${add_enb_request_body}
+    POST    ${enb_url}   ${request}
 
 Delete eNb Request
     Sleep  1s
     DELETE    ${enb_url}/${enb_ran_name}
 
 Update eNb Request
+    [Arguments]    ${request}=${update_enb_request_body}
     Sleep  1s
-    PUT    ${enb_url}/${enb_ran_name}   ${update_enb_request_body}
+    PUT    ${enb_url}/${enb_ran_name}   ${request}
 
 Set General Configuration request
     Sleep  1s
index dff5926..f570b3b 100644 (file)
@@ -37,8 +37,10 @@ ${enb_url}    /v1/nodeb/enb
 ${update_gnb_body}  {"servedNrCells":[{"servedNrCellInformation":{"cellId":"abcd","choiceNrMode":{"fdd":{}},"nrMode":1,"nrPci":1,"servedPlmns":["whatever"]},"nrNeighbourInfos":[{"nrCgi":"one","choiceNrMode":{"fdd":{}},"nrMode":1,"nrPci":1}]}]}
 ${update_gnb_body_notvalid}  {"servedNrCells":[{"servedNrCellInformation":{"choiceNrMode":{"fdd":{}},"nrMode":1,"nrPci":1,"servedPlmns":["whatever"]},"nrNeighbourInfos":[{"nrCgi":"whatever","choiceNrMode":{"fdd":{}},"nrMode":1,"nrPci":1}]}]}
 ${add_enb_request_body}    {"ranName":"${enb_ran_name}","globalNbId":{"nbId":"abc","plmnId":"def"},"port":1234,"enb":{"enbType":3,"guGroupIds":["ghi"],"servedCells":[{"broadcastPlmns":["jkl"],"cellId":"mnop","choiceEutraMode":{"fdd":{"dlearFcn":1,"ulearFcn":1},"tdd":{"additionalSpecialSubframeExtensionInfo":{"additionalSpecialSubframePatternsExtension":1,"cyclicPrefixDl":1,"cyclicPrefixUl":1},"additionalSpecialSubframeInfo":{"additionalSpecialSubframePatterns":1,"cyclicPrefixDl":1,"cyclicPrefixUl":1},"earFcn":4,"specialSubframeInfo":{"specialSubframePatterns":1,"cyclicPrefixDl":1,"cyclicPrefixUl":1}}},"eutraMode":1,"csgId":"string","mbmsServiceAreaIdentities":["sds"],"mbsfnSubframeInfos":[{"radioframeAllocationOffset":3,"subframeAllocation":"jhg"}],"multibandInfos":[4],"neighbourInfos":[{"earFcn":4,"ecgi":"klj","pci":5,"tac":"wew"}],"pci":2,"prachConfiguration":{"highSpeedFlag":true,"prachConfigurationIndex":5,"prachFrequencyOffset":6,"rootSequenceIndex":7,"zeroCorrelationZoneConfiguration":6},"tac":"asd","additionalCellInformation":{"cellLatitude":1,"cellLongitude":1,"antennaHeight":1,"antennaAzimuthDirection":2,"antennaTiltAngle":3,"antennaMaxTransmit":4,"antennaMaxGain":5,"sectorId":6}},{"broadcastPlmns":["jkl"],"cellId":"qrst","choiceEutraMode":{"fdd":{"dlearFcn":4,"ulearFcn":2},"tdd":{"additionalSpecialSubframeExtensionInfo":{"additionalSpecialSubframePatternsExtension":1,"cyclicPrefixDl":1,"cyclicPrefixUl":1},"additionalSpecialSubframeInfo":{"additionalSpecialSubframePatterns":1,"cyclicPrefixDl":1,"cyclicPrefixUl":1},"earFcn":4,"specialSubframeInfo":{"specialSubframePatterns":1,"cyclicPrefixDl":1,"cyclicPrefixUl":1}}},"eutraMode":1,"csgId":"string","mbmsServiceAreaIdentities":["sds"],"mbsfnSubframeInfos":[{"radioframeAllocationOffset":5,"subframeAllocation":"jhg"}],"multibandInfos":[4],"neighbourInfos":[{"earFcn":2,"ecgi":"klj","pci":4,"tac":"wew"}],"pci":3,"prachConfiguration":{"highSpeedFlag":true,"prachConfigurationIndex":4,"prachFrequencyOffset":3,"rootSequenceIndex":3,"zeroCorrelationZoneConfiguration":2},"tac":"asd","additionalCellInformation":{"cellLatitude":3,"cellLongitude":3,"antennaHeight":3,"antennaAzimuthDirection":3,"antennaTiltAngle":4,"antennaMaxTransmit":4,"antennaMaxGain":5,"sectorId":5}}]}}
+${add_enb_type_ng_request_body}    {"ranName":"${enb_ran_name}","globalNbId":{"nbId":"abc","plmnId":"def"},"port":1234,"enb":{"enbType":5,"guGroupIds":["ghi"],"servedCells":[{"broadcastPlmns":["jkl"],"cellId":"mnop","choiceEutraMode":{"fdd":{"dlearFcn":1,"ulearFcn":1},"tdd":{"additionalSpecialSubframeExtensionInfo":{"additionalSpecialSubframePatternsExtension":1,"cyclicPrefixDl":1,"cyclicPrefixUl":1},"additionalSpecialSubframeInfo":{"additionalSpecialSubframePatterns":1,"cyclicPrefixDl":1,"cyclicPrefixUl":1},"earFcn":4,"specialSubframeInfo":{"specialSubframePatterns":1,"cyclicPrefixDl":1,"cyclicPrefixUl":1}}},"eutraMode":1,"csgId":"string","mbmsServiceAreaIdentities":["sds"],"mbsfnSubframeInfos":[{"radioframeAllocationOffset":3,"subframeAllocation":"jhg"}],"multibandInfos":[4],"neighbourInfos":[{"earFcn":4,"ecgi":"klj","pci":5,"tac":"wew"}],"pci":2,"prachConfiguration":{"highSpeedFlag":true,"prachConfigurationIndex":5,"prachFrequencyOffset":6,"rootSequenceIndex":7,"zeroCorrelationZoneConfiguration":6},"tac":"asd","additionalCellInformation":{"cellLatitude":1,"cellLongitude":1,"antennaHeight":1,"antennaAzimuthDirection":2,"antennaTiltAngle":3,"antennaMaxTransmit":4,"antennaMaxGain":5,"sectorId":6}},{"broadcastPlmns":["jkl"],"cellId":"qrst","choiceEutraMode":{"fdd":{"dlearFcn":4,"ulearFcn":2},"tdd":{"additionalSpecialSubframeExtensionInfo":{"additionalSpecialSubframePatternsExtension":1,"cyclicPrefixDl":1,"cyclicPrefixUl":1},"additionalSpecialSubframeInfo":{"additionalSpecialSubframePatterns":1,"cyclicPrefixDl":1,"cyclicPrefixUl":1},"earFcn":4,"specialSubframeInfo":{"specialSubframePatterns":1,"cyclicPrefixDl":1,"cyclicPrefixUl":1}}},"eutraMode":1,"csgId":"string","mbmsServiceAreaIdentities":["sds"],"mbsfnSubframeInfos":[{"radioframeAllocationOffset":5,"subframeAllocation":"jhg"}],"multibandInfos":[4],"neighbourInfos":[{"earFcn":2,"ecgi":"klj","pci":4,"tac":"wew"}],"pci":3,"prachConfiguration":{"highSpeedFlag":true,"prachConfigurationIndex":4,"prachFrequencyOffset":3,"rootSequenceIndex":3,"zeroCorrelationZoneConfiguration":2},"tac":"asd","additionalCellInformation":{"cellLatitude":3,"cellLongitude":3,"antennaHeight":3,"antennaAzimuthDirection":3,"antennaTiltAngle":4,"antennaMaxTransmit":4,"antennaMaxGain":5,"sectorId":5}}]}}
 ${add_enb_response_body}    {"ranName":"${enb_ran_name}","port":1234,"connectionStatus":"DISCONNECTED","globalNbId":{"plmnId":"def","nbId":"abc"},"nodeType":"ENB","enb":{"enbType":"SHORT_MACRO_ENB","servedCells":[{"pci":2,"cellId":"mnop","tac":"asd","broadcastPlmns":["jkl"],"choiceEutraMode":{"fdd":{"ulearFcn":1,"dlearFcn":1},"tdd":{"earFcn":4,"specialSubframeInfo":{"specialSubframePatterns":"SSP0","cyclicPrefixDl":"NORMAL","cyclicPrefixUl":"NORMAL"},"additionalSpecialSubframeInfo":{"additionalSpecialSubframePatterns":"SSP0","cyclicPrefixDl":"NORMAL","cyclicPrefixUl":"NORMAL"},"additionalSpecialSubframeExtensionInfo":{"additionalSpecialSubframePatternsExtension":"SSP10","cyclicPrefixDl":"NORMAL","cyclicPrefixUl":"NORMAL"}}},"eutraMode":"FDD","prachConfiguration":{"rootSequenceIndex":7,"zeroCorrelationZoneConfiguration":6,"highSpeedFlag":true,"prachFrequencyOffset":6,"prachConfigurationIndex":5},"mbsfnSubframeInfos":[{"radioframeAllocationOffset":3,"subframeAllocation":"jhg"}],"csgId":"string","mbmsServiceAreaIdentities":["sds"],"multibandInfos":[4],"neighbourInfos":[{"ecgi":"klj","pci":5,"earFcn":4,"tac":"wew"}],"additionalCellInformation":{"cellLatitude":1,"cellLongitude":1,"antennaHeight":1,"antennaAzimuthDirection":2,"antennaTiltAngle":3,"antennaMaxTransmit":4,"antennaMaxGain":5,"sectorId":6}},{"pci":3,"cellId":"qrst","tac":"asd","broadcastPlmns":["jkl"],"choiceEutraMode":{"fdd":{"ulearFcn":2,"dlearFcn":4},"tdd":{"earFcn":4,"specialSubframeInfo":{"specialSubframePatterns":"SSP0","cyclicPrefixDl":"NORMAL","cyclicPrefixUl":"NORMAL"},"additionalSpecialSubframeInfo":{"additionalSpecialSubframePatterns":"SSP0","cyclicPrefixDl":"NORMAL","cyclicPrefixUl":"NORMAL"},"additionalSpecialSubframeExtensionInfo":{"additionalSpecialSubframePatternsExtension":"SSP10","cyclicPrefixDl":"NORMAL","cyclicPrefixUl":"NORMAL"}}},"eutraMode":"FDD","prachConfiguration":{"rootSequenceIndex":3,"zeroCorrelationZoneConfiguration":2,"highSpeedFlag":true,"prachFrequencyOffset":3,"prachConfigurationIndex":4},"mbsfnSubframeInfos":[{"radioframeAllocationOffset":5,"subframeAllocation":"jhg"}],"csgId":"string","mbmsServiceAreaIdentities":["sds"],"multibandInfos":[4],"neighbourInfos":[{"ecgi":"klj","pci":4,"earFcn":2,"tac":"wew"}],"additionalCellInformation":{"cellLatitude":3,"cellLongitude":3,"antennaHeight":3,"antennaAzimuthDirection":3,"antennaTiltAngle":4,"antennaMaxTransmit":4,"antennaMaxGain":5,"sectorId":5}}],"guGroupIds":["ghi"]}}
 ${update_enb_request_body}    {"enb":{"enbType":"HOME_ENB","guGroupIds":["ghi"],"servedCells":[{"broadcastPlmns":["jkl"],"cellId":"mnop","choiceEutraMode":{"fdd":{"dlearFcn":1,"ulearFcn":1},"tdd":{"additionalSpecialSubframeExtensionInfo":{"additionalSpecialSubframePatternsExtension":1,"cyclicPrefixDl":1,"cyclicPrefixUl":1},"additionalSpecialSubframeInfo":{"additionalSpecialSubframePatterns":1,"cyclicPrefixDl":1,"cyclicPrefixUl":1},"earFcn":4,"specialSubframeInfo":{"specialSubframePatterns":1,"cyclicPrefixDl":1,"cyclicPrefixUl":1}}},"eutraMode":1,"csgId":"string","mbmsServiceAreaIdentities":["sds"],"mbsfnSubframeInfos":[{"radioframeAllocationOffset":3,"subframeAllocation":"jhg"}],"multibandInfos":[4],"neighbourInfos":[{"earFcn":4,"ecgi":"klj","pci":5,"tac":"wew"}],"pci":2,"prachConfiguration":{"highSpeedFlag":true,"prachConfigurationIndex":5,"prachFrequencyOffset":6,"rootSequenceIndex":7,"zeroCorrelationZoneConfiguration":6},"tac":"asd","additionalCellInformation":{"cellLatitude":1,"cellLongitude":1,"antennaHeight":1,"antennaAzimuthDirection":2,"antennaTiltAngle":3,"antennaMaxTransmit":4,"antennaMaxGain":5,"sectorId":6}},{"broadcastPlmns":["jkl"],"cellId":"qrst","choiceEutraMode":{"fdd":{"dlearFcn":4,"ulearFcn":2},"tdd":{"additionalSpecialSubframeExtensionInfo":{"additionalSpecialSubframePatternsExtension":1,"cyclicPrefixDl":1,"cyclicPrefixUl":1},"additionalSpecialSubframeInfo":{"additionalSpecialSubframePatterns":1,"cyclicPrefixDl":1,"cyclicPrefixUl":1},"earFcn":4,"specialSubframeInfo":{"specialSubframePatterns":1,"cyclicPrefixDl":1,"cyclicPrefixUl":1}}},"eutraMode":1,"csgId":"string","mbmsServiceAreaIdentities":["sds"],"mbsfnSubframeInfos":[{"radioframeAllocationOffset":5,"subframeAllocation":"jhg"}],"multibandInfos":[4],"neighbourInfos":[{"earFcn":2,"ecgi":"klj","pci":4,"tac":"wew"}],"pci":3,"prachConfiguration":{"highSpeedFlag":true,"prachConfigurationIndex":4,"prachFrequencyOffset":3,"rootSequenceIndex":3,"zeroCorrelationZoneConfiguration":2},"tac":"asd","additionalCellInformation":{"cellLatitude":3,"cellLongitude":3,"antennaHeight":3,"antennaAzimuthDirection":3,"antennaTiltAngle":4,"antennaMaxTransmit":4,"antennaMaxGain":5,"sectorId":5}}]}}
+${update_enb_type_ng_request_body}    {"enb":{"enbType":"SHORT_MACRO_NG_ENB","guGroupIds":["ghi"],"servedCells":[{"broadcastPlmns":["jkl"],"cellId":"mnop","choiceEutraMode":{"fdd":{"dlearFcn":1,"ulearFcn":1},"tdd":{"additionalSpecialSubframeExtensionInfo":{"additionalSpecialSubframePatternsExtension":1,"cyclicPrefixDl":1,"cyclicPrefixUl":1},"additionalSpecialSubframeInfo":{"additionalSpecialSubframePatterns":1,"cyclicPrefixDl":1,"cyclicPrefixUl":1},"earFcn":4,"specialSubframeInfo":{"specialSubframePatterns":1,"cyclicPrefixDl":1,"cyclicPrefixUl":1}}},"eutraMode":1,"csgId":"string","mbmsServiceAreaIdentities":["sds"],"mbsfnSubframeInfos":[{"radioframeAllocationOffset":3,"subframeAllocation":"jhg"}],"multibandInfos":[4],"neighbourInfos":[{"earFcn":4,"ecgi":"klj","pci":5,"tac":"wew"}],"pci":2,"prachConfiguration":{"highSpeedFlag":true,"prachConfigurationIndex":5,"prachFrequencyOffset":6,"rootSequenceIndex":7,"zeroCorrelationZoneConfiguration":6},"tac":"asd","additionalCellInformation":{"cellLatitude":1,"cellLongitude":1,"antennaHeight":1,"antennaAzimuthDirection":2,"antennaTiltAngle":3,"antennaMaxTransmit":4,"antennaMaxGain":5,"sectorId":6}},{"broadcastPlmns":["jkl"],"cellId":"qrst","choiceEutraMode":{"fdd":{"dlearFcn":4,"ulearFcn":2},"tdd":{"additionalSpecialSubframeExtensionInfo":{"additionalSpecialSubframePatternsExtension":1,"cyclicPrefixDl":1,"cyclicPrefixUl":1},"additionalSpecialSubframeInfo":{"additionalSpecialSubframePatterns":1,"cyclicPrefixDl":1,"cyclicPrefixUl":1},"earFcn":4,"specialSubframeInfo":{"specialSubframePatterns":1,"cyclicPrefixDl":1,"cyclicPrefixUl":1}}},"eutraMode":1,"csgId":"string","mbmsServiceAreaIdentities":["sds"],"mbsfnSubframeInfos":[{"radioframeAllocationOffset":5,"subframeAllocation":"jhg"}],"multibandInfos":[4],"neighbourInfos":[{"earFcn":2,"ecgi":"klj","pci":4,"tac":"wew"}],"pci":3,"prachConfiguration":{"highSpeedFlag":true,"prachConfigurationIndex":4,"prachFrequencyOffset":3,"rootSequenceIndex":3,"zeroCorrelationZoneConfiguration":2},"tac":"asd","additionalCellInformation":{"cellLatitude":3,"cellLongitude":3,"antennaHeight":3,"antennaAzimuthDirection":3,"antennaTiltAngle":4,"antennaMaxTransmit":4,"antennaMaxGain":5,"sectorId":5}}]}}
 ${header}  {"Content-Type": "application/json"}
 
 #K8S
diff --git a/Automation/Tests/Update_ENB/Update_ENB_Created_From_Network.robot b/Automation/Tests/Update_ENB/Update_ENB_Created_From_Network.robot
new file mode 100644 (file)
index 0000000..3d648b6
--- /dev/null
@@ -0,0 +1,64 @@
+##############################################################################
+#
+#   Copyright (c) 2019 AT&T Intellectual Property.
+#
+#   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).
+#
+
+
+*** Settings ***
+Variables  ../Scripts/variables.py
+Resource   ../Resource/resource.robot
+Resource   ../Resource/Keywords.robot
+Library     OperatingSystem
+Library     ../Scripts/log_scripts.py
+Library     ../Scripts/k8s_helper.py
+Library     REST        ${url}
+
+
+*** Variables ***
+${url}  ${e2mgr_address}
+
+*** Test Cases ***
+
+[Setup]
+    Start Redis Monitor
+    Prepare Enviorment  ${False}
+
+Send eNB setup request via e2adapter
+    Send eNB Setup Request
+
+Update eNb
+    Sleep    5s
+    Update eNb Request
+    Integer  response status  200
+    String   response body enb enbType    SHORT_MACRO_ENB
+
+prepare logs for tests
+    Remove log files
+    Save logs
+
+E2M Logs - Verify Update
+    ${result}    log_scripts.verify_log_message   ${EXECDIR}/${e2mgr_log_filename}  ${update_enb_log_message}
+    Should Be Equal As Strings    ${result}      True
+
+Redis Monitor Logs - Verify Publish
+    Redis Monitor Logs - Verify Publish To Manipulation Channel    ${enb_ran_name}    UPDATED
+
+[Teardown]
+    Stop Redis Monitor
\ No newline at end of file
diff --git a/Automation/Tests/Update_ENB/Update_ENB_Unhappy.robot b/Automation/Tests/Update_ENB/Update_ENB_Unhappy.robot
new file mode 100644 (file)
index 0000000..516de03
--- /dev/null
@@ -0,0 +1,57 @@
+##############################################################################
+#
+#   Copyright (c) 2019 AT&T Intellectual Property.
+#
+#   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).
+#
+
+
+*** Settings ***
+Variables  ../Scripts/variables.py
+Resource   ../Resource/resource.robot
+Resource   ../Resource/Keywords.robot
+Library     OperatingSystem
+Library     ../Scripts/log_scripts.py
+Library     ../Scripts/k8s_helper.py
+Library     REST        ${url}
+
+
+*** Variables ***
+${url}  ${e2mgr_address}
+
+*** Test Cases ***
+
+[Setup]
+    Start Redis Monitor
+    Prepare Enviorment  ${False}
+
+Add eNB
+    Sleep  2s
+    Add eNb Request
+
+Update eNb With Ng Type
+    Sleep    2s
+    Update eNb Request    ${update_enb_type_ng_request_body}
+    Integer  response status  400
+
+prepare logs for tests
+    Remove log files
+    Save logs
+
+[Teardown]
+    Stop Redis Monitor
\ No newline at end of file
index 067afd2..4bc5edc 100644 (file)
@@ -21,4 +21,4 @@
 #
 
 *** Settings ***
-Documentation    Add_ENB
+Documentation    Update_ENB
index a6108c8..5fe01f6 100644 (file)
@@ -1,4 +1,4 @@
 # The Jenkins job requires a tag to build the Docker image.
 # Global-JJB script assumes this file is in the repo root.
 ---
-tag: 5.4.5
+tag: 5.4.6
index e62e7c0..f57522c 100644 (file)
@@ -1167,14 +1167,25 @@ func TestControllerUpdateEnbNgEnbFailure(t *testing.T) {
 
        requestBody := map[string]interface{}{
                "enb": map[string]interface{}{
-                       "enbType": 5,
+                       "enbType": 3,
                        "servedCells": []interface{}{
                                buildServedCell(""),
                        }},
        }
 
+       oldServedCells := generateServedCells("whatever1", "whatever2")
+
        context := controllerUpdateEnbTestContext{
-               getNodebInfoResult:   nil,
+               getNodebInfoResult:  &getNodebInfoResult{
+               nodebInfo: &entities.NodebInfo{
+               RanName:                      RanName,
+               ConnectionStatus:             entities.ConnectionStatus_CONNECTED,
+               AssociatedE2TInstanceAddress: AssociatedE2TInstanceAddress,
+               NodeType:                     entities.Node_ENB,
+               Configuration:                &entities.NodebInfo_Enb{Enb: &entities.Enb{ServedCells: oldServedCells, EnbType: entities.EnbType_MACRO_NG_ENB}},
+       },
+               rnibError: nil,
+       },
                requestBody:          requestBody,
                expectedStatusCode:   http.StatusBadRequest,
                expectedJsonResponse: ValidationFailureJson,
index 8b6b80c..551006e 100644 (file)
@@ -65,6 +65,11 @@ func (h *UpdateNodebRequestHandler) Handle(request models.Request) (models.IResp
                return nil, e2managererrors.NewResourceNotFoundError()
        }
 
+       err = h.updateNodebManager.ValidateNodeb(nodebInfo)
+       if err != nil {
+               return nil, e2managererrors.NewRequestValidationError()
+       }
+
        err = h.updateNodebManager.RemoveNodebCells(nodebInfo)
        if err != nil {
                return nil, err
index b67c07c..79d09b7 100644 (file)
@@ -26,6 +26,7 @@ import (
 
 type IUpdateNodebManager interface {
        Validate(request models.Request) error
+       ValidateNodeb(nodeb *entities.NodebInfo) error
        RemoveNodebCells(nodeb *entities.NodebInfo) error
        SetNodeb(nodeb *entities.NodebInfo, request models.Request)
        UpdateNodeb(nodeb *entities.NodebInfo) error
index 6cb5414..0e8ed7e 100755 (executable)
@@ -52,7 +52,6 @@ func (h *UpdateEnbManager) Validate(request models.Request) error {
                h.logger.Errorf("#UpdateEnbManager.Validate - validation failure: %s is a mandatory field and cannot be empty", err)
                return err
        }
-
        return nil
 }
 
@@ -112,9 +111,17 @@ func (h *UpdateEnbManager) validateRequestBody(request *models.UpdateEnbRequest)
                return err
        }
 
-       if h.nodebValidator.IsNgEnbType(request.Enb.GetEnbType()) {
-               return errors.New("enb.enbType")
-       }
+       return nil
+}
 
+func (h *UpdateEnbManager) ValidateNodeb(nodeb *entities.NodebInfo) error{
+
+       enbType := nodeb.GetEnb().GetEnbType()
+
+       if h.nodebValidator.IsNgEnbType(enbType) {
+               h.logger.Errorf("#UpdateEnbManager.ValidateNodeb - validation failure: current enb type is not supported. enb type: %s", enbType)
+               return errors.New("")
+       }
        return nil
 }
+
index 8f1f54c..731c5bb 100644 (file)
@@ -53,6 +53,10 @@ func (h *UpdateGnbManager) Validate(request models.Request) error {
        return nil
 }
 
+func (h *UpdateGnbManager) ValidateNodeb(nodeb *entities.NodebInfo) error{
+       return nil
+}
+
 func (h *UpdateGnbManager) RemoveNodebCells(nodeb *entities.NodebInfo) error {
 
        if nodeb.NodeType != entities.Node_GNB {
index e489199..c053171 100644 (file)
@@ -187,7 +187,7 @@ func (w *rNibDataService) GetNodeb(ranName string) (*entities.NodebInfo, error)
        })
 
        if err == nil {
-               w.logger.Infof("#RnibDataService.GetNodeb - RAN name: %s, connection status: %s, associated E2T: %s", nodeb.RanName, nodeb.ConnectionStatus, nodeb.AssociatedE2TInstanceAddress)
+               w.logger.Infof("#RnibDataService.GetNodeb - RAN name: %s, connection status: %s, associated E2T: %s, setup from network: %t", nodeb.RanName, nodeb.ConnectionStatus, nodeb.AssociatedE2TInstanceAddress, nodeb.SetupFromNetwork)
        }
 
        return nodeb, err