blob: 2593c5f2681a7d6dcf7a09bd0e85586ca0521bd6 [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
29
ss412g42996b72019-09-10 14:30:26 +030030
31
32
Amichai4db397d2019-08-28 19:23:15 +030033*** Keywords ***
34Post Request setup node b x-2
35 Set Headers ${header}
36 POST /v1/nodeb/x2-setup ${json}
37
38
ss412gefcb4522019-12-02 16:59:19 +020039Put Request Resource Status Start
40 Set Headers ${header}
41 PUT /v1/general/resourcestatus ${resource_status_start_json}
42
43
44Put Request Resource Status Stop
45 Set Headers ${header}
46 PUT /v1/general/resourcestatus ${resource_status_stop_json}
ss412g42996b72019-09-10 14:30:26 +030047
Amichai4db397d2019-08-28 19:23:15 +030048Get Request node b enb test1
49 Sleep 1s
50 GET /v1/nodeb/test1
51
52
53Get Request node b enb test2
54 Sleep 1s
55 GET /v1/nodeb/test2
56
ss412g42996b72019-09-10 14:30:26 +030057
ss412gde190682019-10-24 09:29:26 +030058Remove log files
59 Remove File ${EXECDIR}/${gnb_log_filename}
60 Remove File ${EXECDIR}/${e2mgr_log_filename}
ss412gefcb4522019-12-02 16:59:19 +020061 Remove File ${EXECDIR}/${e2t_log_filename}
ss412gde190682019-10-24 09:29:26 +030062 Remove File ${EXECDIR}/${rsm_log_filename}
ss412gefcb4522019-12-02 16:59:19 +020063 Remove File ${EXECDIR}/${e2e_simu_log_filename}
64 Remove File ${EXECDIR}/${rm_sim_log_filename}
ss412gde190682019-10-24 09:29:26 +030065 Remove File ${EXECDIR}/${e2adapter_log_filename}
66
67Save logs
68 Sleep 1s
69 Run ${Save_sim_log}
70 Run ${Save_e2mgr_log}
ss412gefcb4522019-12-02 16:59:19 +020071 Run ${Save_e2t_log}
ss412gde190682019-10-24 09:29:26 +030072 Run ${Save_rsm_log}
ss412gefcb4522019-12-02 16:59:19 +020073 Run ${Save_e2e_simu_log}
74 Run ${Save_rm_sim_log}
ss412gde190682019-10-24 09:29:26 +030075 Run ${Save_e2adapter_log}
76
ss412g42996b72019-09-10 14:30:26 +030077
Amichai4db397d2019-08-28 19:23:15 +030078Post Request setup node b endc-setup
79 Set Headers ${header}
80 POST /v1/nodeb/endc-setup ${endcjson}
81
ss412g42996b72019-09-10 14:30:26 +030082Stop Simulator
83 Run And Return Rc And Output ${stop_simu}
84
Amichai4db397d2019-08-28 19:23:15 +030085
ss412gefcb4522019-12-02 16:59:19 +020086
Amichai4db397d2019-08-28 19:23:15 +030087Prepare Simulator For Load Information
88 Run And Return Rc And Output ${stop_simu}
89 Run And Return Rc And Output ${docker_Remove}
ss412gde190682019-10-24 09:29:26 +030090 ${flush} cleanup_db.flush
ss412ge7dbffd2019-09-03 18:34:28 +030091 Should Be Equal As Strings ${flush} True
92 Run And Return Rc And Output ${run_simu_load}
Amichai4db397d2019-08-28 19:23:15 +030093 ${result}= Run And Return Rc And Output ${docker_command}
ss412gde190682019-10-24 09:29:26 +030094 Should Be Equal As Integers ${result[1]} ${docker_number}
Amichai4db397d2019-08-28 19:23:15 +030095
ss412ge7dbffd2019-09-03 18:34:28 +030096Prepare Enviorment
ss412gefcb4522019-12-02 16:59:19 +020097 ${starting_timestamp} Evaluate datetime.datetime.now(datetime.timezone.utc).isoformat("T") modules=datetime
98 ${e2t_log_filename} Evaluate "e2t.${SUITE NAME}.log".replace(" ","-")
99 ${e2mgr_log_filename} Evaluate "e2mgr.${SUITE NAME}.log".replace(" ","-")
100 ${gnb_log_filename} Evaluate "gnb.${SUITE NAME}.log".replace(" ","-")
101 ${rsm_log_filename} Evaluate "rsm.${SUITE NAME}.log".replace(" ","-")
102 ${e2e_simu_log_filename} Evaluate "e2e_simu.${SUITE NAME}.log".replace(" ","-")
103 ${rm_sim_log_filename} Evaluate "rm_sim.${SUITE NAME}.log".replace(" ","-")
104 ${e2adapter_log_filename} Evaluate "e2adapter.${SUITE NAME}.log".replace(" ","-")
105 ${Save_sim_log} Evaluate 'docker logs --since ${starting_timestamp} gnbe2_simu > ${gnb_log_filename}'
106 ${Save_e2mgr_log} Evaluate 'docker logs --since ${starting_timestamp} e2mgr > ${e2mgr_log_filename}'
107 ${Save_e2t_log} Evaluate 'docker logs --since ${starting_timestamp} e2 > ${e2t_log_filename}'
108 ${Save_rsm_log} Evaluate 'docker logs --since ${starting_timestamp} rsm > ${rsm_log_filename}'
109 ${Save_e2e_simu_log} Evaluate 'docker logs --since ${starting_timestamp} e2e_simu > ${e2e_simu_log_filename}'
110 ${Save_rm_sim_log} Evaluate 'docker logs --since ${starting_timestamp} rm_sim > ${rm_sim_log_filename}'
111 ${Save_e2adapter_log} Evaluate 'docker logs --since ${starting_timestamp} e2adapter > ${e2adapter_log_filename}'
112 Set Suite Variable ${e2t_log_filename}
113 Set Suite Variable ${e2mgr_log_filename}
114 Set Suite Variable ${gnb_log_filename}
115 Set Suite Variable ${rsm_log_filename}
116 Set Suite Variable ${e2e_simu_log_filename}
117 Set Suite Variable ${rm_sim_log_filename}
118 Set Suite Variable ${e2adapter_log_filename}
119 Set Suite Variable ${Save_sim_log}
120 Set Suite Variable ${Save_e2mgr_log}
121 Set Suite Variable ${Save_e2t_log}
122 Set Suite Variable ${Save_rsm_log}
123 Set Suite Variable ${Save_e2e_simu_log}
124 Set Suite Variable ${Save_rm_sim_log}
125 Set Suite Variable ${Save_e2adapter_log}
126
ss412gde190682019-10-24 09:29:26 +0300127 ${flush} cleanup_db.flush
ss412ge7dbffd2019-09-03 18:34:28 +0300128 Should Be Equal As Strings ${flush} True
129 Run And Return Rc And Output ${stop_simu}
ss412gefcb4522019-12-02 16:59:19 +0200130 Run And Return Rc And Output ${stop_e2e_simu}
ss412ge7dbffd2019-09-03 18:34:28 +0300131 Run And Return Rc And Output ${docker_Remove}
ss412gefcb4522019-12-02 16:59:19 +0200132 Run And Return Rc And Output ${docker_remove_e2e_simu}
ss412ge7dbffd2019-09-03 18:34:28 +0300133 Run And Return Rc And Output ${run_simu_regular}
ss412gefcb4522019-12-02 16:59:19 +0200134 Run And Return Rc And Output ${run_e2e_simu_regular}
ss412ge7dbffd2019-09-03 18:34:28 +0300135 Run And Return Rc And Output ${restart_e2adapter}
ss412gb50194c2019-09-11 14:14:56 +0300136 Sleep 2s
ss412ge7dbffd2019-09-03 18:34:28 +0300137 ${result}= Run And Return Rc And Output ${docker_command}
ss412gde190682019-10-24 09:29:26 +0300138 Should Be Equal As Integers ${result[1]} ${docker_number}
ss412ge7dbffd2019-09-03 18:34:28 +0300139
140Start E2
141 Run And Return Rc And Output ${start_e2}
142 ${result}= Run And Return Rc And Output ${docker_command}
ss412gde190682019-10-24 09:29:26 +0300143 Should Be Equal As Integers ${result[1]} ${docker_number}
ss412ge7dbffd2019-09-03 18:34:28 +0300144 Sleep 2s
145
ss412gefcb4522019-12-02 16:59:19 +0200146Stop E2
147 Run And Return Rc And Output ${stop_e2}
148 ${result}= Run And Return Rc And Output ${docker_command}
149 Should Be Equal As Integers ${result[1]} ${docker_number-1}
150 Sleep 2s
151
ss412gde190682019-10-24 09:29:26 +0300152Start Dbass
153 Run And Return Rc And Output ${dbass_remove}
154 Run And Return Rc And Output ${dbass_start}
ss412ge7dbffd2019-09-03 18:34:28 +0300155 ${result}= Run And Return Rc And Output ${docker_command}
ss412gde190682019-10-24 09:29:26 +0300156 Should Be Equal As Integers ${result[1]} ${docker_number}
157
158Stop Dbass
159 Run And Return Rc And Output ${dbass_stop}
160 ${result}= Run And Return Rc And Output ${docker_command}
161 Should Be Equal As Integers ${result[1]} ${docker_number-1}
ss412ge7dbffd2019-09-03 18:34:28 +0300162
ss412gefcb4522019-12-02 16:59:19 +0200163Restart simulator
164
165 Run And Return Rc And Output ${restart_docker_sim}
166 ${result}= Run And Return Rc And Output ${docker_command}
167 Should Be Equal As Integers ${result[1]} ${docker_number}
168
ss412ge7dbffd2019-09-03 18:34:28 +0300169
170
171
Amichai4db397d2019-08-28 19:23:15 +0300172