--- /dev/null
+*** Settings ***
+Suite Setup Prepare Enviorment
+Resource ../Resource/resource.robot
+Resource ../Resource/Keywords.robot
+Resource ../Resource/scripts_variables.robot
+Library OperatingSystem
+Library ../Scripts/find_rmr_message.py
+Library ../Scripts/cleanup_db.py
+Library ../Scripts/e2t_init_script.py
+
+*** Test Cases ***
+
+Test New E2T Send Init
+ Stop E2
+
+ ${result}= cleanup_db.flush_and_restore_without_e2t_keys
+ Should Be Equal As Strings ${result} True
+
+ Start E2
+
+ ${result}= e2t_init_script.verify_db_e2t_addresses
+ Should Be Equal As Strings ${result} True
+
+ ${result}= e2t_init_script.verify_db_e2t_instance
+ Should Be Equal As Strings ${result} True
+
+prepare logs for tests
+ Remove log files
+ Save logs
+
+E2M Logs - Verify RMR Message
+ ${result} find_rmr_message.verify_logs ${EXECDIR} ${e2mgr_log_filename} ${E2_INIT_message_type} ${None}
+ Should Be Equal As Strings ${result} True
+
+
+
--- /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 E2Term-Initialization
Should Be Equal As Integers ${result[1]} ${docker_number}
Sleep 2s
+Stop E2
+ Run And Return Rc And Output ${stop_e2}
+ ${result}= Run And Return Rc And Output ${docker_command}
+ Should Be Equal As Integers ${result[1]} ${docker_number-1}
+ Sleep 2s
+
Start Dbass
Run And Return Rc And Output ${dbass_remove}
Run And Return Rc And Output ${dbass_start}
${restart_e2adapter} docker restart e2adapter
${restart_rsm} docker restart rsm
${start_e2} docker start e2
-${stop_docker_e2} docker stop e2
+${stop_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
${RAN_RESTARTED_message_type} MType: 1210
${RIC_X2_RESET_REQ_message_type} MType: 10070
${RIC_X2_RESET_RESP_message_type} MType: 10070
+${E2_INIT_message_type} MType: 1100
#${failed_to_retrieve_nodeb_message} failed to retrieve nodeB entity. RanName: test1.
#{#RanReconnectionManager.ReconnectRan - RAN name: test1 - Failed fetching RAN from rNib. Error: dial tcp 172.17.0.2:637 #9: i/o timeout"
${failed_to_retrieve_nodeb_message} RAN name: test1 - Failed fetching RAN from rNib
r.set("{rsm},CFG:GENERAL:v1.0.0" , "{\"enableResourceStatus\":true,\"partialSuccessAllowed\":true,\"prbPeriodic\":true,\"tnlLoadIndPeriodic\":true,\"wwLoadIndPeriodic\":true,\"absStatusPeriodic\":true,\"rsrpMeasurementPeriodic\":true,\"csiPeriodic\":true,\"periodicityMs\":1,\"periodicityRsrpMeasurementMs\":3,\"periodicityCsiMs\":3}")
+ r.set("{e2Manager},E2TAddresses", "[\"e2t.att.com:38000\"]")
+
+ r.set("{e2Manager},E2TInstance:e2t.att.com:38000", "{\"address\":\"e2t.att.com:38000\",\"associatedRanList\":[],\"keepAliveTimestamp\":1575974678854116185,\"state\":\"ACTIVE\"}")
+
+ return True
+
+def flush_and_restore_without_e2t_keys():
+
+ c = config.redis_ip_address
+
+ p = config.redis_ip_port
+
+ r = redis.Redis(host=c, port=p, db=0)
+
+ r.flushall()
+
+ r.set("{rsm},CFG:GENERAL:v1.0.0" , "{\"enableResourceStatus\":true,\"partialSuccessAllowed\":true,\"prbPeriodic\":true,\"tnlLoadIndPeriodic\":true,\"wwLoadIndPeriodic\":true,\"absStatusPeriodic\":true,\"rsrpMeasurementPeriodic\":true,\"csiPeriodic\":true,\"periodicityMs\":1,\"periodicityRsrpMeasurementMs\":3,\"periodicityCsiMs\":3}")
+
return True
--- /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.
+#
+##############################################################################
+
+import config
+import redis
+
+
+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_db_e2t_addresses():
+
+ r = getRedisClientDecodeResponse()
+
+ value = "[\"e2t.att.com:38000\"]"
+
+ return r.get("{e2Manager},E2TAddresses") == value
+
+
+def verify_db_e2t_instance():
+
+ r = getRedisClientDecodeResponse()
+
+ e2_address = "\"address\":\"e2t.att.com:38000\""
+ e2_associated_ran_list = "\"associatedRanList\":[]"
+ e2_state = "\"state\":\"ACTIVE\""
+
+ e2_db_instance = r.get("{e2Manager},E2TInstance:e2t.att.com:38000")
+
+ if e2_db_instance.find(e2_address) < 0:
+ return False
+ if e2_db_instance.find(e2_associated_ran_list) < 0:
+ return False
+ if e2_db_instance.find(e2_state) < 0:
+ return False
+
+ return True
\ No newline at end of file
for l in f:
- if l.find(mtype) > 0 and l.find(meid) > 0:
- return True
+ if (meid is not None):
+ if l.find(mtype) > 0 and l.find(meid) > 0:
+ return True
+ else:
+ if l.find(mtype) > 0:
+ return True
return False
import config
import redis
-import cleanup_db
import json
value = "{\"ranName\":\"test1\",\"enb1MeasurementId\":1,\"enb2MeasurementId\":0,\"action\":\"start\",\"actionStatus\":false}"
- if r.get("{rsm},RAN:test1") == value:
- return True
- else:
- return False
+ return r.get("{rsm},RAN:test1") == value
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
+ 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
+ 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
-
+ 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
+ return configJson["enableResourceStatus"] == True
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
+ return configJson["enableResourceStatus"] == False
\ No newline at end of file