change release version to 2.0.10
[ric-plt/e2mgr.git] / Automation / Tests / Resource / Keywords.robot
1 ##############################################################################
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 ##############################################################################
18 #
19 #   This source code is part of the near-RT RIC (RAN Intelligent Controller)
20 #   platform project (RICP).
21 #
22
23 *** Settings ***
24 Documentation   Keywords file
25 Library     ../Scripts/cleanup_db.py
26 Resource   ../Resource/resource.robot
27 Library     OperatingSystem
28
29
30
31
32
33 *** Keywords ***
34 Post Request setup node b x-2
35     Set Headers     ${header}
36     POST        /v1/nodeb/x2-setup    ${json}
37
38
39
40 Get Request node b enb test1
41     Sleep    1s
42     GET      /v1/nodeb/test1
43
44
45 Get Request node b enb test2
46     Sleep    1s
47     GET      /v1/nodeb/test2
48
49
50 Remove log files
51     Remove File  ${EXECDIR}/${gnb_log_filename}
52     Remove File  ${EXECDIR}/${e2mgr_log_filename}
53     Remove File  ${EXECDIR}/${rsm_log_filename}
54     Remove File  ${EXECDIR}/${e2adapter_log_filename}
55
56 Save logs
57     Sleep   1s
58     Run     ${Save_sim_log}
59     Run     ${Save_e2mgr_log}
60     Run     ${Save_rsm_log}
61     Run     ${Save_e2adapter_log}
62
63
64 Post Request setup node b endc-setup
65     Set Headers     ${header}
66     POST        /v1/nodeb/endc-setup    ${endcjson}
67
68 Stop Simulator
69     Run And Return Rc And Output    ${stop_simu}
70
71
72 Prepare Simulator For Load Information
73      Run And Return Rc And Output    ${stop_simu}
74      Run And Return Rc And Output    ${docker_Remove}
75      ${flush}  cleanup_db.flush
76      Should Be Equal As Strings  ${flush}  True
77      Run And Return Rc And Output    ${run_simu_load}
78      ${result}=  Run And Return Rc And Output     ${docker_command}
79      Should Be Equal As Integers    ${result[1]}    ${docker_number}
80
81 Prepare Enviorment
82      ${flush}  cleanup_db.flush
83      Should Be Equal As Strings  ${flush}  True
84      Run And Return Rc And Output    ${stop_simu}
85      Run And Return Rc And Output    ${docker_Remove}
86      Run And Return Rc And Output    ${run_simu_regular}
87      Run And Return Rc And Output    ${restart_e2adapter}
88      Sleep  2s
89      ${result}=  Run And Return Rc And Output     ${docker_command}
90      Should Be Equal As Integers    ${result[1]}    ${docker_number}
91
92 Start E2
93      Run And Return Rc And Output    ${start_e2}
94      ${result}=  Run And Return Rc And Output     ${docker_command}
95      Should Be Equal As Integers    ${result[1]}    ${docker_number}
96      Sleep  2s
97
98 Start Dbass
99      Run And Return Rc And Output    ${dbass_remove}
100      Run And Return Rc And Output    ${dbass_start}
101      ${result}=  Run And Return Rc And Output     ${docker_command}
102      Should Be Equal As Integers    ${result[1]}    ${docker_number}
103
104 Stop Dbass
105      Run And Return Rc And Output    ${dbass_stop}
106      ${result}=  Run And Return Rc And Output     ${docker_command}
107      Should Be Equal As Integers    ${result[1]}    ${docker_number-1}
108
109
110
111
112