[RIC-431] Add automation test to Add eNB REST API and update Get-All-Nodes-Real test
Change-Id: Ibadcb75c24c1ce4da19c6299c7a3281b923879a8
Signed-off-by: ss412g <shuky.har-noy@intl.att.com>
diff --git a/Automation/Tests/Add_ENB/Add_ENB_Happy.robot b/Automation/Tests/Add_ENB/Add_ENB_Happy.robot
new file mode 100644
index 0000000..44f4578
--- /dev/null
+++ b/Automation/Tests/Add_ENB/Add_ENB_Happy.robot
@@ -0,0 +1,58 @@
+##############################################################################
+#
+# 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
+Suite Setup Prepare Enviorment ${False}
+Resource ../Resource/resource.robot
+Resource ../Resource/Keywords.robot
+Library OperatingSystem
+Library REST ${url}
+
+
+*** Variables ***
+${url} ${e2mgr_address}
+
+*** Test Cases ***
+
+Add eNB
+ Sleep 2s
+ Add eNb Request
+ Integer response status 201
+ String response body ranName ${enb_ran_name}
+ String response body connectionStatus DISCONNECTED
+ String response body nodeType ENB
+ String response body enb enbType MACRO_ENB
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Automation/Tests/Add_ENB/__init__.robot b/Automation/Tests/Add_ENB/__init__.robot
new file mode 100644
index 0000000..067afd2
--- /dev/null
+++ b/Automation/Tests/Add_ENB/__init__.robot
@@ -0,0 +1,24 @@
+##############################################################################
+#
+# 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 ***
+Documentation Add_ENB
diff --git a/Automation/Tests/Get-All-Nodes-Real/Get_all_nodes_run_setup_and_get_all.robot b/Automation/Tests/Get-All-Nodes-Real/Get_all_nodes_run_setup_and_get_all.robot
index 0b83605..91ab8ad 100644
--- a/Automation/Tests/Get-All-Nodes-Real/Get_all_nodes_run_setup_and_get_all.robot
+++ b/Automation/Tests/Get-All-Nodes-Real/Get_all_nodes_run_setup_and_get_all.robot
@@ -34,13 +34,29 @@
*** Test Cases ***
+Add eNb Node
+ Sleep 2s
+ Add eNb Request
+
+
Get all node ids
GET v1/nodeb/ids
Sleep 2s
Integer response status 200
- String response body 0 inventoryName ${ranName}
- String response body 0 globalNbId plmnId 02F829
- String response body 0 globalNbId nbId 001100000011000000110000
+
+ #Verify eNB node
+ String response body 0 inventoryName ${enb_ran_name}
+ String response body 0 connectionStatus DISCONNECTED
+ String response body 0 globalNbId plmnId def
+ String response body 0 globalNbId nbId abc
+
+ #Verify gNB node
+ String response body 1 inventoryName ${ranName}
+# String response body 1 connectionStatus CONNECTED
+# String response body 1 nodeType GNB
+ String response body 1 globalNbId plmnId 02F829
+ String response body 1 globalNbId nbId 001100000011000000110000
+
Prepare Logs For Tests
Remove log files
diff --git a/Automation/Tests/Resource/Keywords.robot b/Automation/Tests/Resource/Keywords.robot
index 13873a8..ff6fbbe 100644
--- a/Automation/Tests/Resource/Keywords.robot
+++ b/Automation/Tests/Resource/Keywords.robot
@@ -35,6 +35,10 @@
Sleep 1s
PUT ${update_gnb_url} ${update_gnb_body}
+Add eNb Request
+ Sleep 1s
+ POST ${add_enb_url} ${add_enb_request_body}
+
Set General Configuration request
Sleep 1s
PUT ${set_general_configuration} ${set_general_configuration_body}
diff --git a/Automation/Tests/Resource/resource.robot b/Automation/Tests/Resource/resource.robot
index 9c1149c..acc7ba8 100644
--- a/Automation/Tests/Resource/resource.robot
+++ b/Automation/Tests/Resource/resource.robot
@@ -28,12 +28,16 @@
#REST
${ranName} gnb_208_092_303030
+${enb_ran_name} enb_test
${getNodeb} /v1/nodeb/${ranName}
${set_general_configuration} /v1/nodeb/parameters
${set_general_configuration_body} {"enableRic":false}
${update_gnb_url} /v1/nodeb/${ranName}/update
+${add_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_test","globalNbId":{"nbId":"abc","plmnId":"def"},"port":1234,"enb":{"enbType":1,"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_test","port":1234,"connectionStatus":"DISCONNECTED","globalNbId":{"plmnId":"def","nbId":"abc"},"nodeType":"ENB","enb":{"enbType":"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"]}}
${header} {"Content-Type": "application/json"}
#K8S