blob: 1f453dff09f9b30141293dc1de5cf9f081e3dfd2 [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 ***
ec472j09950082020-04-08 16:44:48 +030030Get Request node b gnb
Amichai4db397d2019-08-28 19:23:15 +030031 Sleep 1s
ec472j09950082020-04-08 16:44:48 +030032 GET ${getNodeb}
Amichai4db397d2019-08-28 19:23:15 +030033
ec472j09288ab2020-04-23 13:13:01 +030034Update Ran request
35 Sleep 1s
36 PUT ${update_gnb_url} ${update_gnb_body}
ec472j09950082020-04-08 16:44:48 +030037
ss412ga07b8592020-06-16 21:51:33 +030038Set General Configuration request
39 Sleep 1s
40 PUT ${set_general_configuration} ${set_general_configuration_body}
Amichai4db397d2019-08-28 19:23:15 +030041
ec472j09288ab2020-04-23 13:13:01 +030042Update Ran request not valid
43 Sleep 1s
44 PUT ${update_gnb_url} ${update_gnb_body_notvalid}
45
ss412gde190682019-10-24 09:29:26 +030046Remove log files
47 Remove File ${EXECDIR}/${gnb_log_filename}
48 Remove File ${EXECDIR}/${e2mgr_log_filename}
ss412gefcb4522019-12-02 16:59:19 +020049 Remove File ${EXECDIR}/${e2t_log_filename}
ss412gefcb4522019-12-02 16:59:19 +020050 Remove File ${EXECDIR}/${rm_sim_log_filename}
ss412gde190682019-10-24 09:29:26 +030051
52Save logs
53 Sleep 1s
54 Run ${Save_sim_log}
55 Run ${Save_e2mgr_log}
ss412gefcb4522019-12-02 16:59:19 +020056 Run ${Save_e2t_log}
ss412gefcb4522019-12-02 16:59:19 +020057 Run ${Save_rm_sim_log}
Amichai4db397d2019-08-28 19:23:15 +030058
ss412g42996b72019-09-10 14:30:26 +030059Stop Simulator
60 Run And Return Rc And Output ${stop_simu}
61
ss412ge7dbffd2019-09-03 18:34:28 +030062Prepare Enviorment
Amichaif846c592020-01-08 16:45:07 +020063 Log To Console Starting preparations
ss412gefcb4522019-12-02 16:59:19 +020064 ${starting_timestamp} Evaluate datetime.datetime.now(datetime.timezone.utc).isoformat("T") modules=datetime
65 ${e2t_log_filename} Evaluate "e2t.${SUITE NAME}.log".replace(" ","-")
66 ${e2mgr_log_filename} Evaluate "e2mgr.${SUITE NAME}.log".replace(" ","-")
67 ${gnb_log_filename} Evaluate "gnb.${SUITE NAME}.log".replace(" ","-")
ss412gefcb4522019-12-02 16:59:19 +020068 ${rm_sim_log_filename} Evaluate "rm_sim.${SUITE NAME}.log".replace(" ","-")
ec472j09950082020-04-08 16:44:48 +030069 ${Save_sim_log} Evaluate 'docker logs --since ${starting_timestamp} gnbe2_oran_simu > ${gnb_log_filename}'
ss412gefcb4522019-12-02 16:59:19 +020070 ${Save_e2mgr_log} Evaluate 'docker logs --since ${starting_timestamp} e2mgr > ${e2mgr_log_filename}'
71 ${Save_e2t_log} Evaluate 'docker logs --since ${starting_timestamp} e2 > ${e2t_log_filename}'
ss412gefcb4522019-12-02 16:59:19 +020072 ${Save_rm_sim_log} Evaluate 'docker logs --since ${starting_timestamp} rm_sim > ${rm_sim_log_filename}'
ec472j09950082020-04-08 16:44:48 +030073 Set Suite Variable ${e2t_log_filename}
ss412gefcb4522019-12-02 16:59:19 +020074 Set Suite Variable ${e2mgr_log_filename}
75 Set Suite Variable ${gnb_log_filename}
ss412gefcb4522019-12-02 16:59:19 +020076 Set Suite Variable ${rm_sim_log_filename}
ss412gefcb4522019-12-02 16:59:19 +020077 Set Suite Variable ${Save_sim_log}
78 Set Suite Variable ${Save_e2mgr_log}
79 Set Suite Variable ${Save_e2t_log}
ss412gefcb4522019-12-02 16:59:19 +020080 Set Suite Variable ${Save_rm_sim_log}
Amichaif846c592020-01-08 16:45:07 +020081
82 Log To Console Ready to flush db
ss412gde190682019-10-24 09:29:26 +030083 ${flush} cleanup_db.flush
ss412ge7dbffd2019-09-03 18:34:28 +030084 Should Be Equal As Strings ${flush} True
85 Run And Return Rc And Output ${stop_simu}
86 Run And Return Rc And Output ${docker_Remove}
87 Run And Return Rc And Output ${run_simu_regular}
ss412g9d922dc2019-12-24 01:42:40 +020088 Sleep 3s
Amichaif846c592020-01-08 16:45:07 +020089 Log To Console Validating dockers are up
ss412ge7dbffd2019-09-03 18:34:28 +030090 ${result}= Run And Return Rc And Output ${docker_command}
ss412gde190682019-10-24 09:29:26 +030091 Should Be Equal As Integers ${result[1]} ${docker_number}
ss412ge7dbffd2019-09-03 18:34:28 +030092
93Start E2
94 Run And Return Rc And Output ${start_e2}
95 ${result}= Run And Return Rc And Output ${docker_command}
ss412gde190682019-10-24 09:29:26 +030096 Should Be Equal As Integers ${result[1]} ${docker_number}
ss412ge7dbffd2019-09-03 18:34:28 +030097 Sleep 2s
98
ss412gefcb4522019-12-02 16:59:19 +020099Stop E2
100 Run And Return Rc And Output ${stop_e2}
101 ${result}= Run And Return Rc And Output ${docker_command}
102 Should Be Equal As Integers ${result[1]} ${docker_number-1}
103 Sleep 2s
104
ss412gde190682019-10-24 09:29:26 +0300105Start Dbass
106 Run And Return Rc And Output ${dbass_remove}
107 Run And Return Rc And Output ${dbass_start}
ss412ge7dbffd2019-09-03 18:34:28 +0300108 ${result}= Run And Return Rc And Output ${docker_command}
ss412gde190682019-10-24 09:29:26 +0300109 Should Be Equal As Integers ${result[1]} ${docker_number}
110
111Stop Dbass
112 Run And Return Rc And Output ${dbass_stop}
113 ${result}= Run And Return Rc And Output ${docker_command}
114 Should Be Equal As Integers ${result[1]} ${docker_number-1}
ss412ge7dbffd2019-09-03 18:34:28 +0300115
ss412gefcb4522019-12-02 16:59:19 +0200116Restart simulator
ec472j09950082020-04-08 16:44:48 +0300117 Run And Return Rc And Output ${restart_simu}
ss412gefcb4522019-12-02 16:59:19 +0200118 ${result}= Run And Return Rc And Output ${docker_command}
119 Should Be Equal As Integers ${result[1]} ${docker_number}
120
Amichai63b5d922019-12-26 15:22:55 +0200121Start RoutingManager Simulator
122 Run And Return Rc And Output ${start_routingmanager_sim}
ss412ge7dbffd2019-09-03 18:34:28 +0300123
Amichai63b5d922019-12-26 15:22:55 +0200124Stop RoutingManager Simulator
125 Run And Return Rc And Output ${stop_routingmanager_sim}
ss412ge7dbffd2019-09-03 18:34:28 +0300126
ec472j09288ab2020-04-23 13:13:01 +0300127Restart simulator with less docker
128 Run And Return Rc And Output ${restart_simu}
129 ${result}= Run And Return Rc And Output ${docker_command}
130 Should Be Equal As Integers ${result[1]} ${docker_number-1}
Amichai4db397d2019-08-28 19:23:15 +0300131
ss412ga07b8592020-06-16 21:51:33 +0300132Flush And Populate DB
133 ${flush} cleanup_db.flush
134 Sleep 2s
135