E2E Network slicing - I-rel Documentation update
[integration.git] / docs / docs_robot.rst
1 .. 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
6 :orphan:
7
8 Robot
9 -----
10
11 Introduction
12 ~~~~~~~~~~~~
13 Robot Framework is a generic open source automation framework for acceptance
14 testing, acceptance test driven development (ATDD), and robotic process
15 automation (RPA). This framework is widely used in ONAP.
16 The full documentation of robot can be found in https://robotframework.org/.
17
18 In ONAP, Robot scripts have been developed to validate the components, provision
19 and run end to end tests.
20
21 The robot scripts can be retrieved in the ONAP testsuite repository: https://git.onap.org/testsuite/
22
23 A Robot pod is part of the ONAP default installation.
24 This pod includes the robot framework and the needed scripts cloned from the
25 testsuite repository.
26 Additional scripts are created during the installation in order to simplify
27 the launch of the different tests and are loacted in /opt/oom/kubernetes/robots.
28
29 From 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
36 You can access the robot configuration through its configmap.
37
38 ::
39
40   $ kubectl describe cm onap-robot-robot-eteshare-configmap -n onap
41
42 You shall see a long list of variables set during the ONAP installation by OOM.
43 Please note that some of these variables are set thanks to the OOM
44 overide openstack.yaml file. See the examples described in https://git.onap.org/oom/tree/kubernetes/onap/resources/overrides/openstack.yaml
45
46 Verification of the ONAP components
47 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
48 ONAP robot healthcheck tests have been created to give a quick feedback on the
49 status of the ONAP components.
50
51 You can run them from one of the kubernetes controller. You need to log on the
52 machine then perform the following commands:
53
54 ::
55
56   $ cd /opt/oom/kubernetes/robot
57   $ ./ete-k8s.sh onap health
58
59 You shall the execution of all the healthcheck launched from bash script hosted
60 on the kubernetes controller and executed on the robot pod.
61
62 At the end you shall see that logs and reporting are automatically generated
63 by robot and stored on the pod under /share/logs/.
64 You can retrieve the logs directly from the pods or through the web interface
65 integrated in the robot pod by typing
66 http://portal.api.simpledemo.onap.org:30209/logs/ (test/test)
67
68 .. figure:: files/robot/robot_logs.png
69    :align: center
70
71 You shall see 3 files:
72
73 * log.html
74 * output.xml
75 * report.html
76
77 A new directory will be created after each run.
78
79 log.html should look like
80
81 .. figure:: files/robot/robot_report_logs.png
82    :align: center
83
84 When the testsuite is passed, the reporting page is green.
85
86 .. figure:: files/robot/robot_report_ok.png
87    :align: center
88
89 You can click on the test case to get details.
90
91 .. figure:: files/robot/robot_report_details.png
92    :align: center
93
94 If 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
99 Lots of tags have been created for healthcheck tests. You may replace health by
100 core, small, medium, 3rdparty, health-sdc, health-multicloud,...
101
102 See https://git.onap.org/testsuite/tree/robot/testsuites/health-check.robot to
103 get all the tags.
104
105 As 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
158 Onboard and Instantiate VNF/PNF with Robot
159 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
160 Robot scripts have been also created to provision components and perform end
161 to end tests.
162 All the robot scripts are hosted on the tesuite repository and deal with various
163 test cases and/or components.
164
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
190 It is, for instance possible to test the onboarding of the vFirewall model in
191 the SDC by running the command:
192
193 ::
194
195   $ ete-k8s.sh onap healthdist
196
197 If 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
206 * oof-cmso.robot, oof-homing.robot, oof-has.robot: oof related tests
207 * 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
213 If you use the demo-k8s.s script, you may see the following options:
214
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
231 See :ref:`Verified Use Cases and Functional Requirements <docs_usecases>` to see
232 how to use these scripts. Some of them may need specific prerequisites on the
233 environment and may support specific versions and/or configurations.
234
235
236 Develop your own Robot scripts
237 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
238 A dedicated wiki page has been created to help people to design and write their
239 own robot scripts within ONAP context (https://wiki.onap.org/display/DW/Robot+Framework+Development+Guide)
240 It is also possible to contact the integration team to get support.