1 .. SPDX-License-Identifier: CC-BY-4.0
3 Installation and configuration
4 ==============================
6 Alpine containers have been introduced in Euphrates.
7 Alpine allows Functest testing in several very light containers and thanks to
8 the refactoring on dependency management should allow the creation of light and
9 fully customized docker images.
12 Functest Dockers for OpenStack deployment
13 -----------------------------------------
14 Docker images are available on the dockerhub:
17 * opnfv/functest-healthcheck
18 * opnfv/functest-smoke
19 * opnfv/functest-features
20 * opnfv/functest-components
22 * opnfv/functest-parser
24 The tag "opnfv-6.0.0" is the official release image in Fraser, but you can
25 also pull "fraser" tag as it is being maintained by Functest team and might
28 The Functest docker container environment can -in principle- be also
29 used with non-OPNFV official installers (e.g. 'devstack'), with the
30 **disclaimer** that support for such environments is outside of the
31 scope and responsibility of the OPNFV project.
34 Preparing your environment
35 ^^^^^^^^^^^^^^^^^^^^^^^^^^
40 DEPLOY_SCENARIO=XXX # if not os-nosdn-nofeature-noha scenario
41 NAMESERVER=XXX # if not 8.8.8.8
43 See section on environment variables for details.
47 export OS_AUTH_URL=XXX
48 export OS_USER_DOMAIN_NAME=XXX
49 export OS_PROJECT_DOMAIN_NAME=XXX
50 export OS_USERNAME=XXX
51 export OS_PROJECT_NAME=XXX
52 export OS_PASSWORD=XXX
53 export OS_IDENTITY_API_VERSION=3
55 See section on OpenStack credentials for details.
57 Create a directory for the different images (attached as a Docker volume)::
59 mkdir -p images && wget -q -O- https://git.opnfv.org/functest/plain/functest/ci/download_images.sh?h=stable/fraser | bash -s -- images && ls -1 images/*
61 images/CentOS-7-aarch64-GenericCloud.qcow2
62 images/CentOS-7-aarch64-GenericCloud.qcow2.xz
63 images/CentOS-7-x86_64-GenericCloud.qcow2
64 images/cirros-0.4.0-x86_64-disk.img
65 images/cirros-0.4.0-x86_64-lxc.tar.gz
66 images/cirros-d161201-aarch64-disk.img
67 images/cirros-d161201-aarch64-initramfs
68 images/cirros-d161201-aarch64-kernel
69 images/cloudify-manager-premium-4.0.1.qcow2
70 images/ubuntu-14.04-server-cloudimg-amd64-disk1.img
71 images/ubuntu-14.04-server-cloudimg-arm64-uefi1.img
72 images/ubuntu-16.04-server-cloudimg-amd64-disk1.img
75 Testing healthcheck suite
76 ^^^^^^^^^^^^^^^^^^^^^^^^^
78 Run healthcheck suite::
80 sudo docker run --env-file env \
81 -v $(pwd)/openstack.creds:/home/opnfv/functest/conf/env_file \
82 -v $(pwd)/images:/home/opnfv/functest/images \
83 opnfv/functest-healthcheck
85 Results shall be displayed as follows::
87 +----------------------------+------------------+---------------------+------------------+----------------+
88 | TEST CASE | PROJECT | TIER | DURATION | RESULT |
89 +----------------------------+------------------+---------------------+------------------+----------------+
90 | connection_check | functest | healthcheck | 00:07 | PASS |
91 | api_check | functest | healthcheck | 07:46 | PASS |
92 | snaps_health_check | functest | healthcheck | 00:36 | PASS |
93 +----------------------------+------------------+---------------------+------------------+----------------+
94 NOTE: the duration is a reference and it might vary depending on your SUT.
101 sudo docker run --env-file env \
102 -v $(pwd)/openstack.creds:/home/opnfv/functest/conf/env_file \
103 -v $(pwd)/images:/home/opnfv/functest/images \
106 Results shall be displayed as follows::
108 +------------------------------+------------------+---------------+------------------+----------------+
109 | TEST CASE | PROJECT | TIER | DURATION | RESULT |
110 +------------------------------+------------------+---------------+------------------+----------------+
111 | vping_ssh | functest | smoke | 00:57 | PASS |
112 | vping_userdata | functest | smoke | 00:33 | PASS |
113 | tempest_smoke_serial | functest | smoke | 13:22 | PASS |
114 | rally_sanity | functest | smoke | 24:07 | PASS |
115 | refstack_defcore | functest | smoke | 05:21 | PASS |
116 | patrole | functest | smoke | 04:29 | PASS |
117 | snaps_smoke | functest | smoke | 46:54 | PASS |
118 | odl | functest | smoke | 00:00 | SKIP |
119 | neutron_trunk | functest | smoke | 00:00 | SKIP |
120 +------------------------------+------------------+---------------+------------------+----------------+
121 Note: if the scenario does not support some tests, they are indicated as SKIP.
122 See User guide for details.
124 Testing features suite
125 ^^^^^^^^^^^^^^^^^^^^^^
129 sudo docker run --env-file env \
130 -v $(pwd)/openstack.creds:/home/opnfv/functest/conf/env_file \
131 -v $(pwd)/images:/home/opnfv/functest/images \
132 opnfv/functest-features
134 Results shall be displayed as follows::
136 +-----------------------------+------------------------+------------------+------------------+----------------+
137 | TEST CASE | PROJECT | TIER | DURATION | RESULT |
138 +-----------------------------+------------------------+------------------+------------------+----------------+
139 | doctor-notification | doctor | features | 00:00 | SKIP |
140 | bgpvpn | sdnvpn | features | 00:00 | SKIP |
141 | functest-odl-sfc | sfc | features | 00:00 | SKIP |
142 | barometercollectd | barometer | features | 00:00 | SKIP |
143 | fds | fastdatastacks | features | 00:00 | SKIP |
144 +-----------------------------+------------------------+------------------+------------------+----------------+
145 Note: if the scenario does not support some tests, they are indicated as SKIP.
146 See User guide for details.
148 Testing components suite
149 ^^^^^^^^^^^^^^^^^^^^^^^^
151 Run components suite::
153 sudo docker run --env-file env \
154 -v $(pwd)/openstack.creds:/home/opnfv/functest/conf/env_file \
155 -v $(pwd)/images:/home/opnfv/functest/images \
156 opnfv/functest-components
158 Results shall be displayed as follows::
160 +-------------------------------+------------------+--------------------+------------------+----------------+
161 | TEST CASE | PROJECT | TIER | DURATION | RESULT |
162 +-------------------------------+------------------+--------------------+------------------+----------------+
163 | tempest_full_parallel | functest | components | 48:28 | PASS |
164 | rally_full | functest | components | 126:02 | PASS |
165 +-------------------------------+------------------+--------------------+------------------+----------------+
172 sudo docker run --env-file env \
173 -v $(pwd)/openstack.creds:/home/opnfv/functest/conf/env_file \
174 -v $(pwd)/images:/home/opnfv/functest/images \
177 Results shall be displayed as follows::
179 +----------------------+------------------+--------------+------------------+----------------+
180 | TEST CASE | PROJECT | TIER | DURATION | RESULT |
181 +----------------------+------------------+--------------+------------------+----------------+
182 | cloudify_ims | functest | vnf | 28:15 | PASS |
183 | vyos_vrouter | functest | vnf | 17:59 | PASS |
184 | juju_epc | functest | vnf | 46:44 | PASS |
185 +----------------------+------------------+--------------+------------------+----------------+
188 Functest Dockers for Kubernetes deployment
189 ------------------------------------------
190 Docker images are available on the dockerhub:
192 * opnfv/functest-kubernetes-core
193 * opnfv/functest-kubernetest-healthcheck
194 * opnfv/functest-kubernetest-smoke
195 * opnfv/functest-kubernetest-features
197 Preparing your environment
198 ^^^^^^^^^^^^^^^^^^^^^^^^^^
207 export KUBERNETES_PROVIDER=local
208 export KUBE_MASTER_URL=XXX
209 export KUBE_MASTER_IP=XXX
211 Testing healthcheck suite
212 ^^^^^^^^^^^^^^^^^^^^^^^^^
214 Run healthcheck suite::
216 sudo docker run -it --env-file env \
217 -v $(pwd)/k8s.creds:/home/opnfv/functest/conf/env_file \
218 -v $(pwd)/config:/root/.kube/config \
219 opnfv/functest-kubernetes-healthcheck
221 A config file in the current dir 'config' is also required, which should be
222 volume mapped to ~/.kube/config inside kubernetes container.
224 Results shall be displayed as follows::
226 +-------------------------+------------------+-----------------+------------------+----------------+
227 | TEST CASE | PROJECT | TIER | DURATION | RESULT |
228 +-------------------------+------------------+-----------------+------------------+----------------+
229 | k8s_smoke | functest | healthcheck | 01:54 | PASS |
230 +-------------------------+------------------+-----------------+------------------+----------------+
237 sudo docker run -it --env-file env \
238 -v $(pwd)/k8s.creds:/home/opnfv/functest/conf/env_file \
239 -v $(pwd)/config:/root/.kube/config \
240 opnfv/functest-kubernetes-smoke
242 Results shall be displayed as follows::
244 +-------------------------+------------------+---------------+------------------+----------------+
245 | TEST CASE | PROJECT | TIER | DURATION | RESULT |
246 +-------------------------+------------------+---------------+------------------+----------------+
247 | k8s_conformance | functest | smoke | 57:47 | PASS |
248 +-------------------------+------------------+---------------+------------------+----------------+
250 Testing features suite
251 ^^^^^^^^^^^^^^^^^^^^^^
255 sudo docker run -it --env-file env \
256 -v $(pwd)/k8s.creds:/home/opnfv/functest/conf/env_file \
257 -v $(pwd)/config:/root/.kube/config \
258 opnfv/functest-kubernetes-features
260 Results shall be displayed as follows::
262 +----------------------+------------------+------------------+------------------+----------------+
263 | TEST CASE | PROJECT | TIER | DURATION | RESULT |
264 +----------------------+------------------+------------------+------------------+----------------+
265 | stor4nfv_k8s | stor4nfv | stor4nfv | 00:00 | SKIP |
266 | clover_k8s | clover | clover | 00:00 | SKIP |
267 +----------------------+------------------+------------------+------------------+----------------+
269 Environment variables
270 =====================
272 Several environement variables may be specified:
273 * INSTALLER_TYPE=(apex|compass|daisy|fuel|joid)
274 * INSTALLER_IP=<Specific IP Address>
275 * DEPLOY_SCENARIO=<vim>-<controller>-<nfv_feature>-<ha_mode>
278 INSTALLER_IP is required by Barometer in order to access the installer node and
281 The format for the DEPLOY_SCENARIO env variable can be described as follows:
282 * vim: (os|k8s) = OpenStack or Kubernetes
283 * controller is one of ( nosdn | odl )
284 * nfv_feature is one or more of ( ovs | kvm | sfc | bgpvpn | nofeature )
285 * ha_mode (high availability) is one of ( ha | noha )
287 If several features are pertinent then use the underscore character '_' to
288 separate each feature (e.g. ovs_kvm). 'nofeature' indicates that no OPNFV
291 The list of supported scenarios per release/installer is indicated in the
294 **NOTE:** The scenario name is mainly used to automatically detect
295 if a test suite is runnable or not (e.g. it will prevent ODL test suite to be
296 run on 'nosdn' scenarios). If not set, Functest will try to run the default
297 test cases that might not include SDN controller or a specific feature.
299 **NOTE:** An HA scenario means that 3 OpenStack controller nodes are
300 deployed. It does not necessarily mean that the whole system is HA. See
301 installer release notes for details.
303 Finally, three additional environment variables can also be passed in
304 to the Functest Docker Container, using the -e
305 "<EnvironmentVariable>=<Value>" mechanism. The first two parameters are
306 only relevant to Jenkins CI invoked testing and **should not be used**
307 when performing manual test scenarios:
309 * NODE_NAME = <Test POD Name>
310 * BUILD_TAG = <Jenkins Build Tag>
314 * <Test POD Name> = Symbolic name of the POD where the tests are run.
315 Visible in test results files, which are stored
316 to the database. This option is only used when
317 tests are activated under Jenkins CI control.
318 It indicates the POD/hardware where the test has
319 been run. If not specified, then the POD name is
320 defined as "Unknown" by default.
321 DO NOT USE THIS OPTION IN MANUAL TEST SCENARIOS.
322 * <Jenkins Build tag> = Symbolic name of the Jenkins Build Job.
323 Visible in test results files, which are stored
324 to the database. This option is only set when
325 tests are activated under Jenkins CI control.
326 It enables the correlation of test results,
327 which are independently pushed to the results database
328 from different Jenkins jobs.
329 DO NOT USE THIS OPTION IN MANUAL TEST SCENARIOS.
332 Openstack credentials
333 =====================
334 OpenStack credentials are mandatory and must be provided to Functest.
335 When running the command "functest env prepare", the framework will
336 automatically look for the Openstack credentials file
337 "/home/opnfv/functest/conf/env_file" and will exit with
338 error if it is not present or is empty.
340 There are 2 ways to provide that file:
342 * by using a Docker volume with -v option when creating the Docker container.
343 This is referred to in docker documentation as "Bind Mounting".
344 See the usage of this parameter in the following chapter.
345 * or creating manually the file '/home/opnfv/functest/conf/env_file'
346 inside the running container and pasting the credentials in it. Consult
347 your installer guide for further details. This is however not
348 instructed in this document.
350 In proxified environment you may need to change the credentials file.
351 There are some tips in chapter: `Proxy support`_
355 If you need to connect to a server that is TLS-enabled (the auth URL
356 begins with "https") and it uses a certificate from a private CA or a
357 self-signed certificate, then you will need to specify the path to an
358 appropriate CA certificate to use, to validate the server certificate
359 with the environment variable OS_CACERT::
362 /etc/ssl/certs/ca.crt
364 However, this certificate does not exist in the container by default.
365 It has to be copied manually from the OpenStack deployment. This can be
368 #. Create manually that file and copy the contents from the OpenStack
370 #. (Recommended) Add the file using a Docker volume when starting the
373 -v <path_to_your_cert_file>:/etc/ssl/certs/ca.cert
375 You might need to export OS_CACERT environment variable inside the
378 export OS_CACERT=/etc/ssl/certs/ca.crt
380 Certificate verification can be turned off using OS_INSECURE=true. For
381 example, Fuel uses self-signed cacerts by default, so an pre step would
384 export OS_INSECURE=true
389 By default all the logs are put un /home/opnfv/functest/results/functest.log.
390 If you want to have more logs in console, you may edit the logging.ini file
392 Connect on the docker then edit the file located in
393 /usr/lib/python2.7/site-packages/xtesting/ci/logging.ini
395 Change wconsole to console in the desired module to get more traces.
401 You may also directly modify the python code or the configuration file (e.g.
402 testcases.yaml used to declare test constraints) under
403 /usr/lib/python2.7/site-packages/xtesting and
404 /usr/lib/python2.7/site-packages/functest
412 When typing **exit** in the container prompt, this will cause exiting
413 the container and probably stopping it. When stopping a running Docker
414 container all the changes will be lost, there is a keyboard shortcut
415 to quit the container without stopping it: <CTRL>-P + <CTRL>-Q. To
416 reconnect to the running container **DO NOT** use the *run* command
417 again (since it will create a new container), use the *exec* or *attach*
420 docker ps # <check the container ID from the output>
421 docker exec -ti <CONTAINER_ID> /bin/bash
423 There are other useful Docker commands that might be needed to manage possible
424 issues with the containers.
426 List the running containers::
430 List all the containers including the stopped ones::
434 Start a stopped container named "FunTest"::
438 Attach to a running container named "StrikeTwo"::
440 docker attach StrikeTwo
442 It is useful sometimes to remove a container if there are some problems::
444 docker rm <CONTAINER_ID>
446 Use the *-f* option if the container is still running, it will force to
449 docker rm -f <CONTAINER_ID>
451 Check the Docker documentation [`dockerdocs`_] for more information.
454 Checking Openstack and credentials
455 ----------------------------------
456 It is recommended and fairly straightforward to check that Openstack
457 and credentials are working as expected.
459 Once the credentials are there inside the container, they should be
460 sourced before running any Openstack commands::
462 source /home/opnfv/functest/conf/env_file
464 After this, try to run any OpenStack command to see if you get any
465 output, for instance::
469 This will return a list of the actual users in the OpenStack
470 deployment. In any other case, check that the credentials are sourced::
474 This command must show a set of environment variables starting with
477 OS_REGION_NAME=RegionOne
478 OS_USER_DOMAIN_NAME=Default
479 OS_PROJECT_NAME=admin
481 OS_IDENTITY_API_VERSION=3
482 OS_PASSWORD=da54c27ae0d10dfae5297e6f0d6be54ebdb9f58d0f9dfc
483 OS_AUTH_URL=http://10.1.0.9:5000/v3
486 OS_ENDPOINT_TYPE=internalURL
487 OS_INTERFACE=internalURL
489 OS_PROJECT_DOMAIN_NAME=Default
492 If the OpenStack command still does not show anything or complains
493 about connectivity issues, it could be due to an incorrect url given to
494 the OS_AUTH_URL environment variable. Check the deployment settings.
500 If your Jumphost node is operating behind a http proxy, then there are
501 2 places where some special actions may be needed to make operations
504 #. Initial installation of docker engine First, try following the
505 official Docker documentation for Proxy settings. Some issues were
506 experienced on CentOS 7 based Jumphost. Some tips are documented
507 in section: :ref:`Docker Installation on CentOS behind http proxy`
510 If that is the case, make sure the resolv.conf and the needed
511 http_proxy and https_proxy environment variables, as well as the
512 'no_proxy' environment variable are set correctly::
514 # Make double sure that the 'no_proxy=...' line in the
515 # 'env_file' file is commented out first. Otherwise, the
516 # values set into the 'no_proxy' environment variable below will
517 # be ovewrwritten, each time the command
518 # 'source ~/functest/conf/env_file' is issued.
521 sed -i 's/export no_proxy/#export no_proxy/' env_file
524 # Next calculate some IP addresses for which http_proxy
525 # usage should be excluded:
527 publicURL_IP=$(echo $OS_AUTH_URL | grep -Eo "([0-9]+\.){3}[0-9]+")
529 adminURL_IP=$(openstack catalog show identity | \
530 grep adminURL | grep -Eo "([0-9]+\.){3}[0-9]+")
532 export http_proxy="<your http proxy settings>"
533 export https_proxy="<your https proxy settings>"
534 export no_proxy="127.0.0.1,localhost,$publicURL_IP,$adminURL_IP"
536 # Ensure that "git" uses the http_proxy
537 # This may be needed if your firewall forbids SSL based git fetch
538 git config --global http.sslVerify True
539 git config --global http.proxy <Your http proxy settings>
541 For example, try to use the **nc** command from inside the functest
545 Connection to opnfv.org 80 port [tcp/http] succeeded!
548 Connection to opnfv.org 443 port [tcp/https] succeeded!
550 Note: In a Jumphost node based on the CentOS family OS, the **nc**
551 commands might not work. You can use the **curl** command instead.
553 curl http://www.opnfv.org:80
555 <HTML><HEAD><meta http-equiv="content-type"
560 curl https://www.opnfv.org:443
562 <HTML><HEAD><meta http-equiv="content-type"
567 (Ignore the content. If command returns a valid HTML page, it proves
570 .. _`Docker Installation on CentOS behind http proxy`:
572 Docker Installation on CentOS behind http proxy
573 -----------------------------------------------
574 This section is applicable for CentOS family OS on Jumphost which
575 itself is behind a proxy server. In that case, the instructions below
576 should be followed **before** installing the docker engine::
578 1) # Make a directory '/etc/systemd/system/docker.service.d'
579 # if it does not exist
580 sudo mkdir /etc/systemd/system/docker.service.d
582 2) # Create a file called 'env.conf' in that directory with
583 # the following contents:
585 EnvironmentFile=-/etc/sysconfig/docker
587 3) # Set up a file called 'docker' in directory '/etc/sysconfig'
588 # with the following contents:
589 HTTP_PROXY="<Your http proxy settings>"
590 HTTPS_PROXY="<Your https proxy settings>"
591 http_proxy="${HTTP_PROXY}"
592 https_proxy="${HTTPS_PROXY}"
594 4) # Reload the daemon
595 systemctl daemon-reload
597 5) # Sanity check - check the following docker settings:
598 systemctl show docker | grep -i env
602 EnvironmentFile=/etc/sysconfig/docker (ignore_errors=yes)
603 DropInPaths=/etc/systemd/system/docker.service.d/env.conf
605 Now follow the instructions in [`Install Docker on CentOS`_] to download
606 and install the **docker-engine**. The instructions conclude with a
607 "test pull" of a sample "Hello World" docker container. This should now
608 work with the above pre-requisite actions.
611 .. _`[4]`: http://docs.opnfv.org/en/latest/submodules/functest/docs/testing/user/configguide/index.html
612 .. _`dockerdocs`: https://docs.docker.com/
613 .. _`Proxy`: https://docs.docker.com/engine/admin/systemd/#http-proxy
614 .. _`Install Docker on CentOS`: https://docs.docker.com/engine/installation/linux/centos/
615 .. _`Functest User Guide`: http://docs.opnfv.org/en/stable-danube/submodules/functest/docs/testing/user/userguide/index.html
616 .. _`images/CentOS-7-x86_64-GenericCloud.qcow2`: https://cloud.centos.org/centos/7/images/CentOS-7-x86_64-GenericCloud.qcow2
617 .. _`images/cirros-0.4.0-x86_64-disk.img`: http://download.cirros-cloud.net/0.4.0/cirros-0.4.0-x86_64-disk.img
618 .. _`images/ubuntu-14.04-server-cloudimg-amd64-disk1.img`: https://cloud-images.ubuntu.com/releases/14.04/release/ubuntu-14.04-server-cloudimg-amd64-disk1.img