1 ##############################################################################
3 # Copyright (c) 2019 AT&T Intellectual Property.
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 # http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
17 ##############################################################################
19 # This source code is part of the near-RT RIC (RAN Intelligent Controller)
20 # platform project (RICP).
24 Documentation Keywords file
25 Library ../Scripts/cleanup_db.py
26 Library ../Scripts/k8s_helper.py
27 Resource ../Resource/resource.robot
28 Library OperatingSystem
30 Variables ../Scripts/variables.py
34 [Arguments] ${nodeb_name}=${ranName}
36 GET ${getNodeb}/${nodeb_name}
40 PUT ${update_gnb_url} ${update_gnb_body}
43 [Arguments] ${request}=${add_enb_request_body}
45 POST ${enb_url} ${request}
49 DELETE ${enb_url}/${enb_ran_name}
52 [Arguments] ${request}=${update_enb_request_body}
54 PUT ${enb_url}/${enb_ran_name} ${request}
56 Set General Configuration request
58 PUT ${set_general_configuration} ${set_general_configuration_body}
60 Update Gnb request not valid
62 PUT ${update_gnb_url} ${update_gnb_body_notvalid}
65 Remove File ${EXECDIR}/${gnb_log_filename}
66 Remove File ${EXECDIR}/${e2mgr_log_filename}
67 Remove File ${EXECDIR}/${e2t_log_filename}
76 [Arguments] ${need_to_restart_pods}=${False} ${set_new_timestamp}=${True}
78 Flush And Populate DB ${set_new_timestamp}
79 Run keyword if ${need_to_restart_pods}==${True} Restart RM and GNB Simulator
80 Wait until keyword succeeds 2 min 10 sec Validate Required Dockers
82 Restart RM and GNB Simulator
83 Restart routing manager
84 Wait until keyword succeeds 2 min 10 sec Validate Required Dockers
89 ${starting_timestamp} Evaluate datetime.datetime.now(datetime.timezone.utc).isoformat("T") modules=datetime
90 ${e2t_log_filename} Evaluate "e2t.${SUITE NAME}.log".replace(" ","-")
91 ${e2mgr_log_filename} Evaluate "e2mgr.${SUITE NAME}.log".replace(" ","-")
92 ${gnb_log_filename} Evaluate "gnb.${SUITE NAME}.log".replace(" ","-")
93 ${Save_sim_log} Evaluate "kubectl -n ricplt logs --since-time=${starting_timestamp} $(${gnbe2_sim_pod}) > ${gnb_log_filename}"
94 ${Save_e2mgr_log} Evaluate "kubectl -n ricplt logs --since-time=${starting_timestamp} $(${e2mgr_pod}) > ${e2mgr_log_filename}"
95 ${Save_e2t_log} Evaluate "kubectl -n ricplt logs --since-time=${starting_timestamp} $(${e2term_pod}) > ${e2t_log_filename}"
96 Set Suite Variable ${e2t_log_filename}
97 Set Suite Variable ${e2mgr_log_filename}
98 Set Suite Variable ${gnb_log_filename}
99 Set Suite Variable ${Save_sim_log}
100 Set Suite Variable ${Save_e2mgr_log}
101 Set Suite Variable ${Save_e2t_log}
103 Validate Required Dockers
104 [Arguments] ${required_number_of_dockers}=${pods_number}
105 Log To Console Validating all required dockers are up
106 ${result}= Run And Return Rc And Output ${verify_all_pods_are_ready_command}
107 Should Be Equal As Integers ${result[1]} ${required_number_of_dockers}
110 Log to Console Starting E2Term
111 Run And Return Rc And Output ${start_e2}
115 Log to Console Stopping E2Term
116 Run And Return Rc And Output ${stop_e2}
120 Log to Console Starting E2Mgr
121 Run And Return Rc And Output ${start_e2mgr}
125 Log to Console Stopping E2Mgr
126 Run And Return Rc And Output ${stop_e2mgr}
130 Log to Console Starting redis
131 Run And Return Rc And Output ${dbass_start}
135 Log to Console Stopping redis
136 Run And Return Rc And Output ${dbass_stop}
140 log to console Stopping gnbe2 simulator
141 Run And Return Rc And Output ${stop_simu}
145 log to console Starting gnbe2 simulator
146 Run And Return Rc And Output ${start_simu}
149 Log to Console Restarting gnbe2 simulator
153 Start Routing Manager
154 Log to Console Starting routing manager
155 Run And Return Rc And Output ${start_routing_manager}
159 Log to Console Stopping routing manager
160 Run And Return Rc And Output ${stop_routing_manager}
163 Restart Routing Manager
164 Log to Console Restarting routing manager
166 Start Routing Manager
169 Log to Console Starting e2adapter
170 Run And Return Rc And Output ${start_e2adapter}
174 Log to Console Stopping e2adapter
175 Run And Return Rc And Output ${stop_e2adapter}
179 Log to Console Restarting e2adapter
183 Flush And Populate DB
184 [Arguments] ${set_new_timestamp}=${True}
185 Log To Console Flushing and populating DB
186 ${flush}= cleanup_db.flush ${set_new_timestamp}
188 Should Be Equal As Strings ${flush} True
190 Stop All Pods Except Simulator
197 Send eNB Setup Request
198 Log To Console Sending eNB setup request form e2adapter
200 Wait until keyword succeeds 2 min 3 sec Validate Required Dockers
201 ${e2adapter_pod} = Run And Return Rc And Output kubectl get pods -n ricplt | /bin/grep e2adapter | /bin/grep Running | awk '{{print $1}}'
202 ${send_enb_setup} Evaluate "kubectl -n ricplt exec -it ${e2adapter_pod[1]} cli send-e2setup-req 10.0.2.15"
203 Run And Return Rc And Output ${send_enb_setup}
206 Log To Console Starting redis monitor log
207 ${redis_monitor_log_filename} Evaluate "redis_monitor.${SUITE NAME}.log".replace(" ","-")
208 Set Suite Variable ${redis_monitor_log_filename}
209 Remove File ${EXECDIR}/${redis_monitor_log_filename}
210 Start Process kubectl -n ricplt exec -it statefulset-ricplt-dbaas-server-0 redis-cli MONITOR>${EXECDIR}/${redis_monitor_log_filename} shell=yes
213 Log To Console Stopping redis monitor log
214 log_scripts.kill_redis_monitor_root_process
217 Redis Monitor Logs - Verify Publish To Manipulation Channel
218 [Arguments] ${ran_name} ${event}
219 Log To Console Verify Publish To Manipulation Channel
221 ${result}= log_scripts.verify_redis_monitor_manipulation_message ${EXECDIR}/${redis_monitor_log_filename} ${ran_name} ${event}
222 Should Be Equal As Strings ${result} True
224 Redis Monitor Logs - Verify Publish To Connection Status Channel
225 [Arguments] ${ran_name} ${event}
226 Log To Console Verify Publish To Connection Status Channel
228 ${result}= log_scripts.verify_redis_monitor_connection_status_message ${EXECDIR}/${redis_monitor_log_filename} ${ran_name} ${event}
229 Should Be Equal As Strings ${result} True
231 Redis Monitor Logs - Verify NOT Published To Manipulation Channel
232 [Arguments] ${ran_name} ${event}
233 Log To Console Verify NOT Published To Manipulation Channel
235 ${result}= log_scripts.verify_redis_monitor_manipulation_message ${EXECDIR}/${redis_monitor_log_filename} ${ran_name} ${event}
236 Should Be Equal As Strings ${result} False