1 ##############################################################################
3 # Copyright (c) 2019 AT&T Intellectual Property.
4 # Copyright (c) 2020 Samsung Electronics Co., Ltd. All Rights Reserved.
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
10 # http://www.apache.org/licenses/LICENSE-2.0
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
18 ##############################################################################
20 # This source code is part of the near-RT RIC (RAN Intelligent Controller)
21 # platform project (RICP).
25 Documentation Keywords file
26 Library ../Scripts/cleanup_db.py
27 Library ../Scripts/k8s_helper.py
28 Resource ../Resource/resource.robot
29 Library OperatingSystem
31 Variables ../Scripts/variables.py
35 [Arguments] ${nodeb_name}=${ranName}
37 GET ${getNodeb}/${nodeb_name}
39 Get request nodeb health
40 [Arguments] ${request_body}=${list_nodeb_body}
42 LOG health check url ${nodeb_health_url}
43 LOG health check body ${request_body}
44 PUT ${nodeb_health_url} ${request_body}
48 PUT ${update_gnb_url} ${update_gnb_body}
51 [Arguments] ${request}=${add_enb_request_body}
53 POST ${enb_url} ${request}
55 Get NodeB state request
56 [Arguments] ${request}=${nodeb_state_url}
62 DELETE ${enb_url}/${enb_ran_name}
65 [Arguments] ${request}=${update_enb_request_body}
67 PUT ${enb_url}/${enb_ran_name} ${request}
69 Set General Configuration request
71 PUT ${set_general_configuration} ${set_general_configuration_body}
73 Update Gnb request not valid
75 PUT ${update_gnb_url} ${update_gnb_body_notvalid}
78 Remove File ${EXECDIR}/${gnb_log_filename}
79 Remove File ${EXECDIR}/${e2mgr_log_filename}
80 Remove File ${EXECDIR}/${e2t_log_filename}
89 [Arguments] ${need_to_restart_pods}=${False} ${set_new_timestamp}=${True}
91 Flush And Populate DB ${set_new_timestamp}
92 Run keyword if ${need_to_restart_pods}==${True} Restart RM and GNB Simulator
93 Wait until keyword succeeds 2 min 10 sec Validate Required Dockers
95 Restart RM and GNB Simulator
96 Restart routing manager
97 Wait until keyword succeeds 2 min 10 sec Validate Required Dockers
102 ${starting_timestamp} Evaluate datetime.datetime.now(datetime.timezone.utc).isoformat("T") modules=datetime
103 ${e2t_log_filename} Evaluate "e2t.${SUITE NAME}.log".replace(" ","-")
104 ${e2mgr_log_filename} Evaluate "e2mgr.${SUITE NAME}.log".replace(" ","-")
105 ${gnb_log_filename} Evaluate "gnb.${SUITE NAME}.log".replace(" ","-")
106 ${Save_sim_log} Evaluate "kubectl -n ricplt logs --since-time=${starting_timestamp} $(${gnbe2_sim_pod}) > ${gnb_log_filename}"
107 ${Save_e2mgr_log} Evaluate "kubectl -n ricplt logs --since-time=${starting_timestamp} $(${e2mgr_pod}) > ${e2mgr_log_filename}"
108 ${Save_e2t_log} Evaluate "kubectl -n ricplt logs --since-time=${starting_timestamp} $(${e2term_pod}) > ${e2t_log_filename}"
109 Set Suite Variable ${e2t_log_filename}
110 Set Suite Variable ${e2mgr_log_filename}
111 Set Suite Variable ${gnb_log_filename}
112 Set Suite Variable ${Save_sim_log}
113 Set Suite Variable ${Save_e2mgr_log}
114 Set Suite Variable ${Save_e2t_log}
116 Validate Required Dockers
117 [Arguments] ${required_number_of_dockers}=${pods_number}
118 Log To Console Validating all required dockers are up
119 ${result}= Run And Return Rc And Output ${verify_all_pods_are_ready_command}
120 Should Be Equal As Integers ${result[1]} ${required_number_of_dockers}
123 Log to Console Starting E2Term
124 Run And Return Rc And Output ${start_e2}
128 Log to Console Stopping E2Term
129 Run And Return Rc And Output ${stop_e2}
133 Log to Console Starting E2Mgr
134 Run And Return Rc And Output ${start_e2mgr}
138 Log to Console Stopping E2Mgr
139 Run And Return Rc And Output ${stop_e2mgr}
143 Log to Console Starting redis
144 Run And Return Rc And Output ${dbass_start}
148 Log to Console Stopping redis
149 Run And Return Rc And Output ${dbass_stop}
153 log to console Stopping gnbe2 simulator
154 Run And Return Rc And Output ${stop_simu}
158 log to console Starting gnbe2 simulator
159 Run And Return Rc And Output ${start_simu}
162 Log to Console Restarting gnbe2 simulator
166 Start Routing Manager
167 Log to Console Starting routing manager
168 Run And Return Rc And Output ${start_routing_manager}
172 Log to Console Stopping routing manager
173 Run And Return Rc And Output ${stop_routing_manager}
176 Restart Routing Manager
177 Log to Console Restarting routing manager
179 Start Routing Manager
182 Log to Console Starting e2adapter
183 Run And Return Rc And Output ${start_e2adapter}
187 Log to Console Stopping e2adapter
188 Run And Return Rc And Output ${stop_e2adapter}
192 Log to Console Restarting e2adapter
196 Flush And Populate DB
197 [Arguments] ${set_new_timestamp}=${True}
198 Log To Console Flushing and populating DB
199 ${flush}= cleanup_db.flush ${set_new_timestamp}
201 Should Be Equal As Strings ${flush} True
203 Stop All Pods Except Simulator
210 Send eNB Setup Request
211 Log To Console Sending eNB setup request form e2adapter
213 Wait until keyword succeeds 2 min 3 sec Validate Required Dockers
214 ${e2adapter_pod} = Run And Return Rc And Output kubectl get pods -n ricplt | /bin/grep e2adapter | /bin/grep Running | awk '{{print $1}}'
215 ${send_enb_setup} Evaluate "kubectl -n ricplt exec -it ${e2adapter_pod[1]} cli send-e2setup-req 10.0.2.15"
216 Run And Return Rc And Output ${send_enb_setup}
219 Log To Console Starting redis monitor log
220 ${redis_monitor_log_filename} Evaluate "redis_monitor.${SUITE NAME}.log".replace(" ","-")
221 Set Suite Variable ${redis_monitor_log_filename}
222 Remove File ${EXECDIR}/${redis_monitor_log_filename}
223 Start Process kubectl -n ricplt exec -it statefulset-ricplt-dbaas-server-0 redis-cli MONITOR>${EXECDIR}/${redis_monitor_log_filename} shell=yes
226 Log To Console Stopping redis monitor log
227 log_scripts.kill_redis_monitor_root_process
230 Redis Monitor Logs - Verify Publish To Manipulation Channel
231 [Arguments] ${ran_name} ${event}
232 Log To Console Verify Publish To Manipulation Channel
234 ${result}= log_scripts.verify_redis_monitor_manipulation_message ${EXECDIR}/${redis_monitor_log_filename} ${ran_name} ${event}
235 Should Be Equal As Strings ${result} True
237 Redis Monitor Logs - Verify Publish To Connection Status Channel
238 [Arguments] ${ran_name} ${event}
239 Log To Console Verify Publish To Connection Status Channel
241 ${result}= log_scripts.verify_redis_monitor_connection_status_message ${EXECDIR}/${redis_monitor_log_filename} ${ran_name} ${event}
242 Should Be Equal As Strings ${result} True
244 Redis Monitor Logs - Verify NOT Published To Manipulation Channel
245 [Arguments] ${ran_name} ${event}
246 Log To Console Verify NOT Published To Manipulation Channel
248 ${result}= log_scripts.verify_redis_monitor_manipulation_message ${EXECDIR}/${redis_monitor_log_filename} ${ran_name} ${event}
249 Should Be Equal As Strings ${result} False