RUN python3 -m pip install robotframework \
&& pip install --upgrade RESTinstance \
&& pip install docker \
+ && pip install -U robotframework-requests\
&& apt-get update
WORKDIR /opt
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
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
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
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
--- /dev/null
+##############################################################################
+#
+# 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
--- /dev/null
+##############################################################################
+#
+# 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
--- /dev/null
+##############################################################################
+#
+# 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
--- /dev/null
+##############################################################################
+#
+# 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
+
--- /dev/null
+##############################################################################
+#
+# 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
--- /dev/null
+##############################################################################
+#
+# 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
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
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
Run ${Save_e2mgr_log}
Run ${Save_e2t_log}
Run ${Save_rsm_log}
+ Run ${Save_e2e_simu_log}
Run ${Save_e2adapter_log}
${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}
*** 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
import config
import redis
import cleanup_db
+import json
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()
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
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
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
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
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