From: Irina Date: Wed, 27 Nov 2019 14:01:09 +0000 (+0200) Subject: [RICPLT-2734] E2Mgr: Automation X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F15%2F1815%2F1;p=ric-plt%2Fe2mgr.git [RICPLT-2734] E2Mgr: Automation Change-Id: I8b6b04688d5e3141905eca1de916bb01528dcdd4 Signed-off-by: Irina --- diff --git a/Automation/Tests/ENDC-Setup/ENDC_Setup_request_test.robot b/Automation/Tests/ENDC-Setup/ENDC_Setup_request_test.robot index 285a2a3..2b54969 100755 --- a/Automation/Tests/ENDC-Setup/ENDC_Setup_request_test.robot +++ b/Automation/Tests/ENDC-Setup/ENDC_Setup_request_test.robot @@ -23,6 +23,7 @@ Resource ../Resource/Keywords.robot Resource ../Resource/scripts_variables.robot Library OperatingSystem Library ../Scripts/find_rmr_message.py +Library ../Scripts/rsmscripts.py Library REST ${url} @@ -66,5 +67,7 @@ RSM RESOURCE STATUS REQUEST message not sent ${result} find_rmr_message.verify_logs ${EXECDIR} ${rsm_log_filename} ${RIC_RES_STATUS_REQ_message_type_successfully_sent} ${RAN_NAME_test2} Should Be Equal As Strings ${result} False - +Verify RSM RAN info doesn't exist in redis + ${result}= rsmscripts.verify_rsm_ran_info + Should Be Equal As Strings ${result} False diff --git a/Automation/Tests/ENDC_Reset_RAN_TO_RIC/Reset_RAN_Found.robot b/Automation/Tests/ENDC_Reset_RAN_TO_RIC/Reset_RAN_Found.robot index e17b18a..1c2b301 100644 --- a/Automation/Tests/ENDC_Reset_RAN_TO_RIC/Reset_RAN_Found.robot +++ b/Automation/Tests/ENDC_Reset_RAN_TO_RIC/Reset_RAN_Found.robot @@ -28,6 +28,7 @@ Library String Library Process Library ../Scripts/find_rmr_message.py Library ../Scripts/find_error_script.py +Library ../Scripts/rsmscripts.py *** Test Cases *** @@ -75,3 +76,7 @@ RAN Restarted messege sent RSM RESOURCE STATUS REQUEST message not sent ${result} find_rmr_message.verify_logs ${EXECDIR} ${rsm_log_filename} ${RIC_RES_STATUS_REQ_message_type_successfully_sent} ${RAN_NAME_test2} Should Be Equal As Strings ${result} False + +Verify RSM RAN info doesn't exist in redis + ${result}= rsmscripts.verify_rsm_ran_info + Should Be Equal As Strings ${result} False \ No newline at end of file diff --git a/Automation/Tests/ENDC_Reset_RIC_TO_RAN/Reset_Happy_no_cause.robot b/Automation/Tests/ENDC_Reset_RIC_TO_RAN/Reset_Happy_no_cause.robot index cccd10b..1feac53 100644 --- a/Automation/Tests/ENDC_Reset_RIC_TO_RAN/Reset_Happy_no_cause.robot +++ b/Automation/Tests/ENDC_Reset_RIC_TO_RAN/Reset_Happy_no_cause.robot @@ -23,6 +23,7 @@ Resource ../Resource/resource.robot Resource ../Resource/Keywords.robot Library OperatingSystem Library ../Scripts/find_rmr_message.py +Library ../Scripts/rsmscripts.py Library REST ${url} @@ -53,4 +54,8 @@ RAN Restarted messege sent RSM RESOURCE STATUS REQUEST message not sent ${result} find_rmr_message.verify_logs ${EXECDIR} ${rsm_log_filename} ${RIC_RES_STATUS_REQ_message_type_successfully_sent} ${RAN_NAME_test2} - Should Be Equal As Strings ${result} False \ No newline at end of file + Should Be Equal As Strings ${result} False + +Verify RSM RAN info doesn't exist in redis + ${result}= rsmscripts.verify_rsm_ran_info + Should Be Equal As Strings ${result} False diff --git a/Automation/Tests/ENDC_Reset_RIC_TO_RAN/Reset_Happy_with_cause.robot b/Automation/Tests/ENDC_Reset_RIC_TO_RAN/Reset_Happy_with_cause.robot index 92cf4f8..66881cb 100644 --- a/Automation/Tests/ENDC_Reset_RIC_TO_RAN/Reset_Happy_with_cause.robot +++ b/Automation/Tests/ENDC_Reset_RIC_TO_RAN/Reset_Happy_with_cause.robot @@ -23,6 +23,7 @@ Resource ../Resource/resource.robot Resource ../Resource/Keywords.robot Library OperatingSystem Library ../Scripts/find_rmr_message.py +Library ../Scripts/rsmscripts.py Library REST ${url} @@ -54,4 +55,8 @@ RAN Restarted messege sent RSM RESOURCE STATUS REQUEST message not sent ${result} find_rmr_message.verify_logs ${EXECDIR} ${rsm_log_filename} ${RIC_RES_STATUS_REQ_message_type_successfully_sent} ${RAN_NAME_test2} - Should Be Equal As Strings ${result} False \ No newline at end of file + Should Be Equal As Strings ${result} False + +Verify RSM RAN info doesn't exist in redis + ${result}= rsmscripts.verify_rsm_ran_info + Should Be Equal As Strings ${result} False \ No newline at end of file diff --git a/Automation/Tests/LoadInfomation/Loadinformation_adding_data_and_overwrite.robot b/Automation/Tests/LoadInfomation/Loadinformation_adding_data_and_overwrite.robot index 6600df2..0c71278 100644 --- a/Automation/Tests/LoadInfomation/Loadinformation_adding_data_and_overwrite.robot +++ b/Automation/Tests/LoadInfomation/Loadinformation_adding_data_and_overwrite.robot @@ -46,7 +46,7 @@ Trigger X-2 Setup for load information String response body connectionStatus CONNECTED -Verify Load information does exist in redis +Verify Load information exists in redis ${result}= loadscripts.verify_value Should Be Equal As Strings ${result} True diff --git a/Automation/Tests/Scripts/rsmscripts.py b/Automation/Tests/Scripts/rsmscripts.py new file mode 100644 index 0000000..5f1e4d1 --- /dev/null +++ b/Automation/Tests/Scripts/rsmscripts.py @@ -0,0 +1,42 @@ +############################################################################## +# +# 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. +# +############################################################################## + +import config +import redis +import cleanup_db + + +def getRedisClientDecodeResponse(): + + c = config.redis_ip_address + + p = config.redis_ip_port + + return redis.Redis(host=c, port=p, db=0, decode_responses=True) + + +def verify_rsm_ran_info(): + + r = getRedisClientDecodeResponse() + + value = "{\"ranName\":\"test1\",\"enb1MeasurementId\":1,\"enb2MeasurementId\":0,\"action\":\"start\",\"actionStatus\":false}" + + if r.get("{rsm},RAN:test1") == value: + return True + else: + return False \ No newline at end of file diff --git a/Automation/Tests/X2-Setup/X2_Setup_reuqest_test.robot b/Automation/Tests/X2-Setup/X2_Setup_reuqest_test.robot index f17bcc7..c531823 100755 --- a/Automation/Tests/X2-Setup/X2_Setup_reuqest_test.robot +++ b/Automation/Tests/X2-Setup/X2_Setup_reuqest_test.robot @@ -23,6 +23,7 @@ Resource ../Resource/Keywords.robot Resource ../Resource/scripts_variables.robot Library OperatingSystem Library ../Scripts/find_rmr_message.py +Library ../Scripts/rsmscripts.py Library REST ${url} *** Test Cases *** @@ -62,3 +63,6 @@ RSM RESOURCE STATUS REQUEST message sent ${result} find_rmr_message.verify_logs ${EXECDIR} ${rsm_log_filename} ${RIC_RES_STATUS_REQ_message_type_successfully_sent} ${RAN_NAME_test1} Should Be Equal As Strings ${result} True +Verify RSM RAN info exists in redis + ${result}= rsmscripts.verify_rsm_ran_info + Should Be Equal As Strings ${result} True \ No newline at end of file diff --git a/Automation/Tests/X2_Reset_RAN_TO_RIC/Reset_RAN_Found.robot b/Automation/Tests/X2_Reset_RAN_TO_RIC/Reset_RAN_Found.robot index bc6a588..811349d 100644 --- a/Automation/Tests/X2_Reset_RAN_TO_RIC/Reset_RAN_Found.robot +++ b/Automation/Tests/X2_Reset_RAN_TO_RIC/Reset_RAN_Found.robot @@ -27,7 +27,7 @@ Resource ../Resource/scripts_variables.robot Library String Library Process Library ../Scripts/find_rmr_message.py - +Library ../Scripts/rsmscripts.py @@ -69,3 +69,7 @@ RAN Restarted messege sent RSM RESOURCE STATUS REQUEST message sent ${result} find_rmr_message.verify_logs ${EXECDIR} ${rsm_log_filename} ${RIC_RES_STATUS_REQ_message_type_successfully_sent} ${RAN_NAME_test1} Should Be Equal As Strings ${result} True + +Verify RSM RAN info exists in redis + ${result}= rsmscripts.verify_rsm_ran_info + Should Be Equal As Strings ${result} True \ No newline at end of file diff --git a/Automation/Tests/X2_Reset_RIC_TO_RAN/Reset_Happy_no_cause.robot b/Automation/Tests/X2_Reset_RIC_TO_RAN/Reset_Happy_no_cause.robot index 41db2b8..b22cf7a 100644 --- a/Automation/Tests/X2_Reset_RIC_TO_RAN/Reset_Happy_no_cause.robot +++ b/Automation/Tests/X2_Reset_RIC_TO_RAN/Reset_Happy_no_cause.robot @@ -23,6 +23,7 @@ Resource ../Resource/resource.robot Resource ../Resource/Keywords.robot Library OperatingSystem Library ../Scripts/find_rmr_message.py +Library ../Scripts/rsmscripts.py Library REST ${url} @@ -53,4 +54,8 @@ RAN Restarted messege sent RSM RESOURCE STATUS REQUEST message sent ${result} find_rmr_message.verify_logs ${EXECDIR} ${rsm_log_filename} ${RIC_RES_STATUS_REQ_message_type_successfully_sent} ${RAN_NAME_test1} - Should Be Equal As Strings ${result} True \ No newline at end of file + Should Be Equal As Strings ${result} True + +Verify RSM RAN info exists in redis + ${result}= rsmscripts.verify_rsm_ran_info + Should Be Equal As Strings ${result} True \ No newline at end of file diff --git a/Automation/Tests/X2_Reset_RIC_TO_RAN/Reset_Happy_with_cause.robot b/Automation/Tests/X2_Reset_RIC_TO_RAN/Reset_Happy_with_cause.robot index cfec18c..c88c966 100644 --- a/Automation/Tests/X2_Reset_RIC_TO_RAN/Reset_Happy_with_cause.robot +++ b/Automation/Tests/X2_Reset_RIC_TO_RAN/Reset_Happy_with_cause.robot @@ -23,6 +23,7 @@ Resource ../Resource/resource.robot Resource ../Resource/Keywords.robot Library OperatingSystem Library ../Scripts/find_rmr_message.py +Library ../Scripts/rsmscripts.py Library REST ${url} @@ -54,4 +55,8 @@ RAN Restarted messege sent RSM RESOURCE STATUS REQUEST message sent ${result} find_rmr_message.verify_logs ${EXECDIR} ${rsm_log_filename} ${RIC_RES_STATUS_REQ_message_type_successfully_sent} ${RAN_NAME_test1} - Should Be Equal As Strings ${result} True \ No newline at end of file + Should Be Equal As Strings ${result} True + +Verify RSM RAN info exists in redis + ${result}= rsmscripts.verify_rsm_ran_info + Should Be Equal As Strings ${result} True \ No newline at end of file