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_compute | functest | smoke | 07:24 | PASS |
111 | refstack_object | functest | smoke | 02:08 | PASS |
112 | refstack_platform | functest | smoke | 08:32 | PASS |
113 | tempest_full | functest | smoke | 58:40 | PASS |
114 | tempest_scenario | functest | smoke | 09:47 | PASS |
115 | patrole | functest | smoke | 05:34 | PASS |
116 | neutron_trunk | functest | smoke | 00:00 | SKIP |
117 | networking-bgpvpn | functest | smoke | 01:43 | PASS |
118 | networking-sfc | functest | smoke | 04:49 | PASS |
119 | barbican | functest | smoke | 05:09 | PASS |
120 +------------------------------------+------------------+---------------+------------------+----------------+
122 Note: if the scenario does not support some tests, they are indicated as SKIP.
123 See User guide for details.
125 Testing benchmarking suite
126 ^^^^^^^^^^^^^^^^^^^^^^^^^^
128 Run benchmarking suite::
130 sudo docker run --env-file env \
131 -v $(pwd)/openstack.creds:/home/opnfv/functest/conf/env_file \
132 -v $(pwd)/images:/home/opnfv/functest/images \
133 opnfv/functest-benchmarking
135 Results shall be displayed as follows::
137 +--------------------+------------------+----------------------+------------------+----------------+
138 | TEST CASE | PROJECT | TIER | DURATION | RESULT |
139 +--------------------+------------------+----------------------+------------------+----------------+
140 | rally_full | functest | benchmarking | 121:55 | PASS |
141 | rally_jobs | functest | benchmarking | 24:21 | PASS |
142 | vmtp | functest | benchmarking | 00:00 | SKIP |
143 | shaker | functest | benchmarking | 00:00 | SKIP |
144 +--------------------+------------------+----------------------+------------------+----------------+
146 Note: if the scenario does not support some tests, they are indicated as SKIP.
147 See User guide for details.
149 Testing features suite
150 ^^^^^^^^^^^^^^^^^^^^^^
154 sudo docker run --env-file env \
155 -v $(pwd)/openstack.creds:/home/opnfv/functest/conf/env_file \
156 -v $(pwd)/images:/home/opnfv/functest/images \
157 opnfv/functest-features
159 Results shall be displayed as follows::
161 +-----------------------------+-------------------+------------------+------------------+----------------+
162 | TEST CASE | PROJECT | TIER | DURATION | RESULT |
163 +-----------------------------+-------------------+------------------+------------------+----------------+
164 | doctor-notification | doctor | features | 00:00 | SKIP |
165 | functest-odl-sfc | sfc | features | 00:00 | SKIP |
166 | barometercollectd | barometer | features | 00:00 | SKIP |
167 | vgpu | functest | features | 00:00 | SKIP |
168 | stor4nfv_os | stor4nfv | features | 00:00 | SKIP |
169 +-----------------------------+-------------------+------------------+------------------+----------------+
171 Note: if the scenario does not support some tests, they are indicated as SKIP.
172 See User guide for details.
179 sudo docker run --env-file env \
180 -v $(pwd)/openstack.creds:/home/opnfv/functest/conf/env_file \
181 -v $(pwd)/images:/home/opnfv/functest/images \
184 Results shall be displayed as follows::
186 +----------------------+------------------+--------------+------------------+----------------+
187 | TEST CASE | PROJECT | TIER | DURATION | RESULT |
188 +----------------------+------------------+--------------+------------------+----------------+
189 | cloudify | functest | vnf | 06:42 | PASS |
190 | cloudify_ims | functest | vnf | 39:21 | PASS |
191 | heat_ims | functest | vnf | 34:33 | PASS |
192 | vyos_vrouter | functest | vnf | 20:20 | PASS |
193 | juju_epc | functest | vnf | 56:55 | PASS |
194 +----------------------+------------------+--------------+------------------+----------------+
196 Functest Dockers for Kubernetes deployment
197 ------------------------------------------
198 Docker images are available on the dockerhub:
200 * opnfv/functest-kubernetes-core
201 * opnfv/functest-kubernetest-healthcheck
202 * opnfv/functest-kubernetest-smoke
203 * opnfv/functest-kubernetest-features
205 Preparing your environment
206 ^^^^^^^^^^^^^^^^^^^^^^^^^^
210 DEPLOY_SCENARIO=k8s-XXX
212 Testing healthcheck suite
213 ^^^^^^^^^^^^^^^^^^^^^^^^^
215 Run healthcheck suite::
217 sudo docker run -it --env-file env \
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 | 02:27 | PASS |
230 +-------------------+------------------+---------------------+------------------+----------------+
237 sudo docker run -it --env-file env \
238 -v $(pwd)/config:/root/.kube/config \
239 opnfv/functest-kubernetes-smoke
241 Results shall be displayed as follows::
243 +-------------------------+------------------+---------------+------------------+----------------+
244 | TEST CASE | PROJECT | TIER | DURATION | RESULT |
245 +-------------------------+------------------+---------------+------------------+----------------+
246 | k8s_conformance | functest | smoke | 57:14 | PASS |
247 +-------------------------+------------------+---------------+------------------+----------------+
249 Testing features suite
250 ^^^^^^^^^^^^^^^^^^^^^^
254 sudo docker run -it --env-file env \
255 -v $(pwd)/config:/root/.kube/config \
256 opnfv/functest-kubernetes-features
258 Results shall be displayed as follows::
260 +----------------------+------------------+------------------+------------------+----------------+
261 | TEST CASE | PROJECT | TIER | DURATION | RESULT |
262 +----------------------+------------------+------------------+------------------+----------------+
263 | stor4nfv_k8s | stor4nfv | stor4nfv | 00:00 | SKIP |
264 | clover_k8s | clover | clover | 00:00 | SKIP |
265 +----------------------+------------------+------------------+------------------+----------------+
267 Environment variables
268 =====================
270 Several environement variables may be specified:
272 * INSTALLER_IP=<Specific IP Address>
273 * DEPLOY_SCENARIO=<vim>-<controller>-<nfv_feature>-<ha_mode>
274 * NAMESERVER=XXX # if not 8.8.8.8
275 * VOLUME_DEVICE_NAME=XXX # if not vdb
276 * EXTERNAL_NETWORK=XXX # if not first network with router:external=True
277 * NEW_USER_ROLE=XXX # if not member
279 INSTALLER_IP is required by Barometer in order to access the installer node and
282 The format for the DEPLOY_SCENARIO env variable can be described as follows:
283 * vim: (os|k8s) = OpenStack or Kubernetes
284 * controller is one of ( nosdn | odl )
285 * nfv_feature is one or more of ( ovs | kvm | sfc | bgpvpn | nofeature )
286 * ha_mode (high availability) is one of ( ha | noha )
288 If several features are pertinent then use the underscore character '_' to
289 separate each feature (e.g. ovs_kvm). 'nofeature' indicates that no OPNFV
292 The list of supported scenarios per release/installer is indicated in the
295 **NOTE:** The scenario name is mainly used to automatically detect
296 if a test suite is runnable or not (e.g. it will prevent ODL test suite to be
297 run on 'nosdn' scenarios). If not set, Functest will try to run the default
298 test cases that might not include SDN controller or a specific feature.
300 **NOTE:** An HA scenario means that 3 OpenStack controller nodes are
301 deployed. It does not necessarily mean that the whole system is HA. See
302 installer release notes for details.
304 Finally, three additional environment variables can also be passed in
305 to the Functest Docker Container, using the -e
306 "<EnvironmentVariable>=<Value>" mechanism. The first two parameters are
307 only relevant to Jenkins CI invoked testing and **should not be used**
308 when performing manual test scenarios:
310 * INSTALLER_TYPE=(apex|compass|daisy|fuel)
311 * NODE_NAME=<Test POD Name>
312 * BUILD_TAG=<Jenkins Build Tag>
316 * <Test POD Name> = Symbolic name of the POD where the tests are run.
317 Visible in test results files, which are stored
318 to the database. This option is only used when
319 tests are activated under Jenkins CI control.
320 It indicates the POD/hardware where the test has
321 been run. If not specified, then the POD name is
322 defined as "Unknown" by default.
323 DO NOT USE THIS OPTION IN MANUAL TEST SCENARIOS.
324 * <Jenkins Build tag> = Symbolic name of the Jenkins Build Job.
325 Visible in test results files, which are stored
326 to the database. This option is only set when
327 tests are activated under Jenkins CI control.
328 It enables the correlation of test results,
329 which are independently pushed to the results database
330 from different Jenkins jobs.
331 DO NOT USE THIS OPTION IN MANUAL TEST SCENARIOS.
334 Openstack credentials
335 =====================
336 OpenStack credentials are mandatory and must be provided to Functest.
337 When running the command "functest env prepare", the framework will
338 automatically look for the Openstack credentials file
339 "/home/opnfv/functest/conf/env_file" and will exit with
340 error if it is not present or is empty.
342 There are 2 ways to provide that file:
344 * by using a Docker volume with -v option when creating the Docker container.
345 This is referred to in docker documentation as "Bind Mounting".
346 See the usage of this parameter in the following chapter.
347 * or creating manually the file '/home/opnfv/functest/conf/env_file'
348 inside the running container and pasting the credentials in it. Consult
349 your installer guide for further details. This is however not
350 instructed in this document.
352 In proxified environment you may need to change the credentials file.
353 There are some tips in chapter: `Proxy support`_
357 If you need to connect to a server that is TLS-enabled (the auth URL
358 begins with "https") and it uses a certificate from a private CA or a
359 self-signed certificate, then you will need to specify the path to an
360 appropriate CA certificate to use, to validate the server certificate
361 with the environment variable OS_CACERT::
364 /etc/ssl/certs/ca.crt
366 However, this certificate does not exist in the container by default.
367 It has to be copied manually from the OpenStack deployment. This can be
370 #. Create manually that file and copy the contents from the OpenStack
372 #. (Recommended) Add the file using a Docker volume when starting the
375 -v <path_to_your_cert_file>:/etc/ssl/certs/ca.cert
377 You might need to export OS_CACERT environment variable inside the
380 export OS_CACERT=/etc/ssl/certs/ca.crt
382 Certificate verification can be turned off using OS_INSECURE=true. For
383 example, Fuel uses self-signed cacerts by default, so an pre step would
386 export OS_INSECURE=true
391 By default all the logs are put un /home/opnfv/functest/results/functest.log.
392 If you want to have more logs in console, you may edit the logging.ini file
394 Connect on the docker then edit the file located in
395 /usr/lib/python3.6/site-packages/xtesting/ci/logging.ini
397 Change wconsole to console in the desired module to get more traces.
403 You may also directly modify the python code or the configuration file (e.g.
404 testcases.yaml used to declare test constraints) under
405 /usr/lib/python3.6/site-packages/xtesting and
406 /usr/lib/python3.6/site-packages/functest
414 When typing **exit** in the container prompt, this will cause exiting
415 the container and probably stopping it. When stopping a running Docker
416 container all the changes will be lost, there is a keyboard shortcut
417 to quit the container without stopping it: <CTRL>-P + <CTRL>-Q. To
418 reconnect to the running container **DO NOT** use the *run* command
419 again (since it will create a new container), use the *exec* or *attach*
422 docker ps # <check the container ID from the output>
423 docker exec -ti <CONTAINER_ID> /bin/bash
425 There are other useful Docker commands that might be needed to manage possible
426 issues with the containers.
428 List the running containers::
432 List all the containers including the stopped ones::
436 Start a stopped container named "FunTest"::
440 Attach to a running container named "StrikeTwo"::
442 docker attach StrikeTwo
444 It is useful sometimes to remove a container if there are some problems::
446 docker rm <CONTAINER_ID>
448 Use the *-f* option if the container is still running, it will force to
451 docker rm -f <CONTAINER_ID>
453 Check the Docker documentation [`dockerdocs`_] for more information.
456 Checking Openstack and credentials
457 ----------------------------------
458 It is recommended and fairly straightforward to check that Openstack
459 and credentials are working as expected.
461 Once the credentials are there inside the container, they should be
462 sourced before running any Openstack commands::
464 source /home/opnfv/functest/conf/env_file
466 After this, try to run any OpenStack command to see if you get any
467 output, for instance::
471 This will return a list of the actual users in the OpenStack
472 deployment. In any other case, check that the credentials are sourced::
476 This command must show a set of environment variables starting with
479 OS_REGION_NAME=RegionOne
480 OS_USER_DOMAIN_NAME=Default
481 OS_PROJECT_NAME=admin
483 OS_IDENTITY_API_VERSION=3
484 OS_PASSWORD=da54c27ae0d10dfae5297e6f0d6be54ebdb9f58d0f9dfc
485 OS_AUTH_URL=http://10.1.0.9:5000/v3
488 OS_ENDPOINT_TYPE=internalURL
489 OS_INTERFACE=internalURL
491 OS_PROJECT_DOMAIN_NAME=Default
494 If the OpenStack command still does not show anything or complains
495 about connectivity issues, it could be due to an incorrect url given to
496 the OS_AUTH_URL environment variable. Check the deployment settings.
502 If your Jumphost node is operating behind a http proxy, then there are
503 2 places where some special actions may be needed to make operations
506 #. Initial installation of docker engine First, try following the
507 official Docker documentation for Proxy settings. Some issues were
508 experienced on CentOS 7 based Jumphost. Some tips are documented
509 in section: :ref:`Docker Installation on CentOS behind http proxy`
512 If that is the case, make sure the resolv.conf and the needed
513 http_proxy and https_proxy environment variables, as well as the
514 'no_proxy' environment variable are set correctly::
516 # Make double sure that the 'no_proxy=...' line in the
517 # 'env_file' file is commented out first. Otherwise, the
518 # values set into the 'no_proxy' environment variable below will
519 # be ovewrwritten, each time the command
520 # 'source ~/functest/conf/env_file' is issued.
523 sed -i 's/export no_proxy/#export no_proxy/' env_file
526 # Next calculate some IP addresses for which http_proxy
527 # usage should be excluded:
529 publicURL_IP=$(echo $OS_AUTH_URL | grep -Eo "([0-9]+\.){3}[0-9]+")
531 adminURL_IP=$(openstack catalog show identity | \
532 grep adminURL | grep -Eo "([0-9]+\.){3}[0-9]+")
534 export http_proxy="<your http proxy settings>"
535 export https_proxy="<your https proxy settings>"
536 export no_proxy="127.0.0.1,localhost,$publicURL_IP,$adminURL_IP"
538 # Ensure that "git" uses the http_proxy
539 # This may be needed if your firewall forbids SSL based git fetch
540 git config --global http.sslVerify True
541 git config --global http.proxy <Your http proxy settings>
543 For example, try to use the **nc** command from inside the functest
547 Connection to opnfv.org 80 port [tcp/http] succeeded!
550 Connection to opnfv.org 443 port [tcp/https] succeeded!
552 Note: In a Jumphost node based on the CentOS family OS, the **nc**
553 commands might not work. You can use the **curl** command instead.
555 curl https://www.opnfv.org/
557 <HTML><HEAD><meta http-equiv="content-type"
562 curl https://www.opnfv.org:443
564 <HTML><HEAD><meta http-equiv="content-type"
569 (Ignore the content. If command returns a valid HTML page, it proves
572 .. _`Docker Installation on CentOS behind http proxy`:
574 Docker Installation on CentOS behind http proxy
575 -----------------------------------------------
576 This section is applicable for CentOS family OS on Jumphost which
577 itself is behind a proxy server. In that case, the instructions below
578 should be followed **before** installing the docker engine::
580 1) # Make a directory '/etc/systemd/system/docker.service.d'
581 # if it does not exist
582 sudo mkdir /etc/systemd/system/docker.service.d
584 2) # Create a file called 'env.conf' in that directory with
585 # the following contents:
587 EnvironmentFile=-/etc/sysconfig/docker
589 3) # Set up a file called 'docker' in directory '/etc/sysconfig'
590 # with the following contents:
591 HTTP_PROXY="<Your http proxy settings>"
592 HTTPS_PROXY="<Your https proxy settings>"
593 http_proxy="${HTTP_PROXY}"
594 https_proxy="${HTTPS_PROXY}"
596 4) # Reload the daemon
597 systemctl daemon-reload
599 5) # Sanity check - check the following docker settings:
600 systemctl show docker | grep -i env
604 EnvironmentFile=/etc/sysconfig/docker (ignore_errors=yes)
605 DropInPaths=/etc/systemd/system/docker.service.d/env.conf
607 Now follow the instructions in [`Install Docker on CentOS`_] to download
608 and install the **docker-engine**. The instructions conclude with a
609 "test pull" of a sample "Hello World" docker container. This should now
610 work with the above pre-requisite actions.
613 .. _`dockerdocs`: https://docs.docker.com/
614 .. _`Proxy`: https://docs.docker.com/engine/admin/systemd/#http-proxy
615 .. _`Install Docker on CentOS`: https://docs.docker.com/engine/installation/linux/centos/
616 .. _`Functest User Guide`: http://docs.opnfv.org/en/stable-danube/submodules/functest/docs/testing/user/userguide/index.html
617 .. _`images/CentOS-7-x86_64-GenericCloud.qcow2`: https://cloud.centos.org/centos/7/images/CentOS-7-x86_64-GenericCloud.qcow2
618 .. _`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
619 .. _`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