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 Resource ../Resource/resource.robot
27 Library OperatingSystem
30 Get Request node b gnb
36 PUT ${update_gnb_url} ${update_gnb_body}
40 POST ${add_enb_url} ${add_enb_request_body}
42 Set General Configuration request
44 PUT ${set_general_configuration} ${set_general_configuration_body}
46 Update Ran request not valid
48 PUT ${update_gnb_url} ${update_gnb_body_notvalid}
51 Remove File ${EXECDIR}/${gnb_log_filename}
52 Remove File ${EXECDIR}/${e2mgr_log_filename}
53 Remove File ${EXECDIR}/${e2t_log_filename}
62 [Arguments] ${need_to_restart_pods}=${False} ${set_new_timestamp}=${True}
64 Flush And Populate DB ${set_new_timestamp}
65 Run keyword if ${need_to_restart_pods}==${True} Restart RM and GNB Simulator
66 Wait until keyword succeeds 1 min 10 sec Validate Required Dockers
68 Restart RM and GNB Simulator
69 Restart routing manager
70 Wait until keyword succeeds 1 min 10 sec Validate Required Dockers
75 ${starting_timestamp} Evaluate datetime.datetime.now(datetime.timezone.utc).isoformat("T") modules=datetime
76 ${e2t_log_filename} Evaluate "e2t.${SUITE NAME}.log".replace(" ","-")
77 ${e2mgr_log_filename} Evaluate "e2mgr.${SUITE NAME}.log".replace(" ","-")
78 ${gnb_log_filename} Evaluate "gnb.${SUITE NAME}.log".replace(" ","-")
79 ${Save_sim_log} Evaluate "kubectl -n ricplt logs --since-time=${starting_timestamp} $(${gnbe2_sim_pod}) > ${gnb_log_filename}"
80 ${Save_e2mgr_log} Evaluate "kubectl -n ricplt logs --since-time=${starting_timestamp} $(${e2mgr_pod}) > ${e2mgr_log_filename}"
81 ${Save_e2t_log} Evaluate "kubectl -n ricplt logs --since-time=${starting_timestamp} $(${e2term_pod}) > ${e2t_log_filename}"
83 Set Suite Variable ${e2t_log_filename}
84 Set Suite Variable ${e2mgr_log_filename}
85 Set Suite Variable ${gnb_log_filename}
86 Set Suite Variable ${Save_sim_log}
87 Set Suite Variable ${Save_e2mgr_log}
88 Set Suite Variable ${Save_e2t_log}
90 Validate Required Dockers
91 [Arguments] ${required_number_of_dockers}=${pods_number}
92 Log To Console Validating all required dockers are up
93 ${result}= Run And Return Rc And Output ${verify_all_pods_are_ready_command}
94 Should Be Equal As Integers ${result[1]} ${required_number_of_dockers}
97 Log to Console Starting E2Term
98 Run And Return Rc And Output ${start_e2}
102 Log to Console Stopping E2Term
103 Run And Return Rc And Output ${stop_e2}
107 Log to Console Starting E2Mgr
108 Run And Return Rc And Output ${start_e2mgr}
112 Log to Console Stopping E2Mgr
113 Run And Return Rc And Output ${stop_e2mgr}
117 Log to Console Starting redis
118 Run And Return Rc And Output ${dbass_start}
122 Log to Console Stopping redis
123 Run And Return Rc And Output ${dbass_stop}
127 log to console Stopping gnbe2 simulator
128 Run And Return Rc And Output ${stop_simu}
132 log to console Starting gnbe2 simulator
133 Run And Return Rc And Output ${start_simu}
136 Log to Console Restarting gnbe2 simulator
140 Start Routing Manager
141 Log to Console Starting routing manager
142 Run And Return Rc And Output ${start_routing_manager}
146 Log to Console Stopping routing manager
147 Run And Return Rc And Output ${stop_routing_manager}
150 Restart Routing Manager
151 Log to Console Restarting routing manager
153 Start Routing Manager
155 Flush And Populate DB
156 [Arguments] ${set_new_timestamp}=${True}
157 Log To Console Flushing and populating DB
158 ${flush}= cleanup_db.flush ${set_new_timestamp}
160 Should Be Equal As Strings ${flush} True
162 Stop All Pods Except Simulator