Update K8s test case results in doc
[functest.git] / docs / testing / user / configguide / configguide.rst
1 .. SPDX-License-Identifier: CC-BY-4.0
2
3 Installation and configuration
4 ==============================
5
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.
10
11
12 Functest Dockers for OpenStack deployment
13 -----------------------------------------
14 Docker images are available on the dockerhub:
15
16   * opnfv/functest-healthcheck
17   * opnfv/functest-smoke
18   * opnfv/functest-smoke-cntt
19   * opnfv/functest-benchmarking
20   * opnfv/functest-benchmarking-cntt
21   * opnfv/functest-vnf
22
23
24 Preparing your environment
25 ^^^^^^^^^^^^^^^^^^^^^^^^^^
26
27 cat env::
28
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   DASHBOARD_URL=XXX  # else tempest_horizon will be skipped
33   NEW_USER_ROLE=XXX # if not member
34   SDN_CONTROLLER_IP=XXX  # if odl scenario
35   VOLUME_DEVICE_NAME=XXX  # if not vdb
36   FLAVOR_EXTRA_SPECS=hw:mem_page_size:large    # if fdio scenarios
37
38 See section on environment variables for details.
39
40 cat env_file::
41
42   export OS_AUTH_URL=XXX
43   export OS_USER_DOMAIN_NAME=XXX
44   export OS_PROJECT_DOMAIN_NAME=XXX
45   export OS_USERNAME=XXX
46   export OS_PROJECT_NAME=XXX
47   export OS_PASSWORD=XXX
48   export OS_IDENTITY_API_VERSION=3
49   export OS_REGION_NAME=XXX
50
51 See section on OpenStack credentials for details.
52
53 Create a directory for the different images (attached as a Docker volume)::
54
55   mkdir -p images && wget -q -O- https://git.opnfv.org/functest/plain/functest/ci/download_images.sh | bash -s -- images && ls -1 images/*
56
57   images/cirros-0.5.1-aarch64-disk.img
58   images/cirros-0.5.1-x86_64-disk.img
59   images/cloudify-docker-manager-community-19.01.24.tar
60   images/Fedora-Cloud-Base-30-1.2.x86_64.qcow2
61   images/shaker-image-1.3.0+stretch.qcow2
62   images/ubuntu-14.04-server-cloudimg-amd64-disk1.img
63   images/ubuntu-14.04-server-cloudimg-arm64-uefi1.img
64   images/ubuntu-16.04-server-cloudimg-amd64-disk1.img
65   images/vyos-1.1.8-amd64.qcow2
66
67 Testing healthcheck suite
68 ^^^^^^^^^^^^^^^^^^^^^^^^^
69
70 Run healthcheck suite::
71
72   sudo docker run --env-file env \
73       -v $(pwd)/openstack.creds:/home/opnfv/functest/conf/env_file \
74       -v $(pwd)/images:/home/opnfv/functest/images \
75       opnfv/functest-healthcheck
76
77 Results shall be displayed as follows::
78
79   +--------------------------+------------------+---------------------+------------------+----------------+
80   |        TEST CASE         |     PROJECT      |         TIER        |     DURATION     |     RESULT     |
81   +--------------------------+------------------+---------------------+------------------+----------------+
82   |     connection_check     |     functest     |     healthcheck     |      00:03       |      PASS      |
83   |      tenantnetwork1      |     functest     |     healthcheck     |      00:05       |      PASS      |
84   |      tenantnetwork2      |     functest     |     healthcheck     |      00:06       |      PASS      |
85   |         vmready1         |     functest     |     healthcheck     |      00:06       |      PASS      |
86   |         vmready2         |     functest     |     healthcheck     |      00:08       |      PASS      |
87   |        singlevm1         |     functest     |     healthcheck     |      00:32       |      PASS      |
88   |        singlevm2         |     functest     |     healthcheck     |      00:37       |      PASS      |
89   |        vping_ssh         |     functest     |     healthcheck     |      00:46       |      PASS      |
90   |      vping_userdata      |     functest     |     healthcheck     |      00:39       |      PASS      |
91   |       cinder_test        |     functest     |     healthcheck     |      01:05       |      PASS      |
92   |      tempest_smoke       |     functest     |     healthcheck     |      05:39       |      PASS      |
93   |     tempest_horizon      |     functest     |     healthcheck     |      01:05       |      PASS      |
94   |           odl            |     functest     |     healthcheck     |      00:00       |      SKIP      |
95   +--------------------------+------------------+---------------------+------------------+----------------+
96
97 NOTE: the duration is a reference and it might vary depending on your SUT.
98
99 Testing smoke suite
100 ^^^^^^^^^^^^^^^^^^^
101
102 Run smoke suite::
103
104   sudo docker run --env-file env \
105       -v $(pwd)/openstack.creds:/home/opnfv/functest/conf/env_file \
106       -v $(pwd)/images:/home/opnfv/functest/images \
107       opnfv/functest-smoke
108
109 Results shall be displayed as follows::
110
111   +---------------------------+------------------+---------------+------------------+----------------+
112   |         TEST CASE         |     PROJECT      |      TIER     |     DURATION     |     RESULT     |
113   +---------------------------+------------------+---------------+------------------+----------------+
114   |      tempest_neutron      |     functest     |     smoke     |      15:30       |      PASS      |
115   |       tempest_cinder      |     functest     |     smoke     |      02:01       |      PASS      |
116   |      tempest_keystone     |     functest     |     smoke     |      01:17       |      PASS      |
117   |        tempest_heat       |     functest     |     smoke     |      22:14       |      PASS      |
118   |     tempest_telemetry     |     functest     |     smoke     |      00:00       |      SKIP      |
119   |        rally_sanity       |     functest     |     smoke     |      17:24       |      PASS      |
120   |      refstack_compute     |     functest     |     smoke     |      07:03       |      PASS      |
121   |      refstack_object      |     functest     |     smoke     |      02:09       |      PASS      |
122   |     refstack_platform     |     functest     |     smoke     |      07:31       |      PASS      |
123   |        tempest_full       |     functest     |     smoke     |      41:52       |      PASS      |
124   |      tempest_scenario     |     functest     |     smoke     |      08:42       |      PASS      |
125   |        tempest_slow       |     functest     |     smoke     |      43:42       |      PASS      |
126   |          patrole          |     functest     |     smoke     |      02:42       |      PASS      |
127   |      tempest_barbican     |     functest     |     smoke     |      02:30       |      PASS      |
128   |      tempest_octavia      |     functest     |     smoke     |      00:00       |      SKIP      |
129   +---------------------------+------------------+---------------+------------------+----------------+
130
131 Note: if the scenario does not support some tests, they are indicated as SKIP.
132 See User guide for details.
133
134 Testing smoke CNTT suite
135 ^^^^^^^^^^^^^^^^^^^^^^^^
136
137 Run smoke-cntt suite::
138
139   sudo docker run --env-file env \
140       -v $(pwd)/openstack.creds:/home/opnfv/functest/conf/env_file \
141       -v $(pwd)/images:/home/opnfv/functest/images \
142       opnfv/functest-smoke-cntt
143
144 Results shall be displayed as follows::
145
146   +-------------------------------+------------------+---------------+------------------+----------------+
147   |           TEST CASE           |     PROJECT      |      TIER     |     DURATION     |     RESULT     |
148   +-------------------------------+------------------+---------------+------------------+----------------+
149   |      tempest_neutron_cntt     |     functest     |     smoke     |      11:35       |      PASS      |
150   |      tempest_cinder_cntt      |     functest     |     smoke     |      01:58       |      PASS      |
151   |     tempest_keystone_cntt     |     functest     |     smoke     |      01:13       |      PASS      |
152   |       tempest_heat_cntt       |     functest     |     smoke     |      22:32       |      PASS      |
153   |       rally_sanity_cntt       |     functest     |     smoke     |      17:16       |      PASS      |
154   |       tempest_full_cntt       |     functest     |     smoke     |      41:13       |      PASS      |
155   |     tempest_scenario_cntt     |     functest     |     smoke     |      08:57       |      PASS      |
156   |       tempest_slow_cntt       |     functest     |     smoke     |      35:58       |      PASS      |
157   +-------------------------------+------------------+---------------+------------------+----------------+
158
159 Testing benchmarking suite
160 ^^^^^^^^^^^^^^^^^^^^^^^^^^
161
162 Run benchmarking suite::
163
164   sudo docker run --env-file env \
165       -v $(pwd)/openstack.creds:/home/opnfv/functest/conf/env_file \
166       -v $(pwd)/images:/home/opnfv/functest/images \
167       opnfv/functest-benchmarking
168
169 Results shall be displayed as follows::
170
171   +--------------------+------------------+----------------------+------------------+----------------+
172   |     TEST CASE      |     PROJECT      |         TIER         |     DURATION     |     RESULT     |
173   +--------------------+------------------+----------------------+------------------+----------------+
174   |     rally_full     |     functest     |     benchmarking     |      93:03       |      PASS      |
175   |     rally_jobs     |     functest     |     benchmarking     |      27:05       |      PASS      |
176   |        vmtp        |     functest     |     benchmarking     |      17:56       |      PASS      |
177   |       shaker       |     functest     |     benchmarking     |      24:02       |      PASS      |
178   +--------------------+------------------+----------------------+------------------+----------------+
179
180 Note: if the scenario does not support some tests, they are indicated as SKIP.
181 See User guide for details.
182
183 Testing benchmarking CNTT suite
184 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
185
186 Run benchmarking-cntt suite::
187
188   sudo docker run --env-file env \
189       -v $(pwd)/openstack.creds:/home/opnfv/functest/conf/env_file \
190       -v $(pwd)/images:/home/opnfv/functest/images \
191       opnfv/functest-benchmarking-cntt
192
193 Results shall be displayed as follows::
194
195   +-------------------------+------------------+----------------------+------------------+----------------+
196   |        TEST CASE        |     PROJECT      |         TIER         |     DURATION     |     RESULT     |
197   +-------------------------+------------------+----------------------+------------------+----------------+
198   |     rally_full_cntt     |     functest     |     benchmarking     |      89:52       |      PASS      |
199   |     rally_jobs_cntt     |     functest     |     benchmarking     |      19:39       |      PASS      |
200   |           vmtp          |     functest     |     benchmarking     |      16:59       |      PASS      |
201   |          shaker         |     functest     |     benchmarking     |      23:43       |      PASS      |
202   +-------------------------+------------------+----------------------+------------------+----------------+
203
204 Testing vnf suite
205 ^^^^^^^^^^^^^^^^^
206
207 Run vnf suite::
208
209   sudo docker run --env-file env \
210       -v $(pwd)/openstack.creds:/home/opnfv/functest/conf/env_file \
211       -v $(pwd)/images:/home/opnfv/functest/images \
212       opnfv/functest-vnf
213
214 Results shall be displayed as follows::
215
216   +----------------------+------------------+--------------+------------------+----------------+
217   |      TEST CASE       |     PROJECT      |     TIER     |     DURATION     |     RESULT     |
218   +----------------------+------------------+--------------+------------------+----------------+
219   |       cloudify       |     functest     |     vnf      |      05:08       |      PASS      |
220   |     cloudify_ims     |     functest     |     vnf      |      24:46       |      PASS      |
221   |       heat_ims       |     functest     |     vnf      |      33:12       |      PASS      |
222   |     vyos_vrouter     |     functest     |     vnf      |      15:53       |      PASS      |
223   |       juju_epc       |     functest     |     vnf      |      27:52       |      PASS      |
224   +----------------------+------------------+--------------+------------------+----------------+
225
226 Functest Dockers for Kubernetes deployment
227 ------------------------------------------
228 Docker images are available on the dockerhub:
229
230   * opnfv/functest-kubernetes-healthcheck
231   * opnfv/functest-kubernetes-smoke
232   * opnfv/functest-kubernetes-security
233   * opnfv/functest-kubernetes-benchmarking
234   * opnfv/functest-kubernetes-cnf
235
236 Preparing your environment
237 ^^^^^^^^^^^^^^^^^^^^^^^^^^
238
239 cat env::
240
241   DEPLOY_SCENARIO=k8s-XXX
242
243 Testing healthcheck suite
244 ^^^^^^^^^^^^^^^^^^^^^^^^^
245
246 Run healthcheck suite::
247
248   sudo docker run -it --env-file env \
249       -v $(pwd)/config:/root/.kube/config \
250       opnfv/functest-kubernetes-healthcheck
251
252 A config file in the current dir 'config' is also required, which should be
253 volume mapped to ~/.kube/config inside kubernetes container.
254
255 Results shall be displayed as follows::
256
257   +-------------------+------------------+---------------------+------------------+----------------+
258   |     TEST CASE     |     PROJECT      |         TIER        |     DURATION     |     RESULT     |
259   +-------------------+------------------+---------------------+------------------+----------------+
260   |     k8s_smoke     |     functest     |     healthcheck     |      01:09       |      PASS      |
261   +-------------------+------------------+---------------------+------------------+----------------+
262
263 Testing smoke suite
264 ^^^^^^^^^^^^^^^^^^^
265
266 Run smoke suite::
267
268   sudo docker run -it --env-file env \
269       -v $(pwd)/config:/root/.kube/config \
270       opnfv/functest-kubernetes-smoke
271
272 Results shall be displayed as follows::
273
274   +---------------------------+------------------+---------------+------------------+----------------+
275   |         TEST CASE         |     PROJECT      |      TIER     |     DURATION     |     RESULT     |
276   +---------------------------+------------------+---------------+------------------+----------------+
277   |      k8s_conformance      |     functest     |     smoke     |      94:26       |      PASS      |
278   |     xrally_kubernetes     |     functest     |     smoke     |      13:05       |      PASS      |
279   +---------------------------+------------------+---------------+------------------+----------------+
280
281 Testing security suite
282 ^^^^^^^^^^^^^^^^^^^^^^
283
284 Run smoke suite::
285
286   sudo docker run -it --env-file env \
287       -v $(pwd)/config:/root/.kube/config \
288       opnfv/functest-kubernetes-security
289
290 Results shall be displayed as follows::
291
292   +---------------------+------------------+------------------+------------------+----------------+
293   |      TEST CASE      |     PROJECT      |       TIER       |     DURATION     |     RESULT     |
294   +---------------------+------------------+------------------+------------------+----------------+
295   |     kube_hunter     |     functest     |     security     |      00:24       |      PASS      |
296   |      kube_bench     |     functest     |     security     |      00:18       |      PASS      |
297   +---------------------+------------------+------------------+------------------+----------------+
298
299 Testing benchmarking suite
300 ^^^^^^^^^^^^^^^^^^^^^^^^^^
301
302 Run benchmarking suite::
303
304   sudo docker run -it --env-file env \
305       -v $(pwd)/config:/root/.kube/config \
306       opnfv/functest-kubernetes-benchmarking
307
308 Results shall be displayed as follows::
309
310   +--------------------------------+------------------+----------------------+------------------+----------------+
311   |           TEST CASE            |     PROJECT      |         TIER         |     DURATION     |     RESULT     |
312   +--------------------------------+------------------+----------------------+------------------+----------------+
313   |     xrally_kubernetes_full     |     functest     |     benchmarking     |      34:16       |      PASS      |
314   +--------------------------------+------------------+----------------------+------------------+----------------+
315
316 Testing cnf suite
317 ^^^^^^^^^^^^^^^^^
318
319 Run cnf suite::
320
321   sudo docker run -it --env-file env \
322       -v $(pwd)/config:/root/.kube/config \
323       opnfv/functest-kubernetes-cnf
324
325 Results shall be displayed as follows::
326
327   +-------------------+------------------+--------------+------------------+----------------+
328   |     TEST CASE     |     PROJECT      |     TIER     |     DURATION     |     RESULT     |
329   +-------------------+------------------+--------------+------------------+----------------+
330   |      k8s_vims     |     functest     |     cnf      |      19:12       |      PASS      |
331   +-------------------+------------------+--------------+------------------+----------------+
332
333 Environment variables
334 =====================
335
336 Several environment variables may be specified:
337
338   * INSTALLER_IP=<Specific IP Address>
339   * DEPLOY_SCENARIO=<vim>-<controller>-<nfv_feature>-<ha_mode>
340   * NAMESERVER=XXX  # if not 8.8.8.8
341   * VOLUME_DEVICE_NAME=XXX  # if not vdb
342   * EXTERNAL_NETWORK=XXX # if not first network with router:external=True
343   * NEW_USER_ROLE=XXX # if not member
344
345 INSTALLER_IP is required by Barometer in order to access the installer node and
346 the deployment.
347
348 The format for the DEPLOY_SCENARIO env variable can be described as follows:
349   * vim: (os|k8s) = OpenStack or Kubernetes
350   * controller is one of ( nosdn | odl )
351   * nfv_feature is one or more of ( ovs | kvm | sfc | bgpvpn | nofeature )
352   * ha_mode (high availability) is one of ( ha | noha )
353
354 If several features are pertinent then use the underscore character '_' to
355 separate each feature (e.g. ovs_kvm). 'nofeature' indicates that no OPNFV
356 feature is deployed.
357
358 The list of supported scenarios per release/installer is indicated in the
359 release note.
360
361 **NOTE:** The scenario name is mainly used to automatically detect
362 if a test suite is runnable or not (e.g. it will prevent ODL test suite to be
363 run on 'nosdn' scenarios). If not set, Functest will try to run the default
364 test cases that might not include SDN controller or a specific feature.
365
366 **NOTE:** An HA scenario means that 3 OpenStack controller nodes are
367 deployed. It does not necessarily mean that the whole system is HA. See
368 installer release notes for details.
369
370 Finally, three additional environment variables can also be passed in
371 to the Functest Docker Container, using the -e
372 "<EnvironmentVariable>=<Value>" mechanism. The first two parameters are
373 only relevant to Jenkins CI invoked testing and **should not be used**
374 when performing manual test scenarios:
375
376   * INSTALLER_TYPE=(apex|compass|daisy|fuel)
377   * NODE_NAME=<Test POD Name>
378   * BUILD_TAG=<Jenkins Build Tag>
379
380 where:
381
382   * <Test POD Name> = Symbolic name of the POD where the tests are run.
383                       Visible in test results files, which are stored
384                       to the database. This option is only used when
385                       tests are activated under Jenkins CI control.
386                       It indicates the POD/hardware where the test has
387                       been run. If not specified, then the POD name is
388                       defined as "Unknown" by default.
389                       DO NOT USE THIS OPTION IN MANUAL TEST SCENARIOS.
390   * <Jenkins Build tag> = Symbolic name of the Jenkins Build Job.
391                          Visible in test results files, which are stored
392                          to the database. This option is only set when
393                          tests are activated under Jenkins CI control.
394                          It enables the correlation of test results,
395                          which are independently pushed to the results database
396                          from different Jenkins jobs.
397                          DO NOT USE THIS OPTION IN MANUAL TEST SCENARIOS.
398
399
400 Openstack credentials
401 =====================
402 OpenStack credentials are mandatory and must be provided to Functest.
403 When running the command "functest env prepare", the framework  will
404 automatically look for the Openstack credentials file
405 "/home/opnfv/functest/conf/env_file" and will exit with
406 error if it is not present or is empty.
407
408 There are 2 ways to provide that file:
409
410   * by using a Docker volume with -v option when creating the Docker container.
411     This is referred to in docker documentation as "Bind Mounting".
412     See the usage of this parameter in the following chapter.
413   * or creating manually the file '/home/opnfv/functest/conf/env_file'
414     inside the running container and pasting the credentials in it. Consult
415     your installer guide for further details. This is however not
416     instructed in this document.
417
418 In proxified environment you may need to change the credentials file.
419 There are some tips in chapter: `Proxy support`_
420
421 SSL Support
422 -----------
423 If you need to connect to a server that is TLS-enabled (the auth URL
424 begins with "https") and it uses a certificate from a private CA or a
425 self-signed certificate, then you will need to specify the path to an
426 appropriate CA certificate to use, to validate the server certificate
427 with the environment variable OS_CACERT::
428
429   echo $OS_CACERT
430   /etc/ssl/certs/ca.crt
431
432 However, this certificate does not exist in the container by default.
433 It has to be copied manually from the OpenStack deployment. This can be
434 done in 2 ways:
435
436   #. Create manually that file and copy the contents from the OpenStack
437      controller.
438   #. (Recommended) Add the file using a Docker volume when starting the
439      container::
440
441        -v <path_to_your_cert_file>:/etc/ssl/certs/ca.cert
442
443 You might need to export OS_CACERT environment variable inside the
444 credentials file::
445
446   export OS_CACERT=/etc/ssl/certs/ca.crt
447
448 Certificate verification can be turned off using OS_INSECURE=true. For
449 example, Fuel uses self-signed cacerts by default, so an pre step would
450 be::
451
452   export OS_INSECURE=true
453
454
455 Logs
456 ====
457 By default all the logs are put un /home/opnfv/functest/results/functest.log.
458 If you want to have more logs in console, you may edit the logging.ini file
459 manually.
460 Connect on the docker then edit the file located in
461 /usr/lib/python3.8/site-packages/xtesting/ci/logging.ini
462
463 Change wconsole to console in the desired module to get more traces.
464
465
466 Configuration
467 =============
468
469 You may also directly modify the python code or the configuration file (e.g.
470 testcases.yaml used to declare test constraints) under
471 /usr/lib/python3.8/site-packages/xtesting and
472 /usr/lib/python3.8/site-packages/functest
473
474
475 Tips
476 ====
477
478 Docker
479 ------
480 When typing **exit** in the container prompt, this will cause exiting
481 the container and probably stopping it. When stopping a running Docker
482 container all the changes will be lost, there is a keyboard shortcut
483 to quit the container without stopping it: <CTRL>-P + <CTRL>-Q. To
484 reconnect to the running container **DO NOT** use the *run* command
485 again (since it will create a new container), use the *exec* or *attach*
486 command instead::
487
488   docker ps  # <check the container ID from the output>
489   docker exec -ti <CONTAINER_ID> /bin/bash
490
491 There are other useful Docker commands that might be needed to manage possible
492 issues with the containers.
493
494 List the running containers::
495
496   docker ps
497
498 List all the containers including the stopped ones::
499
500   docker ps -a
501
502 Start a stopped container named "FunTest"::
503
504   docker start FunTest
505
506 Attach to a running container named "StrikeTwo"::
507
508   docker attach StrikeTwo
509
510 It is useful sometimes to remove a container if there are some problems::
511
512   docker rm <CONTAINER_ID>
513
514 Use the *-f* option if the container is still running, it will force to
515 destroy it::
516
517   docker rm -f <CONTAINER_ID>
518
519 Check the Docker documentation [`dockerdocs`_] for more information.
520
521
522 Checking Openstack and credentials
523 ----------------------------------
524 It is recommended and fairly straightforward to check that Openstack
525 and credentials are working as expected.
526
527 Once the credentials are there inside the container, they should be
528 sourced before running any Openstack commands::
529
530   source /home/opnfv/functest/conf/env_file
531
532 After this, try to run any OpenStack command to see if you get any
533 output, for instance::
534
535   openstack user list
536
537 This will return a list of the actual users in the OpenStack
538 deployment. In any other case, check that the credentials are sourced::
539
540   env|grep OS_
541
542 This command must show a set of environment variables starting with
543 *OS_*, for example::
544
545   OS_REGION_NAME=RegionOne
546   OS_USER_DOMAIN_NAME=Default
547   OS_PROJECT_NAME=admin
548   OS_AUTH_VERSION=3
549   OS_IDENTITY_API_VERSION=3
550   OS_PASSWORD=da54c27ae0d10dfae5297e6f0d6be54ebdb9f58d0f9dfc
551   OS_AUTH_URL=http://10.1.0.9:5000/v3
552   OS_USERNAME=admin
553   OS_TENANT_NAME=admin
554   OS_ENDPOINT_TYPE=internalURL
555   OS_INTERFACE=internalURL
556   OS_NO_CACHE=1
557   OS_PROJECT_DOMAIN_NAME=Default
558
559
560 If the OpenStack command still does not show anything or complains
561 about connectivity issues, it could be due to an incorrect url given to
562 the OS_AUTH_URL environment variable. Check the deployment settings.
563
564 .. _`Proxy support`:
565
566 Proxy support
567 -------------
568 If your Jumphost node is operating behind a http proxy, then there are
569 2 places where some special actions may be needed to make operations
570 succeed:
571
572   #. Initial installation of docker engine First, try following the
573      official Docker documentation for Proxy settings. Some issues were
574      experienced on CentOS 7 based Jumphost. Some tips are documented
575      in section: :ref:`Docker Installation on CentOS behind http proxy`
576      below.
577
578 If that is the case, make sure the resolv.conf and the needed
579 http_proxy and https_proxy environment variables, as well as the
580 'no_proxy' environment variable are set correctly::
581
582   # Make double sure that the 'no_proxy=...' line in the
583   # 'env_file' file is commented out first. Otherwise, the
584   # values set into the 'no_proxy' environment variable below will
585   # be ovewrwritten, each time the command
586   # 'source ~/functest/conf/env_file' is issued.
587
588   cd ~/functest/conf/
589   sed -i 's/export no_proxy/#export no_proxy/' env_file
590   source ./env_file
591
592   # Next calculate some IP addresses for which http_proxy
593   # usage should be excluded:
594
595   publicURL_IP=$(echo $OS_AUTH_URL | grep -Eo "([0-9]+\.){3}[0-9]+")
596
597   adminURL_IP=$(openstack catalog show identity | \
598   grep adminURL | grep -Eo "([0-9]+\.){3}[0-9]+")
599
600   export http_proxy="<your http proxy settings>"
601   export https_proxy="<your https proxy settings>"
602   export no_proxy="127.0.0.1,localhost,$publicURL_IP,$adminURL_IP"
603
604   # Ensure that "git" uses the http_proxy
605   # This may be needed if your firewall forbids SSL based git fetch
606   git config --global http.sslVerify True
607   git config --global http.proxy <Your http proxy settings>
608
609 For example, try to use the **nc** command from inside the functest
610 docker container::
611
612   nc -v opnfv.org 80
613   Connection to opnfv.org 80 port [tcp/http] succeeded!
614
615   nc -v opnfv.org 443
616   Connection to opnfv.org 443 port [tcp/https] succeeded!
617
618 Note: In a Jumphost node based on the CentOS family OS, the **nc**
619 commands might not work. You can use the **curl** command instead.
620
621   curl https://www.opnfv.org/
622
623   <HTML><HEAD><meta http-equiv="content-type"
624   .
625   .
626   </BODY></HTML>
627
628   curl https://www.opnfv.org:443
629
630   <HTML><HEAD><meta http-equiv="content-type"
631   .
632   .
633   </BODY></HTML>
634
635   (Ignore the content. If command returns a valid HTML page, it proves
636   the connection.)
637
638 .. _`Docker Installation on CentOS behind http proxy`:
639
640 Docker Installation on CentOS behind http proxy
641 -----------------------------------------------
642 This section is applicable for CentOS family OS on Jumphost which
643 itself is behind a proxy server. In that case, the instructions below
644 should be followed **before** installing the docker engine::
645
646   1) # Make a directory '/etc/systemd/system/docker.service.d'
647      # if it does not exist
648      sudo mkdir /etc/systemd/system/docker.service.d
649
650   2) # Create a file called 'env.conf' in that directory with
651      # the following contents:
652      [Service]
653      EnvironmentFile=-/etc/sysconfig/docker
654
655   3) # Set up a file called 'docker' in directory '/etc/sysconfig'
656      # with the following contents:
657      HTTP_PROXY="<Your http proxy settings>"
658      HTTPS_PROXY="<Your https proxy settings>"
659      http_proxy="${HTTP_PROXY}"
660      https_proxy="${HTTPS_PROXY}"
661
662   4) # Reload the daemon
663      systemctl daemon-reload
664
665   5) # Sanity check - check the following docker settings:
666      systemctl show docker | grep -i env
667
668      Expected result:
669      ----------------
670      EnvironmentFile=/etc/sysconfig/docker (ignore_errors=yes)
671      DropInPaths=/etc/systemd/system/docker.service.d/env.conf
672
673 Now follow the instructions in [`Install Docker on CentOS`_] to download
674 and install the **docker-engine**. The instructions conclude with a
675 "test pull" of a sample "Hello World" docker container. This should now
676 work with the above pre-requisite actions.
677
678
679 .. _`dockerdocs`: https://docs.docker.com/
680 .. _`Proxy`: https://docs.docker.com/engine/admin/systemd/#http-proxy
681 .. _`Install Docker on CentOS`: https://docs.docker.com/engine/installation/linux/centos/
682 .. _`Functest User Guide`: http://docs.opnfv.org/en/stable-danube/submodules/functest/docs/testing/user/userguide/index.html
683 .. _`images/CentOS-7-x86_64-GenericCloud.qcow2`: https://cloud.centos.org/centos/7/images/CentOS-7-x86_64-GenericCloud.qcow2
684 .. _`images/cirros-0.5.1-x86_64-disk.img`: http://download.cirros-cloud.net/0.5.1/cirros-0.5.1-x86_64-disk.img
685 .. _`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