[RICPLT-2503] Automation start and stop 62/1962/1
authorIrina <ib565x@intl.att.com>
Sun, 8 Dec 2019 10:53:43 +0000 (12:53 +0200)
committerIrina <ib565x@intl.att.com>
Sun, 8 Dec 2019 10:53:57 +0000 (12:53 +0200)
Change-Id: I6ca7f808d5205420357f0bc7937cf76cbdf77dec
Signed-off-by: Irina <ib565x@intl.att.com>
18 files changed:
Automation/Dockerfile
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/RSM_Resource_Status/__init__.robot [new file with mode: 0755]
Automation/Tests/RSM_Resource_Status/resource_status_false_start.robot [new file with mode: 0644]
Automation/Tests/RSM_Resource_Status/resource_status_false_stop.robot [new file with mode: 0644]
Automation/Tests/RSM_Resource_Status/resource_status_keywords.robot [new file with mode: 0644]
Automation/Tests/RSM_Resource_Status/resource_status_true_start.robot [new file with mode: 0644]
Automation/Tests/RSM_Resource_Status/resource_status_true_stop.robot [new file with mode: 0644]
Automation/Tests/Resource/Keywords.robot
Automation/Tests/Resource/resource.robot
Automation/Tests/Scripts/rsmscripts.py
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 6733a6b..e981b44 100755 (executable)
@@ -3,6 +3,7 @@ FROM python:3.6
 RUN python3 -m pip install robotframework \
     && pip install --upgrade RESTinstance \
     && pip install docker \
+    && pip install -U robotframework-requests\
     && apt-get update 
 
 WORKDIR /opt
index 2b54969..50ed1a8 100755 (executable)
@@ -68,6 +68,6 @@ RSM RESOURCE STATUS REQUEST message not sent
     Should Be Equal As Strings    ${result}      False
 
 Verify RSM RAN info doesn't exist in redis
-   ${result}=   rsmscripts.verify_rsm_ran_info
+   ${result}=   rsmscripts.verify_rsm_ran_info_start_false
    Should Be Equal As Strings  ${result}    False
 
index 1c2b301..6b59931 100644 (file)
@@ -78,5 +78,5 @@ RSM RESOURCE STATUS REQUEST message not sent
     Should Be Equal As Strings    ${result}      False
 
 Verify RSM RAN info doesn't exist in redis
-   ${result}=   rsmscripts.verify_rsm_ran_info
+   ${result}=   rsmscripts.verify_rsm_ran_info_start_false
    Should Be Equal As Strings  ${result}    False
\ No newline at end of file
index 1feac53..2cd150b 100644 (file)
@@ -57,5 +57,5 @@ RSM RESOURCE STATUS REQUEST message not sent
     Should Be Equal As Strings    ${result}      False
 
 Verify RSM RAN info doesn't exist in redis
-   ${result}=   rsmscripts.verify_rsm_ran_info
+   ${result}=   rsmscripts.verify_rsm_ran_info_start_false
    Should Be Equal As Strings  ${result}    False
index 66881cb..6ddc492 100644 (file)
@@ -58,5 +58,5 @@ RSM RESOURCE STATUS REQUEST message not sent
     Should Be Equal As Strings    ${result}      False
 
 Verify RSM RAN info doesn't exist in redis
-   ${result}=   rsmscripts.verify_rsm_ran_info
+   ${result}=   rsmscripts.verify_rsm_ran_info_start_false
    Should Be Equal As Strings  ${result}    False
\ No newline at end of file
diff --git a/Automation/Tests/RSM_Resource_Status/__init__.robot b/Automation/Tests/RSM_Resource_Status/__init__.robot
new file mode 100755 (executable)
index 0000000..4a008d9
--- /dev/null
@@ -0,0 +1,20 @@
+##############################################################################
+#
+#   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.
+#
+##############################################################################
+
+*** Settings ***
+Documentation    Resource status
diff --git a/Automation/Tests/RSM_Resource_Status/resource_status_false_start.robot b/Automation/Tests/RSM_Resource_Status/resource_status_false_start.robot
new file mode 100644 (file)
index 0000000..e6b969a
--- /dev/null
@@ -0,0 +1,56 @@
+##############################################################################
+#
+#   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.
+#
+##############################################################################
+
+*** Settings ***
+Suite Setup   Prepare Enviorment
+Resource   ../Resource/resource.robot
+Resource   ../Resource/Keywords.robot
+Resource   ../Resource/scripts_variables.robot
+Resource   resource_status_keywords.robot
+Library    ../Scripts/rsmscripts.py
+Library     ../Scripts/find_rmr_message.py
+Library    OperatingSystem
+Library    REST      ${url_rsm}
+Suite Teardown  Delete All Sessions
+
+
+*** Test Cases ***
+Run setup
+    rsmscripts.set_general_config_resource_status_false
+
+    Prepare Ran In Connected Status
+
+Put Http Start Request To RSM
+    Put Request Resource Status Start
+    Integer  response status  204
+
+Verify RSM RAN Info Status Is Start And True In Redis
+    ${result}=   rsmscripts.verify_rsm_ran_info_start_true
+    Should Be Equal As Strings  ${result}    True
+
+Verify RSM Enable Resource Status Is True In General Configuration In Redis
+    ${result}=   rsmscripts.verify_general_config_enable_resource_status_true
+    Should Be Equal As Strings  ${result}    True
+    
+prepare logs for tests
+    Remove log files
+    Save logs
+
+Verify 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
diff --git a/Automation/Tests/RSM_Resource_Status/resource_status_false_stop.robot b/Automation/Tests/RSM_Resource_Status/resource_status_false_stop.robot
new file mode 100644 (file)
index 0000000..45344ff
--- /dev/null
@@ -0,0 +1,56 @@
+##############################################################################
+#
+#   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.
+#
+##############################################################################
+
+*** Settings ***
+Suite Setup   Prepare Enviorment
+Resource   ../Resource/resource.robot
+Resource   ../Resource/Keywords.robot
+Resource   ../Resource/scripts_variables.robot
+Resource   resource_status_keywords.robot
+Library    ../Scripts/rsmscripts.py
+Library     ../Scripts/find_rmr_message.py
+Library    OperatingSystem
+Library    REST      ${url_rsm}
+Suite Teardown  Delete All Sessions
+
+
+*** Test Cases ***
+Run setup
+    rsmscripts.set_general_config_resource_status_false
+
+    Prepare Ran In Connected Status
+
+Put Http Stop Request To RSM
+    Put Request Resource Status Stop
+    Integer  response status  204
+
+Verify RSM RAN Info Status Is Stop And True In Redis
+    ${result}=   rsmscripts.verify_rsm_ran_info_stop_true
+    Should Be Equal As Strings  ${result}    True
+
+Verify RSM Enable Resource Status Is False In General Configuration In Redis
+    ${result}=   rsmscripts.verify_general_config_enable_resource_status_false
+    Should Be Equal As Strings  ${result}    True
+    
+prepare logs for tests
+    Remove log files
+    Save logs
+
+Verify 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}      False
\ No newline at end of file
diff --git a/Automation/Tests/RSM_Resource_Status/resource_status_keywords.robot b/Automation/Tests/RSM_Resource_Status/resource_status_keywords.robot
new file mode 100644 (file)
index 0000000..2dc0ec2
--- /dev/null
@@ -0,0 +1,36 @@
+##############################################################################
+#
+#   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.
+#
+##############################################################################
+
+*** Settings ***
+Documentation   Keywords file
+Library     ../Scripts/cleanup_db.py
+Resource   ../Resource/resource.robot
+Library    Collections
+Library    OperatingSystem
+Library    json
+Library    RequestsLibrary
+
+
+
+*** Keywords ***
+Prepare Ran In Connected Status
+    Create Session  x2setup  ${url}
+    ${headers}=  Create Dictionary    Accept=application/json    Content-Type=application/json
+    ${resp}=    Post Request   x2setup    /v1/nodeb/x2-setup    data=${json_setup_rsm_tests}    headers=${headers}
+    Should Be Equal As Strings    ${resp.status_code}    204
+
diff --git a/Automation/Tests/RSM_Resource_Status/resource_status_true_start.robot b/Automation/Tests/RSM_Resource_Status/resource_status_true_start.robot
new file mode 100644 (file)
index 0000000..21f9217
--- /dev/null
@@ -0,0 +1,54 @@
+##############################################################################
+#
+#   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.
+#
+##############################################################################
+
+*** Settings ***
+Suite Setup   Prepare Enviorment
+Resource   ../Resource/resource.robot
+Resource   ../Resource/Keywords.robot
+Resource   ../Resource/scripts_variables.robot
+Resource   resource_status_keywords.robot
+Library    ../Scripts/rsmscripts.py
+Library     ../Scripts/find_rmr_message.py
+Library    OperatingSystem
+Library    REST      ${url_rsm}
+Suite Teardown  Delete All Sessions
+
+
+*** Test Cases ***
+Run setup
+    Prepare Ran In Connected Status
+
+Put Http Start Request To RSM
+    Put Request Resource Status Start
+    Integer  response status  204
+
+Verify RSM RAN Info Status Is Start And True In Redis
+    ${result}=   rsmscripts.verify_rsm_ran_info_start_true
+    Should Be Equal As Strings  ${result}    True
+
+Verify RSM Enable Resource Status Is True In General Configuration In Redis
+    ${result}=   rsmscripts.verify_general_config_enable_resource_status_true
+    Should Be Equal As Strings  ${result}    True
+    
+prepare logs for RSM tests
+    Remove log files
+    Save logs
+
+Verify 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
diff --git a/Automation/Tests/RSM_Resource_Status/resource_status_true_stop.robot b/Automation/Tests/RSM_Resource_Status/resource_status_true_stop.robot
new file mode 100644 (file)
index 0000000..32cab38
--- /dev/null
@@ -0,0 +1,54 @@
+##############################################################################
+#
+#   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.
+#
+##############################################################################
+
+*** Settings ***
+Suite Setup   Prepare Enviorment
+Resource   ../Resource/resource.robot
+Resource   ../Resource/Keywords.robot
+Resource   ../Resource/scripts_variables.robot
+Resource   resource_status_keywords.robot
+Library    ../Scripts/rsmscripts.py
+Library     ../Scripts/find_rmr_message.py
+Library    OperatingSystem
+Library    REST      ${url_rsm}
+Suite Teardown  Delete All Sessions
+
+
+*** Test Cases ***
+Run setup
+    Prepare Ran In Connected Status
+
+Put Http Stop Request To RSM
+    Put Request Resource Status Stop
+    Integer  response status  204
+
+#Verify RSM RAN Info Status Is Stop And False In Redis
+#${result}=   rsmscripts.verify_rsm_ran_info_stop_false
+#Should Be Equal As Strings  ${result}    True
+
+Verify RSM Enable Resource Status Is False In General Configuration In Redis
+    ${result}=   rsmscripts.verify_general_config_enable_resource_status_false
+    Should Be Equal As Strings  ${result}    True
+
+prepare logs for tests
+    Remove log files
+    Save logs
+
+Verify 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
index 805f37a..05d87e3 100755 (executable)
@@ -32,6 +32,14 @@ Post Request setup node b x-2
     POST        /v1/nodeb/x2-setup    ${json}
 
 
+Put Request Resource Status Start
+    Set Headers     ${header}
+    PUT        /v1/general/resourcestatus  ${resource_status_start_json}
+
+
+Put Request Resource Status Stop
+    Set Headers     ${header}
+    PUT        /v1/general/resourcestatus  ${resource_status_stop_json}
 
 Get Request node b enb test1
     Sleep    1s
@@ -48,6 +56,7 @@ Remove log files
     Remove File  ${EXECDIR}/${e2mgr_log_filename}
     Remove File  ${EXECDIR}/${e2t_log_filename}
     Remove File  ${EXECDIR}/${rsm_log_filename}
+    Remove File  ${EXECDIR}/${e2e_simu_log_filename}
     Remove File  ${EXECDIR}/${e2adapter_log_filename}
 
 Save logs
@@ -56,6 +65,7 @@ Save logs
     Run     ${Save_e2mgr_log}
     Run     ${Save_e2t_log}
     Run     ${Save_rsm_log}
+    Run     ${Save_e2e_simu_log}
     Run     ${Save_e2adapter_log}
 
 
@@ -82,28 +92,35 @@ Prepare Enviorment
      ${e2mgr_log_filename}    Evaluate      "e2mgr.${SUITE NAME}.log".replace(" ","-")
      ${gnb_log_filename}      Evaluate      "gnb.${SUITE NAME}.log".replace(" ","-")
      ${rsm_log_filename}      Evaluate      "rsm.${SUITE NAME}.log".replace(" ","-")
+     ${e2e_simu_log_filename}      Evaluate      "e2esimu.${SUITE NAME}.log".replace(" ","-")
      ${e2adapter_log_filename}    Evaluate  "e2adapter.${SUITE NAME}.log".replace(" ","-")
      ${Save_sim_log}          Evaluate   'docker logs --since ${starting_timestamp} gnbe2_simu > ${gnb_log_filename}'
      ${Save_e2mgr_log}        Evaluate   'docker logs --since ${starting_timestamp} e2mgr > ${e2mgr_log_filename}'
      ${Save_e2t_log}          Evaluate   'docker logs --since ${starting_timestamp} e2 > ${e2t_log_filename}'
      ${Save_rsm_log}          Evaluate   'docker logs --since ${starting_timestamp} rsm > ${rsm_log_filename}'
+     ${Save_e2e_simu_log}     Evaluate   'docker logs --since ${starting_timestamp} e2esimu > ${e2e_simu_log_filename}'
      ${Save_e2adapter_log}    Evaluate   'docker logs --since ${starting_timestamp} e2adapter > ${e2adapter_log_filename}'
      Set Suite Variable  ${e2t_log_filename}  
      Set Suite Variable  ${e2mgr_log_filename}  
      Set Suite Variable  ${gnb_log_filename}   
      Set Suite Variable  ${rsm_log_filename}  
+     Set Suite Variable  ${e2e_simu_log_filename} 
      Set Suite Variable  ${e2adapter_log_filename} 
      Set Suite Variable  ${Save_sim_log}
      Set Suite Variable  ${Save_e2mgr_log}
      Set Suite Variable  ${Save_e2t_log}
      Set Suite Variable  ${Save_rsm_log}
+     Set Suite Variable  ${Save_e2e_simu_log}
      Set Suite Variable  ${Save_e2adapter_log}
        
      ${flush}  cleanup_db.flush
      Should Be Equal As Strings  ${flush}  True
      Run And Return Rc And Output    ${stop_simu}
+     Run And Return Rc And Output    ${stop_e2e_simu}
      Run And Return Rc And Output    ${docker_Remove}
+     Run And Return Rc And Output    ${docker_remove_e2e_simu}
      Run And Return Rc And Output    ${run_simu_regular}
+     Run And Return Rc And Output    ${run_e2e_simu_regular}
      Run And Return Rc And Output    ${restart_e2adapter}
      Sleep  2s
      ${result}=  Run And Return Rc And Output     ${docker_command}
index 68262fd..f4add1e 100755 (executable)
@@ -21,34 +21,40 @@ Documentation    Resource file
 
 
 *** Variables ***
-${docker_number}    6
-${docker_number-1}    5
+${docker_number}    7
+${docker_number-1}    6
 ${ip_gnb_simu} 10.0.2.15
 ${ip_e2adapter}        10.0.2.15
 ${url}   http://localhost:3800
+${url_rsm}   http://localhost:4800
+${json_setup_rsm_tests}    {"ranIp": "10.0.2.15","ranPort": 36422,"ranName":"test1"}
 ${json}    {"ranIp": "10.0.2.15","ranPort": 5577,"ranName":"test1"}
 ${endcbadjson}    {"ranIp": "a","ranPort": 49999,"ranName":"test2"}
 ${endcjson}    {"ranIp": "10.0.2.15","ranPort": 49999,"ranName":"test2"}
 ${resetcausejson}   {"cause": "misc:not-enough-user-plane-processing-resources"}
 ${resetbadcausejson}   {"cause": "bla" }
 ${resetbad1causejson}   {"cause":  }
+${resource_status_start_json}   {"enableResourceStatus":true}
+${resource_status_stop_json}    {"enableResourceStatus":false}
 ${header}  {"Content-Type": "application/json"}
 ${docker_command}  docker ps | grep Up | wc --lines
 ${run_simu_load}   docker run -d --name gnbe2_simu --env gNBipv4=localhost  --env gNBport=36422  --env duration=600000000000 --env indicationReportRate=1000000000 --env indicationInsertRate=0 -p 5577:36422/sctp snapshot.docker.ranco-dev-tools.eastus.cloudapp.azure.com:10001/gnbe2_simu:1.0.6
-#${run_simu_load}   docker run -d --name gnbe2_simu  -h gnb-sim --env gNBipv4=gnb-sim  --env gNBport=5577/sctp  --env duration=600000000000 --env indicationReportRate=1000000000 --env indicationInsertRate=0 snapshot.docker.ranco-dev-tools.eastus.cloudapp.azure.com:10001/gnbe2_simu:1.0.6
+${stop_e2e_simu}  docker stop e2e_simu
 ${stop_simu}  docker stop gnbe2_simu
 ${run_simu_regular}  docker run -d --name gnbe2_simu --env gNBipv4=localhost  --env gNBport=36422 --env duration=600000000000 --env indicationReportRate=0 --env indicationInsertRate=0 -p 5577:36422/sctp snapshot.docker.ranco-dev-tools.eastus.cloudapp.azure.com:10001/gnbe2_simu:1.0.6
-#${run_simu_regular}  docker run -d --name gnbe2_simu  -h gnb-sim --env gNBipv4=gnb-sim  --env gNBport=5577/sctp --env duration=600000000000 --env indicationReportRate=0 --env indicationInsertRate=0  snapshot.docker.ranco-dev-tools.eastus.cloudapp.azure.com:10001/gnbe2_simu:1.0.6
+${run_e2e_simu_regular}  docker run -d --name e2e_simu -p 36422:36422 --net host -it snapshot.docker.ranco-dev-tools.eastus.cloudapp.azure.com:10001/e2sim:1.4.0 sh -c "./build/e2sim 10.0.2.15 36422"
 ${docker_Remove}    docker rm gnbe2_simu
+${docker_remove_e2e_simu}    docker rm e2e_simu
 ${docker_restart}   docker restart e2mgr
 ${restart_simu}  docker restart gnbe2_simu
+${restart_e2e_simu}  docker restart e2e_simu
 ${restart_e2adapter}  docker restart e2adapter
+${restart_rsm}  docker restart rsm
 ${start_e2}  docker start e2
 ${stop_docker_e2}      docker stop e2
 ${dbass_start}   docker run -d --name dbass -p 6379:6379 --env DBAAS_SERVICE_HOST=10.0.2.15  snapshot.docker.ranco-dev-tools.eastus.cloudapp.azure.com:10001/dbass:1.0.0
 ${dbass_remove}    docker rm dbass
 ${dbass_stop}      docker stop dbass
-${restart_simu}  docker restart gnbe2_simu
 ${start_e2}  docker start e2
 ${stop_docker_e2}      docker stop e2
 ${Run_Config}       docker exec gnbe2_simu pkill gnbe2_simu -INT
index 5f1e4d1..40c4d35 100644 (file)
@@ -19,6 +19,7 @@
 import config
 import redis
 import cleanup_db
+import json
 
 
 def getRedisClientDecodeResponse():
@@ -29,8 +30,12 @@ def getRedisClientDecodeResponse():
 
     return redis.Redis(host=c, port=p, db=0, decode_responses=True)
 
+def set_general_config_resource_status_false():
 
-def verify_rsm_ran_info():
+    r = getRedisClientDecodeResponse()
+    r.set("{rsm},CFG:GENERAL:v1.0.0" , "{\"enableResourceStatus\":false,\"partialSuccessAllowed\":true,\"prbPeriodic\":true,\"tnlLoadIndPeriodic\":true,\"wwLoadIndPeriodic\":true,\"absStatusPeriodic\":true,\"rsrpMeasurementPeriodic\":true,\"csiPeriodic\":true,\"periodicityMs\":1,\"periodicityRsrpMeasurementMs\":3,\"periodicityCsiMs\":3}")
+
+def verify_rsm_ran_info_start_false():
 
     r = getRedisClientDecodeResponse()
     
@@ -38,5 +43,65 @@ def verify_rsm_ran_info():
 
     if r.get("{rsm},RAN:test1") == value:
         return True
+    else:
+        return False
+
+
+def verify_rsm_ran_info_start_true():
+
+    r = getRedisClientDecodeResponse()
+    
+    rsmInfoStr = r.get("{rsm},RAN:test1")
+    rsmInfoJson = json.loads(rsmInfoStr)
+
+    response = rsmInfoJson["ranName"] == "test1" and rsmInfoJson["enb1MeasurementId"] == 1 and rsmInfoJson["enb2MeasurementId"] != 1 and rsmInfoJson["action"] == "start" and rsmInfoJson["actionStatus"] == True
+
+    return response       
+
+
+def verify_rsm_ran_info_stop_false():
+
+    r = getRedisClientDecodeResponse()
+    
+    rsmInfoStr = r.get("{rsm},RAN:test1")
+    rsmInfoJson = json.loads(rsmInfoStr)
+
+    response = rsmInfoJson["ranName"] == "test1" and rsmInfoJson["enb1MeasurementId"] == 1 and rsmInfoJson["action"] == "stop" and rsmInfoJson["actionStatus"] == False
+
+    return response       
+
+
+def verify_rsm_ran_info_stop_true():
+
+    r = getRedisClientDecodeResponse()
+    
+    rsmInfoStr = r.get("{rsm},RAN:test1")
+    rsmInfoJson = json.loads(rsmInfoStr)
+
+    response = rsmInfoJson["ranName"] == "test1" and rsmInfoJson["action"] == "stop" and rsmInfoJson["actionStatus"] == True
+
+    return response         
+      
+def verify_general_config_enable_resource_status_true():
+
+    r = getRedisClientDecodeResponse()
+    
+    configStr = r.get("{rsm},CFG:GENERAL:v1.0.0")
+    configJson = json.loads(configStr)
+
+    if configJson["enableResourceStatus"] == True:
+        return True
+    else:
+        return False
+
+def verify_general_config_enable_resource_status_false():
+
+    r = getRedisClientDecodeResponse()
+    
+    configStr = r.get("{rsm},CFG:GENERAL:v1.0.0")
+    configJson = json.loads(configStr)
+
+    if configJson["enableResourceStatus"] == False:
+        return True
     else:
         return False
\ No newline at end of file
index c531823..da14d32 100755 (executable)
@@ -64,5 +64,5 @@ RSM RESOURCE STATUS REQUEST message sent
     Should Be Equal As Strings    ${result}      True
 
 Verify RSM RAN info exists in redis
-   ${result}=   rsmscripts.verify_rsm_ran_info
+   ${result}=   rsmscripts.verify_rsm_ran_info_start_false
    Should Be Equal As Strings  ${result}    True
\ No newline at end of file
index 811349d..a4e8806 100644 (file)
@@ -71,5 +71,5 @@ RSM RESOURCE STATUS REQUEST message sent
     Should Be Equal As Strings    ${result}      True
 
 Verify RSM RAN info exists in redis
-   ${result}=   rsmscripts.verify_rsm_ran_info
+   ${result}=   rsmscripts.verify_rsm_ran_info_start_false
    Should Be Equal As Strings  ${result}    True
\ No newline at end of file
index b22cf7a..f27fede 100644 (file)
@@ -57,5 +57,5 @@ RSM RESOURCE STATUS REQUEST message sent
     Should Be Equal As Strings    ${result}      True
 
 Verify RSM RAN info exists in redis
-   ${result}=   rsmscripts.verify_rsm_ran_info
+   ${result}=   rsmscripts.verify_rsm_ran_info_start_false
    Should Be Equal As Strings  ${result}    True
\ No newline at end of file
index c88c966..706f17f 100644 (file)
@@ -58,5 +58,5 @@ RSM RESOURCE STATUS REQUEST message sent
     Should Be Equal As Strings    ${result}      True
 
 Verify RSM RAN info exists in redis
-   ${result}=   rsmscripts.verify_rsm_ran_info
+   ${result}=   rsmscripts.verify_rsm_ran_info_start_false
    Should Be Equal As Strings  ${result}    True
\ No newline at end of file