[RIC-621] Add redis monitor verification to automation tests 22/4422/1
authorss412g <shuky.har-noy@intl.att.com>
Tue, 21 Jul 2020 13:46:58 +0000 (13:46 +0000)
committerss412g <shuky.har-noy@intl.att.com>
Tue, 21 Jul 2020 13:47:03 +0000 (13:47 +0000)
Change-Id: I512c9984887d417a53dd868f0b68b0c1151f185d
Signed-off-by: ss412g <shuky.har-noy@intl.att.com>
16 files changed:
Automation/Tests/Add_ENB/Add_ENB_Happy.robot
Automation/Tests/Delete_ENB/Delete_ENB_Test.robot [new file with mode: 0644]
Automation/Tests/Delete_ENB/__init__.robot [new file with mode: 0644]
Automation/Tests/GetNodeB-GNB/GetNodeB-GNB_test.robot
Automation/Tests/Lost_Connection/LostConnectionTestConnectedRan.robot
Automation/Tests/RedButton/RedButton_CONNECTED.robot
Automation/Tests/RedButton/RedButton_CONNECTED_SHUTDOWN_CONNECTED.robot
Automation/Tests/RedButton/RedButton_SHUTDOWN_SHUTDOWN.robot
Automation/Tests/Resource/Keywords.robot
Automation/Tests/Resource/resource.robot
Automation/Tests/Scripts/k8s_helper.py
Automation/Tests/Scripts/log_scripts.py [new file with mode: 0644]
Automation/Tests/Update_ENB/Update_ENB.robot [new file with mode: 0644]
Automation/Tests/Update_ENB/__init__.robot [new file with mode: 0644]
Automation/deprecated/Scripts/loadscripts.py [moved from Automation/Tests/Scripts/loadscripts.py with 100% similarity]
Automation/deprecated/Scripts/rsmscripts.py [moved from Automation/Tests/Scripts/rsmscripts.py with 100% similarity]

index 44f4578..970a151 100644 (file)
@@ -27,6 +27,8 @@ Suite Setup   Prepare Enviorment  ${False}
 Resource   ../Resource/resource.robot
 Resource   ../Resource/Keywords.robot
 Library     OperatingSystem
+Library     Process
+Library     ../Scripts/log_scripts.py
 Library     REST        ${url}
 
 
@@ -35,6 +37,9 @@ ${url}  ${e2mgr_address}
 
 *** Test Cases ***
 
+Prepare Redis Monitor Log
+    Start Redis Monitor
+
 Add eNB
     Sleep  2s
     Add eNb Request
@@ -44,9 +49,15 @@ Add eNB
     String   response body nodeType     ENB
     String   response body enb enbType    MACRO_ENB
 
+prepare logs for tests
+    Remove log files
+    Save logs
 
+Redis Monitor Logs - Verify Publish
+    Redis Monitor Logs - Verify Publish To Manipulation Channel    ${enb_ran_name}    ADDED
 
-
+[Teardown]
+    Stop Redis Monitor
 
 
 
diff --git a/Automation/Tests/Delete_ENB/Delete_ENB_Test.robot b/Automation/Tests/Delete_ENB/Delete_ENB_Test.robot
new file mode 100644 (file)
index 0000000..0ac5a4c
--- /dev/null
@@ -0,0 +1,65 @@
+##############################################################################
+#
+#   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     ../Scripts/log_scripts.py
+Library     ../Scripts/k8s_helper.py
+Library     REST        ${url}
+
+
+*** Variables ***
+${url}  ${e2mgr_address}
+
+*** Test Cases ***
+
+Prepare Redis Monitor Log
+    Start Redis Monitor
+
+Add eNB
+    Sleep  2s
+    Add eNb Request
+
+Delete eNb
+    Sleep    2s
+    Delete eNb Request
+    Integer  response status  204
+
+
+prepare logs for tests
+    Remove log files
+    Save logs
+
+E2M Logs - Verify Deletion
+    ${result}    log_scripts.verify_log_message   ${EXECDIR}/${e2mgr_log_filename}  ${delete_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}    DELETED
+
+[Teardown]
+    Stop Redis Monitor
\ No newline at end of file
diff --git a/Automation/Tests/Delete_ENB/__init__.robot b/Automation/Tests/Delete_ENB/__init__.robot
new file mode 100644 (file)
index 0000000..067afd2
--- /dev/null
@@ -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
index 26a21ed..68f9541 100644 (file)
 
 *** Settings ***
 Variables  ../Scripts/variables.py
-Suite Setup   Prepare Enviorment    ${True}
 Resource   ../Resource/resource.robot
 Resource   ../Resource/Keywords.robot
 Library     OperatingSystem
 Library     ../Scripts/find_rmr_message.py
-Library     ../Scripts/rsmscripts.py
+Library     ../Scripts/log_scripts.py
 Library     REST        ${url}
 
 *** Variables ***
@@ -39,6 +38,12 @@ ${url}  ${e2mgr_address}
 
 *** Test Cases ***
 
+[Setup]
+    Start Redis Monitor
+    AND Prepare Enviorment    ${True}
+
+Redis Monitor Logs - Verify Publish
+    Redis Monitor Logs - Verify Publish To Connection Status Channel   ${ran_name}    CONNECTED
 
 Get request gnb
     Sleep    2s
@@ -60,3 +65,5 @@ Prepare Logs For Tests
     Remove log files
     Save logs
 
+[Teardown]
+    Stop Redis Monitor
\ No newline at end of file
index 86dd8e0..3d9a0ef 100644 (file)
@@ -26,6 +26,7 @@ Resource   ../Resource/resource.robot
 Resource   ../Resource/Keywords.robot
 Library    ../Scripts/find_error_script.py
 Library     ../Scripts/e2mdbscripts.py
+Library     ../Scripts/log_scripts.py
 Library     OperatingSystem
 Library    Collections
 Library     REST      ${url}
@@ -35,6 +36,9 @@ ${url}  ${e2mgr_address}
 
 *** Test Cases ***
 
+Prepare Redis Monitor Log
+    Start Redis Monitor
+
 Setup Ran and verify it's CONNECTED and associated
     Get Request node b gnb
     Integer  response status  200
@@ -61,10 +65,10 @@ Verify E2T instance is NOT associated with RAN
    ${result}    e2mdbscripts.verify_ran_is_associated_with_e2t_instance     ${ranname}  ${e2t_alpha_address}
    Should Be True    ${result} == False
 
-#Verify e2mgr logs - Set and Publish Disconnect True
-#  ${result}    find_error_script.find_error     ${EXECDIR}  ${e2mgr_log_filename}    ${set_and_publish_disconnect}
-#   Should Be Equal As Strings    ${result}      True
+Redis Monitor Logs - Verify Publish
+    Redis Monitor Logs - Verify Publish To Connection Status Channel   ${ran_name}    DISCONNECTED
 
 [Teardown]    Run Keywords
               Start Simulator
-              AND wait until keyword succeeds  1 min    10 sec    Validate Required Dockers
\ No newline at end of file
+              AND wait until keyword succeeds  1 min    10 sec    Validate Required Dockers
+              AND Stop Redis Monitor
\ No newline at end of file
index 517a4e1..4cbfffe 100644 (file)
@@ -27,6 +27,7 @@ Resource    ../Resource/resource.robot
 Resource    ../Resource/Keywords.robot
 Resource    red_button_keywords.robot
 Library    ../Scripts/find_error_script.py
+Library     ../Scripts/log_scripts.py
 Library     OperatingSystem
 Library     Collections
 Library     REST      ${url}
@@ -36,6 +37,9 @@ ${url}  ${e2mgr_address}
 
 *** Test Cases ***
 
+Prepare Redis Monitor Log
+    Start Redis Monitor
+
 Verify gnb nodeb connection status is CONNECTED and it's associated to an e2t instance
    Verify connected and associated
 
@@ -52,6 +56,8 @@ Verify nodeb's connection status is SHUT_DOWN and it's NOT associated to an e2t
 Verify E2T instance has no associated RANs
    Verify E2T instance has no associated RANs
 
-#Verify e2mgr logs - Set and Publish Disconnect
-#  ${result}    find_error_script.find_error     ${EXECDIR}  ${e2mgr_log_filename}    ${set_and_publish_disconnect}
-#   Should Be Equal As Strings    ${result}      True
\ No newline at end of file
+Redis Monitor Logs - Verify Publish
+    Redis Monitor Logs - Verify Publish To Connection Status Channel   ${ran_name}    DISCONNECTED
+
+[Teardown]
+    Stop Redis Monitor
\ No newline at end of file
index daff5d1..5cc0db7 100644 (file)
@@ -27,6 +27,7 @@ Resource   ../Resource/resource.robot
 Resource   ../Resource/Keywords.robot
 Resource    red_button_keywords.robot
 Library    ../Scripts/find_error_script.py
+Library     ../Scripts/log_scripts.py
 Library     OperatingSystem
 Library     Collections
 Library     REST      ${url}
@@ -36,6 +37,9 @@ ${url}  ${e2mgr_address}
 
 *** Test Cases ***
 
+Prepare Redis Monitor Log
+    Start Redis Monitor
+
 Verify gnb nodeb connection status is CONNECTED and it's associated to an e2t instance
   Verify connected and associated
 
@@ -46,9 +50,8 @@ prepare logs for tests
     Remove log files
     Save logs
 
-#Verify e2mgr logs - Set and Publish Disconnect
-#  ${result}    find_error_script.find_error     ${EXECDIR}  ${e2mgr_log_filename}    ${set_and_publish_disconnect}
-#   Should Be Equal As Strings    ${result}      True
+Redis Monitor Logs - Verify Publish 1
+    Redis Monitor Logs - Verify Publish To Connection Status Channel   ${ran_name}    DISCONNECTED
 
 Verify nodeb's connection status is SHUT_DOWN and it's NOT associated to an e2t instance
    Verify shutdown for gnb
@@ -59,4 +62,10 @@ Restart simulator
    wait until keyword succeeds  1 min    10 sec    Validate Required Dockers
 
 Verify gnb nodeb connection status is CONNECTED and it's associated to an e2t instance - checking again
-   Verify connected and associated
\ No newline at end of file
+   Verify connected and associated
+
+Redis Monitor Logs - Verify Publish 2
+    Redis Monitor Logs - Verify Publish To Connection Status Channel   ${ran_name}    CONNECTED
+
+[Teardown]
+    Stop Redis Monitor
\ No newline at end of file
index 8fc66d9..b91dddc 100644 (file)
@@ -27,6 +27,7 @@ Resource   ../Resource/resource.robot
 Resource   ../Resource/Keywords.robot
 Resource    red_button_keywords.robot
 Library    ../Scripts/find_error_script.py
+Library     ../Scripts/log_scripts.py
 Library     OperatingSystem
 Library    Collections
 Library     REST      ${url}
@@ -36,6 +37,9 @@ ${url}  ${e2mgr_address}
 
 *** Test Cases ***
 
+Prepare Redis Monitor Log
+    Start Redis Monitor
+
 Verify nodeb connection status is CONNECTED and it's associated to an e2t instance
    Verify connected and associated
 
@@ -46,9 +50,8 @@ prepare logs for tests
     Remove log files
     Save logs
 
-#Verify e2mgr logs - Set and Publish Disconnect True
-#  ${result}    find_error_script.find_error     ${EXECDIR}  ${e2mgr_log_filename}    ${set_and_publish_disconnect}
-#   Should Be Equal As Strings    ${result}      True
+Redis Monitor Logs - Verify Publish
+    Redis Monitor Logs - Verify Publish To Connection Status Channel   ${ran_name}    DISCONNECTED
 
 Verify nodeb's connection status is SHUT_DOWN and it's NOT associated to an e2t instance
    Verify shutdown for gnb
@@ -64,3 +67,6 @@ Verify again nodeb's connection status is SHUT_DOWN and it's NOT associated to a
 
 Verify again E2T instance has no associated RANs
    Verify E2T instance has no associated RANs
+
+[Teardown]
+    Stop Redis Monitor
\ No newline at end of file
index ff6fbbe..4d046bf 100644 (file)
 *** Settings ***
 Documentation   Keywords file
 Library     ../Scripts/cleanup_db.py
+Library     ../Scripts/k8s_helper.py
 Resource   ../Resource/resource.robot
 Library     OperatingSystem
+Library     Process
 
 *** Keywords ***
 Get Request node b gnb
@@ -37,7 +39,15 @@ Update Ran request
 
 Add eNb Request
     Sleep  1s
-    POST    ${add_enb_url}   ${add_enb_request_body}
+    POST    ${enb_url}   ${add_enb_request_body}
+
+Delete eNb Request
+    Sleep  1s
+    DELETE    ${enb_url}/${enb_ran_name}
+
+Update eNb Request
+    Sleep  1s
+    PUT    ${enb_url}/${enb_ran_name}   ${update_enb_request_body}
 
 Set General Configuration request
     Sleep  1s
@@ -52,6 +62,7 @@ Remove log files
     Remove File  ${EXECDIR}/${e2mgr_log_filename}
     Remove File  ${EXECDIR}/${e2t_log_filename}
 
+
 Save logs
     Sleep   1s
     Run     ${Save_sim_log}
@@ -79,7 +90,6 @@ Init logs
     ${Save_sim_log}          Evaluate  "kubectl -n ricplt logs --since-time=${starting_timestamp} $(${gnbe2_sim_pod}) > ${gnb_log_filename}"
     ${Save_e2mgr_log}        Evaluate   "kubectl -n ricplt logs --since-time=${starting_timestamp} $(${e2mgr_pod}) > ${e2mgr_log_filename}"
     ${Save_e2t_log}          Evaluate   "kubectl -n ricplt logs --since-time=${starting_timestamp} $(${e2term_pod}) > ${e2t_log_filename}"
-
     Set Suite Variable  ${e2t_log_filename}
     Set Suite Variable  ${e2mgr_log_filename}
     Set Suite Variable  ${gnb_log_filename}
@@ -165,3 +175,27 @@ Stop All Pods Except Simulator
     Stop E2
     Stop Routing Manager
 
+Start Redis Monitor
+    Log To Console  Starting redis monitor log
+    ${redis_monitor_log_filename}      Evaluate      "redis_monitor.${SUITE NAME}.log".replace(" ","-")
+    Set Suite Variable  ${redis_monitor_log_filename}
+    Remove File  ${EXECDIR}/${redis_monitor_log_filename}
+    Start Process    kubectl -n ricplt exec -it statefulset-ricplt-dbaas-server-0 redis-cli MONITOR>${EXECDIR}/${redis_monitor_log_filename}  shell=yes
+
+Stop Redis Monitor
+    Log To Console  Stopping redis monitor log
+    log_scripts.kill_redis_monitor_root_process
+
+
+Redis Monitor Logs - Verify Publish To Manipulation Channel
+    [Arguments]       ${ran_name}    ${string}
+    Log To Console  Verify Publish To Manipulation Channel
+    ${result}=  log_scripts.verify_redis_monitor_manipulation_message   ${EXECDIR}/${redis_monitor_log_filename}  ${ran_name}    ${string}
+    Should Be Equal As Strings    ${result}      True
+
+Redis Monitor Logs - Verify Publish To Connection Status Channel
+    [Arguments]       ${ran_name}    ${string}
+    Log To Console    Verify Publish To Connection Status Channel
+    ${result}=  log_scripts.verify_redis_monitor_connection_status_message   ${EXECDIR}/${redis_monitor_log_filename}  ${ran_name}    ${string}
+    Should Be Equal As Strings    ${result}      True
+
index acc7ba8..7fab1a1 100644 (file)
@@ -33,11 +33,12 @@ ${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
+${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"]}}
+${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}}]}}
 ${header}  {"Content-Type": "application/json"}
 
 #K8S
@@ -69,4 +70,5 @@ ${RIC_RES_STATUS_REQ_message_type_successfully_sent}     Message type: 10090 - S
 ${E2_TERM_KEEP_ALIVE_REQ_message_type_successfully_sent}     Message type: 1101 - Successfully sent RMR message
 ${save_general_configuration}      SetGeneralConfigurationHandler.Handle - save general configuration to rnib: {EnableRic:false}
 ${set_and_publish_disconnect}      RnibDataService.UpdateNodebInfoOnConnectionStatusInversion - stateChangeMessageChannel: RAN_CONNECTION_STATUS_CHANGE, event: gnb_208_092_303030_DISCONNECTED
-
+${delete_enb_log_message}    RAN name: ${enb_ran_name} - deleted successfully
+${update_enb_log_message}    RAN name: ${enb_ran_name} - Successfully updated eNB
index 80b1829..2a84943 100644 (file)
@@ -24,9 +24,9 @@ import subprocess
 
 
 def extract_service_ip(service_name):
-    k8s_command = "kubectl -n ricplt get services | /bin/grep {} | /bin/grep ClusterIP |  awk \'{{print $3}}\'"\
+    k8s_command = "kubectl -n ricplt get services | /bin/grep {} | /bin/grep ClusterIP |  awk \'{{print $3}}\'" \
         .format(service_name)
 
     service_ip = subprocess.check_output(["/bin/bash", "-c", k8s_command], universal_newlines=True)
 
-    return service_ip.strip()
+    return service_ip.strip()
\ No newline at end of file
diff --git a/Automation/Tests/Scripts/log_scripts.py b/Automation/Tests/Scripts/log_scripts.py
new file mode 100644 (file)
index 0000000..446ed11
--- /dev/null
@@ -0,0 +1,49 @@
+##############################################################################
+#
+#   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).
+#
+
+import subprocess
+
+
+def verify_log_message(file_path, message):
+
+    file = open(file_path, 'r')
+
+    for line in file:
+
+        if line.find(message) > 0:
+            return True
+
+    return False
+
+
+def verify_redis_monitor_manipulation_message(file_path, ran_name, action):
+    message = "\"PUBLISH\" \"{e2Manager},RAN_MANIPULATION\" \"" + ran_name + "_" + action + "\""
+    return verify_log_message(file_path, message)
+
+def verify_redis_monitor_connection_status_message(file_path, ran_name, status):
+    message = "\"PUBLISH\" \"{e2Manager},RAN_CONNECTION_STATUS_CHANGE\" \"" + ran_name + "_" + status + "\""
+    return verify_log_message(file_path, message)
+
+
+def kill_redis_monitor_root_process():
+    kill_command = "for pid in $(pidof redis-cli); do sudo kill -9 $pid; done"
+    return subprocess.check_output(["/bin/bash", "-c", kill_command], universal_newlines=True)
diff --git a/Automation/Tests/Update_ENB/Update_ENB.robot b/Automation/Tests/Update_ENB/Update_ENB.robot
new file mode 100644 (file)
index 0000000..e09c320
--- /dev/null
@@ -0,0 +1,65 @@
+##############################################################################
+#
+#   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     ../Scripts/log_scripts.py
+Library     ../Scripts/k8s_helper.py
+Library     REST        ${url}
+
+
+*** Variables ***
+${url}  ${e2mgr_address}
+
+*** Test Cases ***
+
+Prepare Redis Monitor Log
+    Start Redis Monitor
+
+Add eNB
+    Sleep  2s
+    Add eNb Request
+
+Update eNb
+    Sleep    2s
+    Update eNb Request
+    Integer  response status  200
+    String   response body enb enbType    HOME_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/__init__.robot b/Automation/Tests/Update_ENB/__init__.robot
new file mode 100644 (file)
index 0000000..067afd2
--- /dev/null
@@ -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