Merge branch 'recursive-orch'
[so.git] / docs / developer_info / ETSI_CSIT_NFVO_VNFM.rst
1 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
2 .. http://creativecommons.org/licenses/by/4.0
3 .. Copyright 2022 Ericsson Software Technologies
4
5 SO ETSI CSIT (NFVO and VNFM)
6 ============================
7 This guide will go through the CSIT of the ETSI NFVO and VNFM.
8
9 Ensure you have a healthy ONAP Deployment running. The following components will be required/used as part of this guide:
10
11 - SO
12 - SDC
13 - AAI
14 - DMAAP
15 - Modeling
16
17 What is ETSI?
18 -------------
19 The European Telecommunications Standards Institute (ETSI) produces globally-applicable standards
20 for Information and Communications Technologies. ETSI  set out standards covering the functionalities
21 of the interfaces specified on the reference points, which use the acronym NFV-SOL
22 (standing for “NFV Solutions”). As of ONAPs Dublin release the  SO SVNFM adapter supports
23 SOL003 standards for Create, Instantiate, Terminate and Delete operations with Granting, Subscription
24 and Notification. As of ONAP Honolulu release, the SO ETSI NFVO sub-component supports
25 SOL005 (NBI) and SOL003 (SBI) standards for Create, Instantiate, Terminate and Delete NS and VNF
26 (through the SOL003 Adapter) operations.
27
28 How to Run CSIT Tests
29 ---------------------
30 The follow steps are to install and run on an Ubuntu 18.04 (desktop) installation.
31 Later versions of Ubuntu and Java may work for the tests.
32
33 First pull the CSIT repo from Gerrit, either with or without the hooks
34
35 .. code-block::
36
37     git clone "https://gerrit.onap.org/r/integration/csit"
38
39 or
40
41 .. code-block::
42
43     git clone "https://gerrit.onap.org/r/integration/csit" && (cd "csit" && mkdir -p .git/hooks && curl -Lo `git rev-parse --git-dir`/hooks/commit-msg https://gerrit.onap.org/r/tools/hooks/commit-msg; chmod +x `git rev-parse --git-dir`/hooks/commit-msg)
44
45 Once this is downloaded a few more installations are required.
46
47 Install pip (if required)
48
49 .. code-block::
50
51     sudo apt install python-pip
52
53 Install Robot Framework through pip
54
55 .. code-block::
56
57     pip install robotframework
58
59 Run Script
60
61 Once all of this is done, then the tests should be run by calling the run-csit.sh script and giving it the location of our test folder (csit/plans/so/integration-etsi-testing).
62 From the csit projects root folder run the following command:
63
64 .. code-block::
65
66     ./run-csit.sh plans/so/integration-etsi-testing
67
68 This should successfully run the ETSI CSIT suite
69
70 How to run tests againt specific SO versions
71 --------------------------------------------
72 It is possible to run the ETSI CSIT suite against local docker images although it is not the default.
73 Through this method specific versions of SO can be tested.
74 There are two changes required to make this work.
75 The env file, located at [containing folder]/csit/plans/so/integration-etsi-testing/config/env,
76 first needs to be changed. The DOCKER_ENVIROMENT needs to be changed from "remote" to "local".
77 Also the TAG value might need to be changed. This Tag relates to the version of images being used.
78
79 Secondly all of the required docker images must be present on system.
80
81 This should be enough to run the ETSI CSIT test suite locally.
82
83 ETSI NFVO Automated CSIT Tests High Level Scenarios
84 ---------------------------------------------------
85 **Step 1:**
86
87 Perform Configuration / Setup Steps prior to running tests
88
89 **Step 2:**
90
91 Onboard SOL004 Package and SOL007 directly into ETSI Catalog using ROBOT framework
92
93 **Step 3:**
94
95 ETSI Catalog Gets Package from SDC Simulator (New: ETSI Catalog and Modeling ETSI Catalog DB will need to be set up and spun up for CSIT. May be some impact on SDC Simulator here)
96
97 **Step 4:**
98
99 ETSI Catalog Stores Package in its Modeling ETSI Catalog DB
100
101 **Step 5:**
102
103 ROBOT framework used to trigger NS LCM requests, e.g., INSTANTIATE NS
104
105 **Step 6:**
106
107 ETSI NFVO NS LCM gets required data from ETSI Catalog, e.g., Get and Parse NSD
108
109 **Step 7:**
110
111 If e.g., a CREATE NS task, ETSI NFVO NS LCM checks to see if already exists in ETSI NFVO DB
112
113 **Step 8:**
114
115 Create Generic VNF and connect to Service Instance in A&AI Simulator (May be some impact on A&AI Simulator here)
116
117 **Step 9:**
118
119 Instantiate VNF through SOL003 Adapter
120
121 **Step 10:**
122
123 SOL003 Adapter processes requests through A&AI and (May be some impact on A&AI Simulator here)
124
125 **Step 11:**
126
127 SOL003 Adapter processes requests through ETSI-Catalog
128
129 **Step 12:**
130
131 SOL003 Adapter sends notification to SOL003 NBI, etc.
132
133 What are the tests doing?
134 -------------------------
135 There are three tests currently being run "Distribute Service Template", "Invoke Service Instantiation",
136 "Invoke NS Instantiation", "Delete NS Instance", "Invoke VNF Instantiation", "Delete VNF Instance" and
137 "Delete Service Instance".
138
139 Distribute Service Template
140
141 As the name would suggest the aim for the "Distribute Service Template" test is to distribute a service
142 template within the SDC controller pod. Once a http session of the SDC controller is created a post request
143 can be made to it. This post requests sends binary data from "distributeServiceTemplate.json".
144 This json file contains resources and artifacts required to distribute a service. Once this post request
145 is sent, the response status code is checked to see if it is 200. If the code is not equal to 200 then
146 the test is thought to be a failure.
147
148 Invoke Service Instantiation
149
150 The aim of the "Invoke Service Instantiation" test is to invoke the service distributed to the sdc controller
151 in the previous test. A http session of the api handler pod is created. This session is sent a post request
152 containing "serviceInstantiationRequest.json". Once this request is made the response is checked if it
153 a valid code is returned.  A for loop is used to continually make calls to check the orchestration request,
154 to check the status of service instantiation. Only once this orchestration returns either a fail or success,
155 will we break out of the for loop.Once outside the for loop a final statement is used to check if service
156 has been successfully instantiated.
157
158 Invoke NS Instance
159
160 The aim of "Invoke NS Instantiation" test is to now instantiate the NS that relates to service in the
161 previous test. This test requires the ID of the service instance created in the previous test. If this is
162 not provided then the test will fail from the get go. Once again a http session of the api handler pod is
163 created. Similarly a post request using the json data within "nsInstantiationRequest.json".
164 Once this request is made if it returns a success code then the test moves on to a for loop. Within this
165 for a loop an orchestration request is made each time, when this request signals that either the instantiation
166 request has failed or fully succeeded then the loop is escaped. The test will either be a pass or fail depending
167 on this final orchestration request.
168
169 Delete NS Instance
170
171 This test will delete the NS Instance created in the previous test. Both the ID of the NS instance created
172 in the previous test and the service instance created in the test before that. If either of these values is
173 not provided then the test will fail. This test once again makes use of a session of the api handler pod.
174 A post request is made using the data from  "nsDeleteRequest.json". Once this request is made if it returns
175 a success code then the test moves on to a for loop. Within this for a loop an orchestration request is made
176 each time, when this request signals that either the instantiation request has failed or fully succeeded
177 then the loop is escaped. The test will either be a pass or fail depending on this final orchestration request.
178
179 Invoke VNF Instance
180
181 The aim of "Invoke VNF Instantiation" test is to now instantiate the VNF that relates to service in
182 the previous test. This test requires the ID of the service instance created in the previous test.
183 If this is not provided then the test will fail from the get go. Once again a http session of the
184 api handler pod is created. Similarly a post request using the json data within "vnfInstantiationRequest.json".
185 Once this request is made if it returns a success code then the test moves on to a for loop. Within this
186 for a loop an orchestration request is made each time, when this request signals that either the instantiation
187 request has failed or fully succeeded then the loop is escaped. The test will either be a pass or fail
188 depending on this final orchestration request.
189
190 Delete VNF Instance
191
192 This test will delete the VNF Instance created in the previous test. Both the ID of the vnf instance created
193 in the previous test and the service instance created in the test before that. If either of these values is
194 not provided then the test will fail. This test once again makes use of a session of the api handler pod.
195 A post request is made using the data from  "vnfDeleteRequest.json". Once this request is made if it returns
196 a success code then the test moves on to a for loop. Within this for a loop an orchestration request is made
197 each time, when this request signals that either the instantiation request has failed or fully succeeded then
198 the loop is escaped. The test will either be a pass or fail depending on this final orchestration request.
199
200 Delete Service Instance
201
202 This test will delete the service instance created in earlier test. To delete the service the ID of previously
203  created Service Instance is required, if this is not supplied then the test will fail before starting.
204  A post request is then made to the API handler containing data from "serviceDeleteRquest.json".
205  Once this request is made if it returns a success code then the test moves on to a for loop.
206  Within this for a loop an orchestration request is made each time, when this request signals that either
207  the instantiation request has failed or fully succeeded then the loop is escaped. The test will either be
208  a pass or fail depending on this final orchestration request.
209
210 Troubleshooting
211 ---------------
212 There are a number of simple issues relating from Python and its libraries
213
214 A correct installation of the robot framework to run our tests requiring python and the following pip libraries.
215
216 - robotframework
217 - robotframework-extendedselenium2library
218 - robotframework-httplibrary
219 - robotframework-onap
220 - robotframework-requests
221 - robotframework-selenium2library
222
223 To make sure each of the previous libraries is installed run the following command
224
225 .. code-block::
226
227     pip -list