blob: eea1ce6ed4acab617a37f8f7a8c9fd14997cc8b8 [file] [log] [blame]
Amichai4db397d2019-08-28 19:23:15 +03001##############################################################################
2#
3# Copyright (c) 2019 AT&T Intellectual Property.
4#
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
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
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.
16#
17##############################################################################
nm755n15d39822019-11-28 16:56:00 +000018#
19# This source code is part of the near-RT RIC (RAN Intelligent Controller)
20# platform project (RICP).
21#
Amichai4db397d2019-08-28 19:23:15 +030022
23*** Settings ***
24Documentation Keywords file
ss412gde190682019-10-24 09:29:26 +030025Library ../Scripts/cleanup_db.py
Amichai4db397d2019-08-28 19:23:15 +030026Resource ../Resource/resource.robot
27Library OperatingSystem
28
Amichai4db397d2019-08-28 19:23:15 +030029*** Keywords ***
30Post Request setup node b x-2
31 Set Headers ${header}
32 POST /v1/nodeb/x2-setup ${json}
33
ss412gefcb4522019-12-02 16:59:19 +020034Put Request Resource Status Start
35 Set Headers ${header}
36 PUT /v1/general/resourcestatus ${resource_status_start_json}
37
ss412gefcb4522019-12-02 16:59:19 +020038Put Request Resource Status Stop
39 Set Headers ${header}
40 PUT /v1/general/resourcestatus ${resource_status_stop_json}
ss412g42996b72019-09-10 14:30:26 +030041
Amichai4db397d2019-08-28 19:23:15 +030042Get Request node b enb test1
43 Sleep 1s
44 GET /v1/nodeb/test1
45
is005q32d7f422020-01-02 16:23:06 +020046Get Request node b gnb test2
Amichai4db397d2019-08-28 19:23:15 +030047 Sleep 1s
48 GET /v1/nodeb/test2
49
ss412gde190682019-10-24 09:29:26 +030050Remove log files
51 Remove File ${EXECDIR}/${gnb_log_filename}
52 Remove File ${EXECDIR}/${e2mgr_log_filename}
ss412gefcb4522019-12-02 16:59:19 +020053 Remove File ${EXECDIR}/${e2t_log_filename}
ss412gde190682019-10-24 09:29:26 +030054 Remove File ${EXECDIR}/${rsm_log_filename}
ss412gefcb4522019-12-02 16:59:19 +020055 Remove File ${EXECDIR}/${e2e_simu_log_filename}
56 Remove File ${EXECDIR}/${rm_sim_log_filename}
ss412gde190682019-10-24 09:29:26 +030057 Remove File ${EXECDIR}/${e2adapter_log_filename}
58
59Save logs
60 Sleep 1s
61 Run ${Save_sim_log}
62 Run ${Save_e2mgr_log}
ss412gefcb4522019-12-02 16:59:19 +020063 Run ${Save_e2t_log}
ss412gde190682019-10-24 09:29:26 +030064 Run ${Save_rsm_log}
ss412gefcb4522019-12-02 16:59:19 +020065 Run ${Save_e2e_simu_log}
66 Run ${Save_rm_sim_log}
ss412gde190682019-10-24 09:29:26 +030067 Run ${Save_e2adapter_log}
68
ss412g42996b72019-09-10 14:30:26 +030069
Amichai4db397d2019-08-28 19:23:15 +030070Post Request setup node b endc-setup
71 Set Headers ${header}
72 POST /v1/nodeb/endc-setup ${endcjson}
73
ss412g42996b72019-09-10 14:30:26 +030074Stop Simulator
75 Run And Return Rc And Output ${stop_simu}
76
Amichai4db397d2019-08-28 19:23:15 +030077
78Prepare Simulator For Load Information
79 Run And Return Rc And Output ${stop_simu}
80 Run And Return Rc And Output ${docker_Remove}
ss412gde190682019-10-24 09:29:26 +030081 ${flush} cleanup_db.flush
ss412ge7dbffd2019-09-03 18:34:28 +030082 Should Be Equal As Strings ${flush} True
83 Run And Return Rc And Output ${run_simu_load}
Amichai4db397d2019-08-28 19:23:15 +030084 ${result}= Run And Return Rc And Output ${docker_command}
ss412gde190682019-10-24 09:29:26 +030085 Should Be Equal As Integers ${result[1]} ${docker_number}
Amichai4db397d2019-08-28 19:23:15 +030086
ss412ge7dbffd2019-09-03 18:34:28 +030087Prepare Enviorment
Amichaif846c592020-01-08 16:45:07 +020088 Log To Console Starting preparations
ss412gefcb4522019-12-02 16:59:19 +020089 ${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 ${rsm_log_filename} Evaluate "rsm.${SUITE NAME}.log".replace(" ","-")
94 ${e2e_simu_log_filename} Evaluate "e2e_simu.${SUITE NAME}.log".replace(" ","-")
95 ${rm_sim_log_filename} Evaluate "rm_sim.${SUITE NAME}.log".replace(" ","-")
96 ${e2adapter_log_filename} Evaluate "e2adapter.${SUITE NAME}.log".replace(" ","-")
97 ${Save_sim_log} Evaluate 'docker logs --since ${starting_timestamp} gnbe2_simu > ${gnb_log_filename}'
98 ${Save_e2mgr_log} Evaluate 'docker logs --since ${starting_timestamp} e2mgr > ${e2mgr_log_filename}'
99 ${Save_e2t_log} Evaluate 'docker logs --since ${starting_timestamp} e2 > ${e2t_log_filename}'
100 ${Save_rsm_log} Evaluate 'docker logs --since ${starting_timestamp} rsm > ${rsm_log_filename}'
101 ${Save_e2e_simu_log} Evaluate 'docker logs --since ${starting_timestamp} e2e_simu > ${e2e_simu_log_filename}'
102 ${Save_rm_sim_log} Evaluate 'docker logs --since ${starting_timestamp} rm_sim > ${rm_sim_log_filename}'
103 ${Save_e2adapter_log} Evaluate 'docker logs --since ${starting_timestamp} e2adapter > ${e2adapter_log_filename}'
104 Set Suite Variable ${e2t_log_filename}
105 Set Suite Variable ${e2mgr_log_filename}
106 Set Suite Variable ${gnb_log_filename}
107 Set Suite Variable ${rsm_log_filename}
108 Set Suite Variable ${e2e_simu_log_filename}
109 Set Suite Variable ${rm_sim_log_filename}
110 Set Suite Variable ${e2adapter_log_filename}
111 Set Suite Variable ${Save_sim_log}
112 Set Suite Variable ${Save_e2mgr_log}
113 Set Suite Variable ${Save_e2t_log}
114 Set Suite Variable ${Save_rsm_log}
115 Set Suite Variable ${Save_e2e_simu_log}
116 Set Suite Variable ${Save_rm_sim_log}
117 Set Suite Variable ${Save_e2adapter_log}
Amichaif846c592020-01-08 16:45:07 +0200118
119 Log To Console Ready to flush db
ss412gde190682019-10-24 09:29:26 +0300120 ${flush} cleanup_db.flush
ss412ge7dbffd2019-09-03 18:34:28 +0300121 Should Be Equal As Strings ${flush} True
122 Run And Return Rc And Output ${stop_simu}
ss412gefcb4522019-12-02 16:59:19 +0200123 Run And Return Rc And Output ${stop_e2e_simu}
ss412ge7dbffd2019-09-03 18:34:28 +0300124 Run And Return Rc And Output ${docker_Remove}
ss412gefcb4522019-12-02 16:59:19 +0200125 Run And Return Rc And Output ${docker_remove_e2e_simu}
ss412ge7dbffd2019-09-03 18:34:28 +0300126 Run And Return Rc And Output ${run_simu_regular}
ss412gefcb4522019-12-02 16:59:19 +0200127 Run And Return Rc And Output ${run_e2e_simu_regular}
ss412ge7dbffd2019-09-03 18:34:28 +0300128 Run And Return Rc And Output ${restart_e2adapter}
ss412g9d922dc2019-12-24 01:42:40 +0200129 Sleep 3s
Amichaif846c592020-01-08 16:45:07 +0200130 Log To Console Validating dockers are up
ss412ge7dbffd2019-09-03 18:34:28 +0300131 ${result}= Run And Return Rc And Output ${docker_command}
ss412gde190682019-10-24 09:29:26 +0300132 Should Be Equal As Integers ${result[1]} ${docker_number}
ss412ge7dbffd2019-09-03 18:34:28 +0300133
134Start E2
135 Run And Return Rc And Output ${start_e2}
136 ${result}= Run And Return Rc And Output ${docker_command}
ss412gde190682019-10-24 09:29:26 +0300137 Should Be Equal As Integers ${result[1]} ${docker_number}
ss412ge7dbffd2019-09-03 18:34:28 +0300138 Sleep 2s
139
ss412gefcb4522019-12-02 16:59:19 +0200140Stop E2
141 Run And Return Rc And Output ${stop_e2}
142 ${result}= Run And Return Rc And Output ${docker_command}
143 Should Be Equal As Integers ${result[1]} ${docker_number-1}
144 Sleep 2s
145
ss412gde190682019-10-24 09:29:26 +0300146Start Dbass
147 Run And Return Rc And Output ${dbass_remove}
148 Run And Return Rc And Output ${dbass_start}
ss412ge7dbffd2019-09-03 18:34:28 +0300149 ${result}= Run And Return Rc And Output ${docker_command}
ss412gde190682019-10-24 09:29:26 +0300150 Should Be Equal As Integers ${result[1]} ${docker_number}
151
152Stop Dbass
153 Run And Return Rc And Output ${dbass_stop}
154 ${result}= Run And Return Rc And Output ${docker_command}
155 Should Be Equal As Integers ${result[1]} ${docker_number-1}
ss412ge7dbffd2019-09-03 18:34:28 +0300156
ss412gefcb4522019-12-02 16:59:19 +0200157Restart simulator
158
159 Run And Return Rc And Output ${restart_docker_sim}
160 ${result}= Run And Return Rc And Output ${docker_command}
161 Should Be Equal As Integers ${result[1]} ${docker_number}
162
Amichai63b5d922019-12-26 15:22:55 +0200163Start RoutingManager Simulator
164 Run And Return Rc And Output ${start_routingmanager_sim}
ss412ge7dbffd2019-09-03 18:34:28 +0300165
Amichai63b5d922019-12-26 15:22:55 +0200166Stop RoutingManager Simulator
167 Run And Return Rc And Output ${stop_routingmanager_sim}
ss412ge7dbffd2019-09-03 18:34:28 +0300168
169
Amichai4db397d2019-08-28 19:23:15 +0300170