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-benchmarking
20 * opnfv/functest-features
24 Preparing your environment
25 ^^^^^^^^^^^^^^^^^^^^^^^^^^
29 DEPLOY_SCENARIO=XXX # if not os-nosdn-nofeature-noha scenario
30 NAMESERVER=XXX # if not 8.8.8.8
31 EXTERNAL_NETWORK=XXX # if not first network with router:external=True
32 NEW_USER_ROLE=XXX # if not member
34 See section on environment variables for details.
38 export OS_AUTH_URL=XXX
39 export OS_USER_DOMAIN_NAME=XXX
40 export OS_PROJECT_DOMAIN_NAME=XXX
41 export OS_USERNAME=XXX
42 export OS_PROJECT_NAME=XXX
43 export OS_PASSWORD=XXX
44 export OS_IDENTITY_API_VERSION=3
46 See section on OpenStack credentials for details.
48 Create a directory for the different images (attached as a Docker volume)::
50 mkdir -p images && wget -q -O- https://git.opnfv.org/functest/plain/functest/ci/download_images.sh | bash -s -- images && ls -1 images/*
52 images/cirros-0.4.0-aarch64-disk.img
53 images/cirros-0.4.0-x86_64-disk.img
54 images/cloudify-docker-manager-community-19.01.24.tar
55 images/shaker-image-arm64.qcow2
56 images/shaker-image.qcow2
57 images/ubuntu-14.04-server-cloudimg-amd64-disk1.img
58 images/ubuntu-14.04-server-cloudimg-arm64-uefi1.img
59 images/ubuntu-16.04-server-cloudimg-amd64-disk1.img
60 images/vyos-1.1.8-amd64.qcow2
62 Testing healthcheck suite
63 ^^^^^^^^^^^^^^^^^^^^^^^^^
65 Run healthcheck suite::
67 sudo docker run --env-file env \
68 -v $(pwd)/openstack.creds:/home/opnfv/functest/conf/env_file \
69 -v $(pwd)/images:/home/opnfv/functest/images \
70 opnfv/functest-healthcheck
72 Results shall be displayed as follows::
74 +--------------------------+------------------+---------------------+------------------+----------------+
75 | TEST CASE | PROJECT | TIER | DURATION | RESULT |
76 +--------------------------+------------------+---------------------+------------------+----------------+
77 | connection_check | functest | healthcheck | 00:01 | PASS |
78 | tenantnetwork1 | functest | healthcheck | 00:06 | PASS |
79 | tenantnetwork2 | functest | healthcheck | 00:06 | PASS |
80 | vmready1 | functest | healthcheck | 00:08 | PASS |
81 | vmready2 | functest | healthcheck | 00:08 | PASS |
82 | singlevm1 | functest | healthcheck | 00:35 | PASS |
83 | singlevm2 | functest | healthcheck | 00:38 | PASS |
84 | vping_ssh | functest | healthcheck | 00:47 | PASS |
85 | vping_userdata | functest | healthcheck | 00:33 | PASS |
86 | cinder_test | functest | healthcheck | 01:16 | PASS |
87 | tempest_smoke | functest | healthcheck | 07:05 | PASS |
88 | odl | functest | healthcheck | 00:00 | SKIP |
89 +--------------------------+------------------+---------------------+------------------+----------------+
91 NOTE: the duration is a reference and it might vary depending on your SUT.
98 sudo docker run --env-file env \
99 -v $(pwd)/openstack.creds:/home/opnfv/functest/conf/env_file \
100 -v $(pwd)/images:/home/opnfv/functest/images \
103 Results shall be displayed as follows::
105 +------------------------------------+------------------+---------------+------------------+----------------+
106 | TEST CASE | PROJECT | TIER | DURATION | RESULT |
107 +------------------------------------+------------------+---------------+------------------+----------------+
108 | neutron-tempest-plugin-api | functest | smoke | 13:50 | PASS |
109 | rally_sanity | functest | smoke | 14:13 | PASS |
110 | refstack_defcore | functest | smoke | 09:60 | PASS |
111 | tempest_full | functest | smoke | 58:40 | PASS |
112 | tempest_scenario | functest | smoke | 09:47 | PASS |
113 | patrole | functest | smoke | 05:34 | PASS |
114 | neutron_trunk | functest | smoke | 00:00 | SKIP |
115 | networking-bgpvpn | functest | smoke | 01:43 | PASS |
116 | networking-sfc | functest | smoke | 04:49 | PASS |
117 | barbican | functest | smoke | 05:09 | PASS |
118 +------------------------------------+------------------+---------------+------------------+----------------+
120 Note: if the scenario does not support some tests, they are indicated as SKIP.
121 See User guide for details.
123 Testing benchmarking suite
124 ^^^^^^^^^^^^^^^^^^^^^^^^^^
126 Run benchmarking suite::
128 sudo docker run --env-file env \
129 -v $(pwd)/openstack.creds:/home/opnfv/functest/conf/env_file \
130 -v $(pwd)/images:/home/opnfv/functest/images \
131 opnfv/functest-benchmarking
133 Results shall be displayed as follows::
135 +--------------------+------------------+----------------------+------------------+----------------+
136 | TEST CASE | PROJECT | TIER | DURATION | RESULT |
137 +--------------------+------------------+----------------------+------------------+----------------+
138 | rally_full | functest | benchmarking | 121:55 | PASS |
139 | rally_jobs | functest | benchmarking | 24:21 | PASS |
140 | vmtp | functest | benchmarking | 00:00 | SKIP |
141 | shaker | functest | benchmarking | 00:00 | SKIP |
142 +--------------------+------------------+----------------------+------------------+----------------+
144 Note: if the scenario does not support some tests, they are indicated as SKIP.
145 See User guide for details.
147 Testing features suite
148 ^^^^^^^^^^^^^^^^^^^^^^
152 sudo docker run --env-file env \
153 -v $(pwd)/openstack.creds:/home/opnfv/functest/conf/env_file \
154 -v $(pwd)/images:/home/opnfv/functest/images \
155 opnfv/functest-features
157 Results shall be displayed as follows::
159 +-----------------------------+-------------------+------------------+------------------+----------------+
160 | TEST CASE | PROJECT | TIER | DURATION | RESULT |
161 +-----------------------------+-------------------+------------------+------------------+----------------+
162 | doctor-notification | doctor | features | 00:00 | SKIP |
163 | functest-odl-sfc | sfc | features | 00:00 | SKIP |
164 | barometercollectd | barometer | features | 00:00 | SKIP |
165 | vgpu | functest | features | 00:00 | SKIP |
166 | stor4nfv_os | stor4nfv | features | 00:00 | SKIP |
167 +-----------------------------+-------------------+------------------+------------------+----------------+
169 Note: if the scenario does not support some tests, they are indicated as SKIP.
170 See User guide for details.
177 sudo docker run --env-file env \
178 -v $(pwd)/openstack.creds:/home/opnfv/functest/conf/env_file \
179 -v $(pwd)/images:/home/opnfv/functest/images \
182 Results shall be displayed as follows::
184 +----------------------+------------------+--------------+------------------+----------------+
185 | TEST CASE | PROJECT | TIER | DURATION | RESULT |
186 +----------------------+------------------+--------------+------------------+----------------+
187 | cloudify | functest | vnf | 06:42 | PASS |
188 | cloudify_ims | functest | vnf | 39:21 | PASS |
189 | heat_ims | functest | vnf | 34:33 | PASS |
190 | vyos_vrouter | functest | vnf | 20:20 | PASS |
191 | juju_epc | functest | vnf | 56:55 | PASS |
192 +----------------------+------------------+--------------+------------------+----------------+
194 Functest Dockers for Kubernetes deployment
195 ------------------------------------------
196 Docker images are available on the dockerhub:
198 * opnfv/functest-kubernetes-core
199 * opnfv/functest-kubernetest-healthcheck
200 * opnfv/functest-kubernetest-smoke
201 * opnfv/functest-kubernetest-features
203 Preparing your environment
204 ^^^^^^^^^^^^^^^^^^^^^^^^^^
208 DEPLOY_SCENARIO=k8s-XXX
210 Testing healthcheck suite
211 ^^^^^^^^^^^^^^^^^^^^^^^^^
213 Run healthcheck suite::
215 sudo docker run -it --env-file env \
216 -v $(pwd)/config:/root/.kube/config \
217 opnfv/functest-kubernetes-healthcheck
219 A config file in the current dir 'config' is also required, which should be
220 volume mapped to ~/.kube/config inside kubernetes container.
222 Results shall be displayed as follows::
224 +-------------------+------------------+---------------------+------------------+----------------+
225 | TEST CASE | PROJECT | TIER | DURATION | RESULT |
226 +-------------------+------------------+---------------------+------------------+----------------+
227 | k8s_smoke | functest | healthcheck | 02:27 | PASS |
228 +-------------------+------------------+---------------------+------------------+----------------+
235 sudo docker run -it --env-file env \
236 -v $(pwd)/config:/root/.kube/config \
237 opnfv/functest-kubernetes-smoke
239 Results shall be displayed as follows::
241 +-------------------------+------------------+---------------+------------------+----------------+
242 | TEST CASE | PROJECT | TIER | DURATION | RESULT |
243 +-------------------------+------------------+---------------+------------------+----------------+
244 | k8s_conformance | functest | smoke | 57:14 | PASS |
245 +-------------------------+------------------+---------------+------------------+----------------+
247 Testing features suite
248 ^^^^^^^^^^^^^^^^^^^^^^
252 sudo docker run -it --env-file env \
253 -v $(pwd)/config:/root/.kube/config \
254 opnfv/functest-kubernetes-features
256 Results shall be displayed as follows::
258 +----------------------+------------------+------------------+------------------+----------------+
259 | TEST CASE | PROJECT | TIER | DURATION | RESULT |
260 +----------------------+------------------+------------------+------------------+----------------+
261 | stor4nfv_k8s | stor4nfv | stor4nfv | 00:00 | SKIP |
262 | clover_k8s | clover | clover | 00:00 | SKIP |
263 +----------------------+------------------+------------------+------------------+----------------+
265 Environment variables
266 =====================
268 Several environement variables may be specified:
270 * INSTALLER_IP=<Specific IP Address>
271 * DEPLOY_SCENARIO=<vim>-<controller>-<nfv_feature>-<ha_mode>
272 * NAMESERVER=XXX # if not 8.8.8.8
273 * VOLUME_DEVICE_NAME=XXX # if not vdb
274 * EXTERNAL_NETWORK=XXX # if not first network with router:external=True
275 * NEW_USER_ROLE=XXX # if not member
277 INSTALLER_IP is required by Barometer in order to access the installer node and
280 The format for the DEPLOY_SCENARIO env variable can be described as follows:
281 * vim: (os|k8s) = OpenStack or Kubernetes
282 * controller is one of ( nosdn | odl )
283 * nfv_feature is one or more of ( ovs | kvm | sfc | bgpvpn | nofeature )
284 * ha_mode (high availability) is one of ( ha | noha )
286 If several features are pertinent then use the underscore character '_' to
287 separate each feature (e.g. ovs_kvm). 'nofeature' indicates that no OPNFV
290 The list of supported scenarios per release/installer is indicated in the
293 **NOTE:** The scenario name is mainly used to automatically detect
294 if a test suite is runnable or not (e.g. it will prevent ODL test suite to be
295 run on 'nosdn' scenarios). If not set, Functest will try to run the default
296 test cases that might not include SDN controller or a specific feature.
298 **NOTE:** An HA scenario means that 3 OpenStack controller nodes are
299 deployed. It does not necessarily mean that the whole system is HA. See
300 installer release notes for details.
302 Finally, three additional environment variables can also be passed in
303 to the Functest Docker Container, using the -e
304 "<EnvironmentVariable>=<Value>" mechanism. The first two parameters are
305 only relevant to Jenkins CI invoked testing and **should not be used**
306 when performing manual test scenarios:
308 * INSTALLER_TYPE=(apex|compass|daisy|fuel)
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 .. _`dockerdocs`: https://docs.docker.com/
612 .. _`Proxy`: https://docs.docker.com/engine/admin/systemd/#http-proxy
613 .. _`Install Docker on CentOS`: https://docs.docker.com/engine/installation/linux/centos/
614 .. _`Functest User Guide`: http://docs.opnfv.org/en/stable-danube/submodules/functest/docs/testing/user/userguide/index.html
615 .. _`images/CentOS-7-x86_64-GenericCloud.qcow2`: https://cloud.centos.org/centos/7/images/CentOS-7-x86_64-GenericCloud.qcow2
616 .. _`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
617 .. _`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