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
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
|
# Functest
### Feedback on Euphrates evolutions
2017/10/09
### Main Framework evolutions
* Functest Framework refactoring
* Docker slicing with Alpine
* Building Functest dockers
* Requirement management...1st time...in OPNFV
* Functest API
## Functest Framework refactoring
### The framework
* Initiated in Danube
* Finalized in euphrates
* Goal: ease the integration of feature/vnf tests
### See complete presentation on the framework
http://testresults.opnfv.org/functest/framework/
## Docker slicing
#### Short story of Functest Docker
### Many rivers to cross
| Version | Comment |
|-------------|-----------------------------------------------------|
| Arno | No docker, all tests initiated from the jumphost |
| Brahmaputra | Introduction of Docker |
| Colorado | Growth of Historical Docker |
| Danube | Growth of Historical Docker |
| Euphrates | Introduction of Alpine |
### Focus on the Historical Docker
* Based on ubuntu 14.04
| Version | Compressed Size |
|--------------|-----------------|
| Brahmaputra | 354 MB |
| Colorado.1.0 | 627 MB |
| Danube.1.0 | 713 MB |
| cvp.0.2.0 | 710 MB |
* src: https://hub.docker.com/r/opnfv/functest/tags/
### Introduction to Alpine
* Alpine Linux is a GNU/Linux distribution based on musl and Busybox
* Hardened kernel, compiles all user space binaries as position-independent executables with stack-smashing protection.
* Docker Alpine leverage Alpine Linux: https://docs.docker.com/samples/library/alpine/
### Our goals
* Lighten docker / save bandwidth / save CI resources
* Slice testing
* Simplify Requirement management
* Isolate "exotic" test cases
### From 1 to many dockers
| Docker | Size | Role |
|-------------|-------|-------------------------------------------------|
| core | 122MB | baseline (tools, env) |
| healthcheck | 122MB | OS connectivity, API, DHCP testing |
| smoke | 131MB | vpings, Tempest/Refstack, Rally, odl, Snaps |
| features | 214MB | doctor, domino, sdnvpn, sfc, promise, barometer |
### From 1 to many dockers
| Docker | Size | Role |
|-------------|-------|-------------------------------------------------|
| components | 122MB | Full Tempest, Full Rally |
| vnf | 155MB | vIMS, vRouter |
| parser | 127MB | parser (feature needs pike clients) |
### Easy way to run
src: https://wiki.opnfv.org/display/functest/Run+Alpine+Functest+containers
* env: OPNFV env variables
* openstack.creds: OpenStack rc file
```
sudo docker run --env-file env \
-v $(pwd)/openstack.creds:/home/opnfv/functest/conf/openstack.creds \
-v $(pwd)/images:/home/opnfv/functest/images \
opnfv/functest-smoke:euphrates
```
#### Env
```
cat env
INSTALLER_TYPE=Compass
INSTALLER_IP=XXX
EXTERNAL_NETWORK=ext-net
DEPLOY_SCENARIO=os-nosdn-nofeature-ha
```
#### openstack.creds
```
cat openstack.creds
export OS_AUTH_URL=XXX
export OS_USER_DOMAIN_NAME=XXX
export OS_PROJECT_DOMAIN_NAME=XXX
export OS_USERNAME=XXX
export OS_PROJECT_NAME=XXX
export OS_PASSWORD=XXX
export OS_IDENTITY_API_VERSION=3
```
#### Retrieve all the images
```
mkdir -p images && wget -q -O- https://git.opnfv.org/functest/plain/functest/ci/download_images.sh | bash -s -- images && ls -1 images/*
images/CentOS-7-aarch64-GenericCloud.qcow2
images/CentOS-7-aarch64-GenericCloud.qcow2.xz
images/CentOS-7-x86_64-GenericCloud.qcow2
images/cirros-0.3.5-x86_64-disk.img
images/cirros-0.3.5-x86_64-lxc.tar.gz
images/cirros-d161201-aarch64-disk.img
images/cirros-d161201-aarch64-initramfs
images/cirros-d161201-aarch64-kernel
images/cloudify-manager-premium-4.0.1.qcow2
images/img
images/trusty-server-cloudimg-amd64-disk1.img
images/ubuntu-14.04-server-cloudimg-amd64-disk1.img
images/ubuntu-14.04-server-cloudimg-arm64-uefi1.img
images/ubuntu-16.04-server-cloudimg-amd64-disk1.img
images/vyos-1.1.7.img
```
* could be improved (retrieve only needed images Tier/config)
#### Results
```
+----------------------+--------- + ------+----------+--------+
| TEST CASE | PROJECT | TIER | DURATION | RESULT |
+----------------------+--------- + ------+----------+--------+
| vping_ssh | functest | smoke | 01:19 | PASS |
| vping_userdata | functest | smoke | 01:56 | PASS |
| tempest_smoke_serial | functest | smoke | 26:30 | PASS |
| rally_sanity | functest | smoke | 19:42 | PASS |
| refstack_defcore | functest | smoke | 22:00 | PASS |
| snaps_smoke | functest | smoke | 41:14 | PASS |
| odl | functest | smoke | 00:16 | PASS |
| odl_netvirt | functest | smoke | 00:00 | SKIP |
| fds | functest | smoke | 00:00 | SKIP |
+----------------------+--------- + ------+----------+--------+
```
#### Easy way to customize
* Change list of testcase -v your_config.yaml:/usr/lib/python2.7/site-packages/functest/ci/testcases.yaml
* Change logger param -v your_logger.ini:/usr/lib/python2.7/site-packages/functest/ci/logging.ini
#### Docker slicing technical presentation
http://testresults.opnfv.org/functest/dockerslicing/
## Building Functest dockers
#### Until Danube
* the unique Functest docker was "produced" from Releng
#### For Euphrates, build was done on Docker hub
* Releng adaptations not ready in time
* more capabilities using Docker Hub
* Use of private ollivier then official opnfv Docker Hub
* Euphrates 5.1: come back to releng with at least same level of features than Docker Hub/Travis CI
## Requirement management
Until now, requirements were managed as follow:
# ?
### Requirement management
* Nothing was done
* Danube, Colorado, .. dockers may run but no garantee on mid/long term because
* No control of upstream or internal project dependencies
* the dependencies of the last feature project overwrite the previous ones
### Requirement management
* Nothing done in any OPNFV project
* No dependency list, no reco (e.g. support Python 3)
* Only high level wiki declarative intentions for OpenStack (e.g. Euphrates => Ocata)
* Nothing equivalent to OpenStack https://releases.openstack.org/ocata/
### Functest evolutions
* creation of requirements.txt, upper-constraints.text
https://git.opnfv.org/functest/tree/requirements.txt
https://git.opnfv.org/functest/tree/upper-constraints.txt
```
pbr>=1.8 # Apache-2.0
PyYAML>=3.10.0 # MIT
GitPython>=1.0.1 # BSD License (3 clause)
keystoneauth1>=2.18.0 # Apache-2.0
python-cinderclient!=1.7.0,!=1.7.1,>=1.6.0 # Apache-2.0
python-glanceclient>=2.5.0 # Apache-2.0
python-heatclient>=1.6.1 # Apache-2.0
...
```
* sync with ocata done manually by Cédric
### Functest evolutions
* Code of the feature projects under project responsibility
* code moved to their own repo
* no more mix between Functest and Feature project code
* All python OPNFV projects imported properly as python modules
* all dependencies a priori under control...
## Functest Rest API
### Introduction
* A Rest API has been introduced in Euphrates (Linda)
* Goal: allow third party to invoke Functest resources
* pseudo micro services approach
* avoid overlap (e.g. deployement of vIMS from other project to run perfo tests)
src: https://wiki.opnfv.org/display/functest/Functest+REST+API
### Functest rest API
| resource | Methods | Description |
|-------------|----------|-------------------------------------------------|
| environment | GET,POST | show, prepare environment |
| openstack | GET,POST | show, check, clean, update credentials |
| testcases | GET,POST | list, show, run |
| tiers | GET,POST | list, show |
| tasks | GET | Get the result of the task id |
### Examples
```
curl -X POST --header "Content-Type: application/json" \
--data '{"action":"run_test_case", "args": {"opts": {}, "testcase": "vping_ssh"}}' \
http://127.0.0.1:5000/api/v1/functest/testcases/action
{
"task_id": "1a9f3c5d-ce0b-4354-862e-dd08b26fc484",
"testcase":"vping_ssh"
}
```
## Conclusions
* Framework heavily refactored for Euphrates
* Better code quality and rules (coverage, pylint, pep8, ..)
* Much more "trustable", light and evolutive
## Next steps
* Still lots of work for Fraser
* Adaptation to use it for XCI gating (xTesting)
* Generic dockerfile Functest customized docker on demand
* split framework and testcases in order to be able to reuse Functest for k8 or even beyond OPNFV
* integrate k8 tests
* better management of the images
* ...
|