[RICPLT-2734] E2Mgr: Automation 15/1815/1
authorIrina <ib565x@intl.att.com>
Wed, 27 Nov 2019 14:01:09 +0000 (16:01 +0200)
committerIrina <ib565x@intl.att.com>
Wed, 27 Nov 2019 14:01:19 +0000 (16:01 +0200)
Change-Id: I8b6b04688d5e3141905eca1de916bb01528dcdd4
Signed-off-by: Irina <ib565x@intl.att.com>
Automation/Tests/ENDC-Setup/ENDC_Setup_request_test.robot
Automation/Tests/ENDC_Reset_RAN_TO_RIC/Reset_RAN_Found.robot
Automation/Tests/ENDC_Reset_RIC_TO_RAN/Reset_Happy_no_cause.robot
Automation/Tests/ENDC_Reset_RIC_TO_RAN/Reset_Happy_with_cause.robot
Automation/Tests/LoadInfomation/Loadinformation_adding_data_and_overwrite.robot
Automation/Tests/Scripts/rsmscripts.py [new file with mode: 0644]
Automation/Tests/X2-Setup/X2_Setup_reuqest_test.robot
Automation/Tests/X2_Reset_RAN_TO_RIC/Reset_RAN_Found.robot
Automation/Tests/X2_Reset_RIC_TO_RAN/Reset_Happy_no_cause.robot
Automation/Tests/X2_Reset_RIC_TO_RAN/Reset_Happy_with_cause.robot

index 285a2a3..2b54969 100755 (executable)
@@ -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
 
index e17b18a..1c2b301 100644 (file)
@@ -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
index cccd10b..1feac53 100644 (file)
@@ -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
index 92cf4f8..66881cb 100644 (file)
@@ -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
index 6600df2..0c71278 100644 (file)
@@ -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 (file)
index 0000000..5f1e4d1
--- /dev/null
@@ -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
index f17bcc7..c531823 100755 (executable)
@@ -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
index bc6a588..811349d 100644 (file)
@@ -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
index 41db2b8..b22cf7a 100644 (file)
@@ -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
index cfec18c..c88c966 100644 (file)
@@ -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