blob: f572f27995c5a76859d5d5fa8d52c2440775e95c [file] [log] [blame]
umry83641d313be2019-08-19 18:33:25 +02001.. This work is licensed under a Creative Commons Attribution 4.0
2 International License. http://creativecommons.org/licenses/by/4.0
3
4.. _docs_robot:
5
mrichomme3345d142020-11-30 18:31:29 +01006:orphan:
7
umry83641d313be2019-08-19 18:33:25 +02008Robot
9-----
10
11Introduction
12~~~~~~~~~~~~
13Robot Framework is a generic open source automation framework for acceptance
14testing, acceptance test driven development (ATDD), and robotic process
15automation (RPA). This framework is widely used in ONAP.
16The full documentation of robot can be found in https://robotframework.org/.
17
18In ONAP, Robot scripts have been developed to validate the components, provision
19and run end to end tests.
20
21The robot scripts can be retrieved in the ONAP testsuite repository: https://git.onap.org/testsuite/
22
23A Robot pod is part of the ONAP default installation.
24This pod includes the robot framework and the needed scripts cloned from the
25testsuite repository.
26Additional scripts are created during the installation in order to simplify
27the launch of the different tests and are loacted in /opt/oom/kubernetes/robots.
28
29From one of the kubernetes controller, you shall see the pod as follows:
30
31::
32
33 $ kubectl get pods -n onap | grep robot
34 onap-robot-robot-7fc49977fd-6jblt 1/1 Running 0 9h
35
36You can access the robot configuration through its configmap.
37
38::
39
40 $ kubectl describe cm onap-robot-robot-eteshare-configmap -n onap
41
42You shall see a long list of variables set during the ONAP installation by OOM.
43Please note that some of these variables are set thanks to the OOM
44overide openstack.yaml file. See the examples described in https://git.onap.org/oom/tree/kubernetes/onap/resources/overrides/openstack.yaml
45
46Verification of the ONAP components
47~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
48ONAP robot healthcheck tests have been created to give a quick feedback on the
49status of the ONAP components.
50
51You can run them from one of the kubernetes controller. You need to log on the
52machine then perform the following commands:
53
54::
55
56 $ cd /opt/oom/kubernetes/robot
57 $ ./ete-k8s.sh onap health
58
59You shall the execution of all the healthcheck launched from bash script hosted
60on the kubernetes controller and executed on the robot pod.
61
62At the end you shall see that logs and reporting are automatically generated
63by robot and stored on the pod under /share/logs/.
64You can retrieve the logs directly from the pods or through the web interface
65integrated in the robot pod by typing
mrichomme9643b0c2020-11-14 22:36:57 +010066http://portal.api.simpledemo.onap.org:30209/logs/ (test/test)
umry83641d313be2019-08-19 18:33:25 +020067
68.. figure:: files/robot/robot_logs.png
69 :align: center
70
mrichomme9643b0c2020-11-14 22:36:57 +010071You shall see 3 files:
umry83641d313be2019-08-19 18:33:25 +020072
73* log.html
74* output.xml
75* report.html
76
77A new directory will be created after each run.
78
79log.html should look like
80
81.. figure:: files/robot/robot_report_logs.png
82 :align: center
83
84When the testsuite is passed, the reporting page is green.
85
86.. figure:: files/robot/robot_report_ok.png
87 :align: center
88
89You can click on the test case to get details.
90
91.. figure:: files/robot/robot_report_details.png
92 :align: center
93
94If one of the test is FAIL, the generated web reporting page will be red.
95
96.. figure:: files/robot/robot_report_ko.png
97 :align: center
98
99Lots of tags have been created for healthcheck tests. You may replace health by
100core, small, medium, 3rdparty, health-sdc, health-multicloud,...
101
102See https://git.onap.org/testsuite/tree/robot/testsuites/health-check.robot to
103get all the tags.
104
105As an illustration, healthcheck core traces should be displayed as follows.
106
107::
108
109 $ ./ete-k8s.sh onap core
110 ++ export NAMESPACE=onap
111 ++ NAMESPACE=onap
112 +++ kubectl --namespace onap get pods
113 +++ sed 's/ .*//'
114 +++ grep robot
115 ++ POD=onap-robot-robot-7c47659f7-tt9w4
116 ++ TAGS='-i core'
117 ++ ETEHOME=/var/opt/ONAP
118 +++ kubectl --namespace onap exec onap-robot-robot-7c47659f7-tt9w4 -- bash -c 'ls -1q /share/logs/ | wc -l'
119 ++ export GLOBAL_BUILD_NUMBER=2
120 ++ GLOBAL_BUILD_NUMBER=2
121 +++ printf %04d 2
122 ++ OUTPUT_FOLDER=0002_ete_core
123 ++ DISPLAY_NUM=92
124 ++ VARIABLEFILES='-V /share/config/vm_properties.py -V /share/config/integration_robot_properties.py -V /share/config/integration_preload_parameters.py'
125 ++ VARIABLES='-v GLOBAL_BUILD_NUMBER:17175'
126 ++ kubectl --namespace onap exec onap-robot-robot-7c47659f7-tt9w4 -- /var/opt/ONAP/runTags.sh -V /share/config/vm_properties.py -V /share/config/integration_robot_properties.py -V /share/config/integration_preload_parameters.py -v GLOBAL_BUILD_NUMBER:17175 -d /share/logs/0002_ete_core -i core --display 92
127 Starting Xvfb on display :92 with res 1280x1024x24
128 Executing robot tests at log level TRACE
129 ==============================================================================
130 Testsuites
131 ==============================================================================
132 Testsuites.Health-Check :: Testing ecomp components are available via calls.
133 ==============================================================================
134 Basic A&AI Health Check | PASS |
135 ------------------------------------------------------------------------------
136 Basic DMAAP Message Router Health Check | PASS |
137 ------------------------------------------------------------------------------
138 Basic Portal Health Check | PASS |
139 ------------------------------------------------------------------------------
140 Basic SDC Health Check (DMaaP:UP)| PASS |
141 ------------------------------------------------------------------------------
142 Basic SDNC Health Check | PASS |
143 ------------------------------------------------------------------------------
144 Basic SO Health Check | PASS |
145 ------------------------------------------------------------------------------
146 Testsuites.Health-Check :: Testing ecomp components are available ... | PASS |
147 6 critical tests, 6 passed, 0 failed
148 6 tests total, 6 passed, 0 failed
149 ==============================================================================
150 Testsuites | PASS |
151 6 critical tests, 6 passed, 0 failed
152 6 tests total, 6 passed, 0 failed
153 ==============================================================================
154 Output: /share/logs/0002_ete_core/output.xml
155 Log: /share/logs/0002_ete_core/log.html
156 Report: /share/logs/0002_ete_core/report.html
157
158Onboard and Instantiate VNF/PNF with Robot
159~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
160Robot scripts have been also created to provision components and perform end
161to end tests.
mrichomme9643b0c2020-11-14 22:36:57 +0100162All the robot scripts are hosted on the tesuite repository and deal with various
163test cases and/or components.
umry83641d313be2019-08-19 18:33:25 +0200164
165::
166
167 robot/testsuites/
168 ├── aai
169 │   └── aai-regression-test-v14.robot
170 ├── cds.robot
171 ├── clamp.robot
172 ├── closed-loop.robot
173 ├── create-cloud-config.robot
174 ├── demo.robot
175 ├── health-check.robot
176 ├── hvves.robot
177 ├── model-distribution.robot
178 ├── model-distribution-vcpe.robot
179 ├── oof
180 │   ├── oof-cmso.robot
181 │   ├── oof-has.robot
182 │   └── oof-osdf.robot
183 ├── pnf-registration.robot
184 ├── portalApp.robot
185 ├── post-install-tests.robot
186 ├── update_onap_page.robot
187 ├── vnf-orchestration-direct-so.robot
188 └── vnf-orchestration.robot
189
190It is, for instance possible to test the onboarding of the vFirewall model in
191the SDC by running the command:
192
193::
194
195 $ ete-k8s.sh onap healthdist
196
197If you consider the ete-k8s.sh script, the following testsuites are referenced:
198
199* cds.robot: cds
200* clamp.robot: clamp
201* demo.robot: InitDemo, InitCustomer, APPCCDTPreloadDemo, APPCMountPointDemo, DistributeDemoVFWDT, DistributeVFWNG
202* health-check.robot: health, core, small, medium, 3rdparty, api, datarouter, externalapi, health-aaf,...
203* hvves.robot: HVVES, ete
204* model-distribution-vcpe.robot: distributevCPEResCust
205* model-distribution.robot: distribute, distributeVFWDT, distributeVLB
umry836471380602019-08-21 10:43:14 +0200206* oof-cmso.robot, oof-homing.robot, oof-has.robot: oof related tests
umry83641d313be2019-08-19 18:33:25 +0200207* pnf-registration.robot: ete, pnf_registrate
208* post-install-tests.robot dmaapacl, postinstall
209* update_onap_page.robot: UpdateWebPage
210* vnf-orchestration-direct-so.robot: instantiateVFWdirectso
211* vnf-orchestration.robot: instantiate, instantiateNoDelete, stability72hr
212
mrichomme9643b0c2020-11-14 22:36:57 +0100213If you use the demo-k8s.s script, you may see the following options:
umry83641d313be2019-08-19 18:33:25 +0200214
215* init_robot
216* init
217* init_customer
218* distribute
219* preload
220* appc
221* instantiateVFW
222* instantiateVFWdirectso
223* deleteVNF
224* heatbridge
225* cds
226* distributeVFWNG
227* distributeDemoVFWDT
228* instantiateDemoVFWDT
229* vfwclosedloop
230
umry83641d313be2019-08-19 18:33:25 +0200231See :ref:`Verified Use Cases and Functional Requirements <docs_usecases>` to see
232how to use these scripts. Some of them may need specific prerequisites on the
233environment and may support specific versions and/or configurations.
234
235
236Develop your own Robot scripts
237~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
238A dedicated wiki page has been created to help people to design and write their
239own robot scripts within ONAP context (https://wiki.onap.org/display/DW/Robot+Framework+Development+Guide)
240It is also possible to contact the integration team to get support.