aboutsummaryrefslogtreecommitdiffstats
path: root/docs/docs_robot.rst
blob: 4d1a724894693e726b474a226217acb3dbd2929f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
.. This work is licensed under a Creative Commons Attribution 4.0
   International License. http://creativecommons.org/licenses/by/4.0

.. _docs_robot:

Robot
-----

Introduction
~~~~~~~~~~~~
Robot Framework is a generic open source automation framework for acceptance
testing, acceptance test driven development (ATDD), and robotic process
automation (RPA). This framework is widely used in ONAP.
The full documentation of robot can be found in https://robotframework.org/.

In ONAP, Robot scripts have been developed to validate the components, provision
and run end to end tests.

The robot scripts can be retrieved in the ONAP testsuite repository: https://git.onap.org/testsuite/

A Robot pod is part of the ONAP default installation.
This pod includes the robot framework and the needed scripts cloned from the
testsuite repository.
Additional scripts are created during the installation in order to simplify
the launch of the different tests and are loacted in /opt/oom/kubernetes/robots.

From one of the kubernetes controller, you shall see the pod as follows:

::

  $ kubectl get pods -n onap | grep robot
  onap-robot-robot-7fc49977fd-6jblt    1/1     Running    0          9h

You can access the robot configuration through its configmap.

::

  $ kubectl describe cm onap-robot-robot-eteshare-configmap -n onap

You shall see a long list of variables set during the ONAP installation by OOM.
Please note that some of these variables are set thanks to the OOM
overide openstack.yaml file. See the examples described in https://git.onap.org/oom/tree/kubernetes/onap/resources/overrides/openstack.yaml

Verification of the ONAP components
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ONAP robot healthcheck tests have been created to give a quick feedback on the
status of the ONAP components.

You can run them from one of the kubernetes controller. You need to log on the
machine then perform the following commands:

::

  $ cd /opt/oom/kubernetes/robot
  $ ./ete-k8s.sh onap health

You shall the execution of all the healthcheck launched from bash script hosted
on the kubernetes controller and executed on the robot pod.

At the end you shall see that logs and reporting are automatically generated
by robot and stored on the pod under /share/logs/.
You can retrieve the logs directly from the pods or through the web interface
integrated in the robot pod by typing
http://portal.api.simpledemo.onap.org:30209/logs/ (test/test)

.. figure:: files/robot/robot_logs.png
   :align: center

You shall see 3 files:

* log.html
* output.xml
* report.html

A new directory will be created after each run.

log.html should look like

.. figure:: files/robot/robot_report_logs.png
   :align: center

When the testsuite is passed, the reporting page is green.

.. figure:: files/robot/robot_report_ok.png
   :align: center

You can click on the test case to get details.

.. figure:: files/robot/robot_report_details.png
   :align: center

If one of the test is FAIL, the generated web reporting page will be red.

.. figure:: files/robot/robot_report_ko.png
   :align: center

Lots of tags have been created for healthcheck tests. You may replace health by
core, small, medium, 3rdparty, health-sdc, health-multicloud,...

See https://git.onap.org/testsuite/tree/robot/testsuites/health-check.robot to
get all the tags.

As an illustration, healthcheck core traces should be displayed as follows.

::

  $ ./ete-k8s.sh onap core
  ++ export NAMESPACE=onap
  ++ NAMESPACE=onap
  +++ kubectl --namespace onap get pods
  +++ sed 's/ .*//'
  +++ grep robot
  ++ POD=onap-robot-robot-7c47659f7-tt9w4
  ++ TAGS='-i core'
  ++ ETEHOME=/var/opt/ONAP
  +++ kubectl --namespace onap exec onap-robot-robot-7c47659f7-tt9w4 -- bash -c 'ls -1q /share/logs/ | wc -l'
  ++ export GLOBAL_BUILD_NUMBER=2
  ++ GLOBAL_BUILD_NUMBER=2
  +++ printf %04d 2
  ++ OUTPUT_FOLDER=0002_ete_core
  ++ DISPLAY_NUM=92
  ++ VARIABLEFILES='-V /share/config/vm_properties.py -V /share/config/integration_robot_properties.py -V /share/config/integration_preload_parameters.py'
  ++ VARIABLES='-v GLOBAL_BUILD_NUMBER:17175'
  ++ 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
  Starting Xvfb on display :92 with res 1280x1024x24
  Executing robot tests at log level TRACE
  ==============================================================================
  Testsuites
  ==============================================================================
  Testsuites.Health-Check :: Testing ecomp components are available via calls.
  ==============================================================================
  Basic A&AI Health Check                                               | PASS |
  ------------------------------------------------------------------------------
  Basic DMAAP Message Router Health Check                               | PASS |
  ------------------------------------------------------------------------------
  Basic Portal Health Check                                             | PASS |
  ------------------------------------------------------------------------------
  Basic SDC Health Check                                                (DMaaP:UP)| PASS |
  ------------------------------------------------------------------------------
  Basic SDNC Health Check                                               | PASS |
  ------------------------------------------------------------------------------
  Basic SO Health Check                                                 | PASS |
  ------------------------------------------------------------------------------
  Testsuites.Health-Check :: Testing ecomp components are available ... | PASS |
  6 critical tests, 6 passed, 0 failed
  6 tests total, 6 passed, 0 failed
  ==============================================================================
  Testsuites                                                            | PASS |
  6 critical tests, 6 passed, 0 failed
  6 tests total, 6 passed, 0 failed
  ==============================================================================
  Output:  /share/logs/0002_ete_core/output.xml
  Log:     /share/logs/0002_ete_core/log.html
  Report:  /share/logs/0002_ete_core/report.html

Onboard and Instantiate VNF/PNF with Robot
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Robot scripts have been also created to provision components and perform end
to end tests.
All the robot scripts are hosted on the tesuite repository and deal with various
test cases and/or components.

::

  robot/testsuites/
  ├── aai
  │   └── aai-regression-test-v14.robot
  ├── cds.robot
  ├── clamp.robot
  ├── closed-loop.robot
  ├── create-cloud-config.robot
  ├── demo.robot
  ├── health-check.robot
  ├── hvves.robot
  ├── model-distribution.robot
  ├── model-distribution-vcpe.robot
  ├── oof
  │   ├── oof-cmso.robot
  │   ├── oof-has.robot
  │   └── oof-osdf.robot
  ├── pnf-registration.robot
  ├── portalApp.robot
  ├── post-install-tests.robot
  ├── update_onap_page.robot
  ├── vnf-orchestration-direct-so.robot
  └── vnf-orchestration.robot

It is, for instance possible to test the onboarding of the vFirewall model in
the SDC by running the command:

::

  $ ete-k8s.sh onap healthdist

If you consider the ete-k8s.sh script, the following testsuites are referenced:

* cds.robot: cds
* clamp.robot: clamp
* demo.robot: InitDemo, InitCustomer, APPCCDTPreloadDemo, APPCMountPointDemo, DistributeDemoVFWDT, DistributeVFWNG
* health-check.robot: health, core, small, medium, 3rdparty, api, datarouter, externalapi, health-aaf,...
* hvves.robot: HVVES, ete
* model-distribution-vcpe.robot: distributevCPEResCust
* model-distribution.robot: distribute, distributeVFWDT, distributeVLB
* oof-*.robot: cmso, has, homing
* pnf-registration.robot: ete, pnf_registrate
* post-install-tests.robot dmaapacl, postinstall
* update_onap_page.robot: UpdateWebPage
* vnf-orchestration-direct-so.robot: instantiateVFWdirectso
* vnf-orchestration.robot: instantiate, instantiateNoDelete, stability72hr

If you use the demo-k8s.s script, you may see the following options:

* init_robot
* init
* init_customer
* distribute
* preload
* appc
* instantiateVFW
* instantiateVFWdirectso
* deleteVNF
* heatbridge
* cds
* distributeVFWNG
* distributeDemoVFWDT
* instantiateDemoVFWDT
* vfwclosedloop

See :ref:`Verified Use Cases and Functional Requirements <docs_usecases>` to see
how to use these scripts. Some of them may need specific prerequisites on the
environment and may support specific versions and/or configurations.


Develop your own Robot scripts
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
A dedicated wiki page has been created to help people to design and write their
own robot scripts within ONAP context (https://wiki.onap.org/display/DW/Robot+Framework+Development+Guide)
It is also possible to contact the integration team to get support.