e41700b238da83bb4f168d90c36642db5cbf8898
[functest.git] / docs / testing / user / configguide / configguide.rst
1 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
2 .. SPDX-License-Identifier: CC-BY-4.0
3
4 Installation and configuration
5 ==============================
6
7 Alpine containers have been introduced in Euphrates.
8 Alpine allows Functest testing in several very light containers and thanks to
9 the refactoring on dependency management should allow the creation of light and
10 fully customized docker images.
11
12 It is still possible to use the monolithic Ubuntu image opnfv/functest especially
13 for tests on Aarch64 architecture.
14
15 Functest Dockers
16 ----------------
17 Docker images are available on the dockerhub:
18
19   * opnfv/functest-core
20   * opnfv/functest-healthcheck
21   * opnfv/functest-smoke
22   * opnfv/functest-features
23   * opnfv/functest-components
24   * opnfv/functest-vnf
25   * opnfv/functest-parser
26   * opnfv/functest-restapi
27
28 The tag "opnfv-5.0.0" is the official release image in Euphrates, but you can also pull "euphrates"
29 tag as it is being maintained by Functest team and might include bugfixes.
30
31 The Functest docker container environment can -in principle- be also
32 used with non-OPNFV official installers (e.g. 'devstack'), with the
33 **disclaimer** that support for such environments is outside of the
34 scope and responsibility of the OPNFV project.
35
36
37 Preparing your environment
38 --------------------------
39
40 cat env::
41
42   INSTALLER_TYPE=XXX
43   INSTALLER_IP=XXX
44   EXTERNAL_NETWORK=XXX
45   DEPLOY_SCENARIO=XXX
46
47 See section on environment variables for details.
48
49 cat openstack.creds::
50
51   export OS_AUTH_URL=XXX
52   export OS_USER_DOMAIN_NAME=XXX
53   export OS_PROJECT_DOMAIN_NAME=XXX
54   export OS_USERNAME=XXX
55   export OS_TENANT_NAME=XXX
56   export OS_PROJECT_NAME=XXX
57   export OS_PASSWORD=XXX
58   export OS_VOLUME_API_VERSION=XXX
59   export OS_IDENTITY_API_VERSION=XXX
60   export OS_IMAGE_API_VERSION=XXX
61
62 See section on OpenStack credentials for details.
63
64 Create a directory for the different images (attached as a Docker volume)::
65
66   mkdir -p images && wget -q -O- https://git.opnfv.org/functest/plain/functest/ci/download_images.sh?h=stable/euphrates | bash -s -- images && ls -1 images/*
67
68   images/CentOS-7-aarch64-GenericCloud.qcow2
69   images/CentOS-7-aarch64-GenericCloud.qcow2.xz
70   images/CentOS-7-x86_64-GenericCloud.qcow2
71   images/cirros-0.3.5-x86_64-disk.img
72   images/cirros-0.3.5-x86_64-lxc.tar.gz
73   images/cirros-d161201-aarch64-disk.img
74   images/cirros-d161201-aarch64-initramfs
75   images/cirros-d161201-aarch64-kernel
76   images/cloudify-manager-premium-4.0.1.qcow2
77   images/img
78   images/trusty-server-cloudimg-amd64-disk1.img
79   images/ubuntu-14.04-server-cloudimg-amd64-disk1.img
80   images/ubuntu-14.04-server-cloudimg-arm64-uefi1.img
81   images/ubuntu-16.04-server-cloudimg-amd64-disk1.img
82   images/vyos-1.1.7.img
83
84
85 Testing healthcheck suite
86 --------------------------
87
88 Run healthcheck suite::
89
90   sudo docker run --env-file env \
91       -v $(pwd)/openstack.creds:/home/opnfv/functest/conf/openstack.creds  \
92       -v $(pwd)/images:/home/opnfv/functest/images  \
93       opnfv/functest-healthcheck
94
95 Results shall be displayed as follows::
96
97   +----------------------------+------------------+---------------------+------------------+----------------+
98   |         TEST CASE          |     PROJECT      |         TIER        |     DURATION     |     RESULT     |
99   +----------------------------+------------------+---------------------+------------------+----------------+
100   |      connection_check      |     functest     |     healthcheck     |      00:02       |      PASS      |
101   |         api_check          |     functest     |     healthcheck     |      04:57       |      PASS      |
102   |     snaps_health_check     |     functest     |     healthcheck     |      00:51       |      PASS      |
103   +----------------------------+------------------+---------------------+------------------+----------------+
104   NOTE: the duration is a reference and it might vary depending on your SUT.
105
106 Testing smoke suite
107 -------------------
108
109 Run smoke suite::
110
111   sudo docker run --env-file env \
112       -v $(pwd)/openstack.creds:/home/opnfv/functest/conf/openstack.creds  \
113       -v $(pwd)/images:/home/opnfv/functest/images  \
114       opnfv/functest-smoke
115
116 Results shall be displayed as follows::
117
118   +------------------------------+------------------+---------------+------------------+----------------+
119   |          TEST CASE           |     PROJECT      |      TIER     |     DURATION     |     RESULT     |
120   +------------------------------+------------------+---------------+------------------+----------------+
121   |          vping_ssh           |     functest     |     smoke     |      01:19       |      PASS      |
122   |        vping_userdata        |     functest     |     smoke     |      01:56       |      PASS      |
123   |     tempest_smoke_serial     |     functest     |     smoke     |      26:30       |      PASS      |
124   |         rally_sanity         |     functest     |     smoke     |      19:42       |      PASS      |
125   |       refstack_defcore       |     functest     |     smoke     |      22:00       |      PASS      |
126   |         snaps_smoke          |     functest     |     smoke     |      41:14       |      PASS      |
127   |             odl              |     functest     |     smoke     |      00:16       |      PASS      |
128   |         odl_netvirt          |     functest     |     smoke     |      00:00       |      SKIP      |
129   |             fds              |     functest     |     smoke     |      00:00       |      SKIP      |
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 features suite
135 ----------------------
136
137 Run features suite::
138
139   sudo docker run --env-file env \
140       -v $(pwd)/openstack.creds:/home/opnfv/functest/conf/openstack.creds  \
141       -v $(pwd)/images:/home/opnfv/functest/images  \
142       opnfv/functest-features
143
144 Results shall be displayed as follows::
145
146   +---------------------------+--------------------------+------------------+------------------+----------------+
147   |         TEST CASE         |         PROJECT          |       TIER       |     DURATION     |     RESULT     |
148   +---------------------------+--------------------------+------------------+------------------+----------------+
149   |          promise          |         promise          |     features     |      00:00       |      SKIP      |
150   |           bgpvpn          |          sdnvpn          |     features     |      00:00       |      SKIP      |
151   |       security_scan       |     securityscanning     |     features     |      00:00       |      SKIP      |
152   |      functest-odl-sfc     |           sfc            |     features     |      00:00       |      SKIP      |
153   |      domino-multinode     |          domino          |     features     |      00:00       |      SKIP      |
154   |     barometercollectd     |        barometer         |     features     |      00:00       |      SKIP      |
155   +---------------------------+--------------------------+------------------+------------------+----------------+
156   Note: if the scenario does not support some tests, they are indicated as SKIP.
157   See User guide for details.
158
159 Testing components suite
160 ------------------------
161
162 Run components suite::
163
164   sudo docker run --env-file env \
165       -v $(pwd)/openstack.creds:/home/opnfv/functest/conf/openstack.creds  \
166       -v $(pwd)/images:/home/opnfv/functest/images  \
167       opnfv/functest-components
168
169 Results shall be displayed as follows::
170
171   +-------------------------------+------------------+--------------------+------------------+----------------+
172   |           TEST CASE           |     PROJECT      |        TIER        |     DURATION     |     RESULT     |
173   +-------------------------------+------------------+--------------------+------------------+----------------+
174   |     tempest_full_parallel     |     functest     |     components     |      102:48      |      PASS      |
175   |           rally_full          |     functest     |     components     |      160:58      |      PASS      |
176   +-------------------------------+------------------+--------------------+------------------+----------------+
177
178 Testing vnf suite
179 -----------------
180
181 Run vnf suite::
182
183 sudo docker run --env-file env \
184     -v $(pwd)/openstack.creds:/home/opnfv/functest/conf/openstack.creds  \
185     -v $(pwd)/images:/home/opnfv/functest/images  \
186     opnfv/functest-vnf
187
188 Results shall be displayed as follows::
189
190   +---------------------------------+------------------+--------------+------------------+----------------+
191   |            TEST CASE            |     PROJECT      |     TIER     |     DURATION     |     RESULT     |
192   +---------------------------------+------------------+--------------+------------------+----------------+
193   |           cloudify_ims          |     functest     |     vnf      |      21:25       |      PASS      |
194   |        orchestra_openims        |     functest     |     vnf      |      11:02       |      FAIL      |
195   |     orchestra_clearwaterims     |     functest     |     vnf      |      09:13       |      FAIL      |
196   +---------------------------------+------------------+--------------+------------------+----------------+
197
198
199 Environment variables
200 =====================
201
202 Several environement variables may be specified:
203   * INSTALLER_TYPE=(apex|compass|daisy|fuel|joid)
204   * INSTALLER_IP=<Specific IP Address>
205   * DEPLOY_SCENARIO=<vim>-<controller>-<nfv_feature>-<ha_mode>
206
207
208 INSTALLER IP may be required by some test cases like SFC or Barometer in order
209 to access the installer node and the deployment.
210
211 The format for the DEPLOY_SCENARIO env variable can be described as follows:
212   * vim: (os|k8s) = OpenStack or Kubernetes
213   * controller is one of ( nosdn | odl )
214   * nfv_feature is one or more of ( ovs | kvm | sfc | bgpvpn | nofeature )
215   * ha_mode (high availability) is one of ( ha | noha )
216
217 If several features are pertinent then use the underscore character '_' to
218 separate each feature (e.g. ovs_kvm). 'nofeature' indicates that no OPNFV
219 feature is deployed.
220
221 The list of supported scenarios per release/installer is indicated in the
222 release note.
223
224 **NOTE:** The scenario name is mainly used to automatically detect
225 if a test suite is runnable or not (e.g. it will prevent ODL test suite to be
226 run on 'nosdn' scenarios). If not set, Functest will try to run the default test
227 cases that might not include SDN controller or a specific feature
228
229 **NOTE:** An HA scenario means that 3 OpenStack controller nodes are
230 deployed. It does not necessarily mean that the whole system is HA. See
231 installer release notes for details.
232
233 Finally, three additional environment variables can also be passed in
234 to the Functest Docker Container, using the -e
235 "<EnvironmentVariable>=<Value>" mechanism. The first two parameters are
236 only relevant to Jenkins CI invoked testing and **should not be used**
237 when performing manual test scenarios:
238
239   * NODE_NAME = <Test POD Name>
240   * BUILD_TAG = <Jenkins Build Tag>
241   * CI_DEBUG = <DebugTraceValue>
242
243 where:
244
245   * <Test POD Name> = Symbolic name of the POD where the tests are run.
246                       Visible in test results files, which are stored
247                       to the database. This option is only used when
248                       tests are activated under Jenkins CI control.
249                       It indicates the POD/hardware where the test has
250                       been run. If not specified, then the POD name is
251                       defined as "Unknown" by default.
252                       DO NOT USE THIS OPTION IN MANUAL TEST SCENARIOS.
253   * <Jenkins Build tag> = Symbolic name of the Jenkins Build Job.
254                          Visible in test results files, which are stored
255                          to the database. This option is only set when
256                          tests are activated under Jenkins CI control.
257                          It enables the correlation of test results,
258                          which are independently pushed to the results database
259                          from different Jenkins jobs.
260                          DO NOT USE THIS OPTION IN MANUAL TEST SCENARIOS.
261   * <DebugTraceValue> = "true" or "false"
262                        Default = "false", if not specified
263                        If "true" is specified, then additional debug trace
264                        text can be sent to the test results file / log files
265                        and also to the standard console output.
266
267
268 Openstack credentials
269 =====================
270 OpenStack credentials are mandatory and must be provided to Functest.
271 When running the command "functest env prepare", the framework  will
272 automatically look for the Openstack credentials file
273 "/home/opnfv/functest/conf/openstack.creds" and will exit with
274 error if it is not present or is empty.
275
276 There are 2 ways to provide that file:
277
278   * by using a Docker volume with -v option when creating the Docker container.
279     This is referred to in docker documentation as "Bind Mounting".
280     See the usage of this parameter in the following chapter.
281   * or creating manually the file '/home/opnfv/functest/conf/openstack.creds'
282     inside the running container and pasting the credentials in it. Consult
283     your installer guide for further details. This is however not
284     instructed in this document.
285
286 In proxified environment you may need to change the credentials file.
287 There are some tips in chapter: `Proxy support`_
288
289 SSL Support
290 -----------
291 If you need to connect to a server that is TLS-enabled (the auth URL
292 begins with "https") and it uses a certificate from a private CA or a
293 self-signed certificate, then you will need to specify the path to an
294 appropriate CA certificate to use, to validate the server certificate
295 with the environment variable OS_CACERT::
296
297   echo $OS_CACERT
298   /etc/ssl/certs/ca.crt
299
300 However, this certificate does not exist in the container by default.
301 It has to be copied manually from the OpenStack deployment. This can be
302 done in 2 ways:
303
304   #. Create manually that file and copy the contents from the OpenStack
305      controller.
306   #. (Recommended) Add the file using a Docker volume when starting the
307      container::
308
309        -v <path_to_your_cert_file>:/etc/ssl/certs/ca.cert
310
311 You might need to export OS_CACERT environment variable inside the
312 credentials file::
313
314   export OS_CACERT=/etc/ssl/certs/ca.crt
315
316 Certificate verification can be turned off using OS_INSECURE=true. For
317 example, Fuel uses self-signed cacerts by default, so an pre step would
318 be::
319
320   export OS_INSECURE=true
321
322 Functest docker container directory structure
323 =============================================
324 Inside the Functest docker container, the following directory structure
325 should now be in place::
326
327   `--
328     |- home
329     |   |-- opnfv
330     |   |     `- functest
331     |   |          |-- conf
332     |   |          `-- results
333     |    `-- repos
334     |       `-- vnfs
335     |- src
336     |   |-- tempest
337     |   |-- vims-test
338     |   |-- odl_test
339     |   `-- fds
340     `- usr
341         `- lib
342            `- python2.7
343               `- site-packages
344                  `- functest
345                       |-- ...
346
347 Underneath the '/home/opnfv/functest' directory, the Functest docker container
348 includes two main directories:
349
350   * The **conf** directory stores configuration files (e.g. the
351     OpenStack creds are stored in path '/home/opnfv/functest/conf/openstack.creds'),
352   * the **results** directory stores some temporary result log files
353
354 src and repos directories are used to host third party code used for the tests.
355
356 The structure of functest repo can be described as follows::
357
358   |-- INFO
359   |-- LICENSE
360   |-- api
361   |  `-- apidoc
362   |-- build.sh
363   |-- docker
364   |  |-- Dockerfile
365   |  |-- Dockerfile.aarch64.patch
366   |  |-- components
367   |  |-- config_install_env.sh
368   |  |-- core
369   |  |-- docker_remote_api
370   |  |-- features
371   |  |-- healthcheck
372   |  |-- smoke
373   |  |-- vnf
374   |  |-- parser
375   |  |-- restapi
376   |  |-- thirdparty-requirements.txt
377   |-- docs
378   |  |-- com
379   |  |-- images
380   |  |-- release
381   |  |  `-- release-notes
382   |  |-- results
383   |  | testing
384   |  |  |-- developer
385   |  |    `-- user
386   |  |      |-- configguide
387   |  |      `-- userguide
388   `-- functest
389     |-- api
390     |  |-- base.py
391     |  |-- server.py
392     |  |-- urls.py
393     |  |-- common
394     |  |  |-- api_utils.py
395     |  |  |-- thread.py
396     |  `-- resources
397     |     `-- v1
398     |        |-- creds.py
399     |        |-- envs.py
400     |        |-- testcases.py
401     |        |-- tiers.py
402     |        |-- tasks.py
403     |  `-- database
404     |     |-- db.py
405     |     `-- v1
406     |        |-- handlers.py
407     |        |-- models.py
408     |  `-- swagger
409     |-- ci
410     â”‚   |-- check_deployment.py
411     â”‚   |-- config_aarch64_patch.yaml
412     â”‚   |-- config_functest.yaml
413     â”‚   |-- config_patch.yaml
414     â”‚   |-- download_images.sh
415     â”‚   |-- installer_params.yaml
416     â”‚   |-- logging.ini
417     â”‚   |-- prepare_env.py
418     â”‚   |-- rally_aarch64_patch.conf
419     â”‚   |-- run_tests.py
420     â”‚   |-- testcases.yaml
421     â”‚   |-- tier_builder.py
422     â”‚   |-- tier_handler.py
423     |-- cli
424     â”‚   |-- cli_base.py
425     â”‚   |-- commands
426     â”‚   â”‚   |-- cli_env.py
427     â”‚   â”‚   |-- cli_os.py
428     â”‚   â”‚   |-- cli_testcase.py
429     â”‚   â”‚   |-- cli_tier.py
430     â”‚   |-- functest-complete.sh
431     |-- core
432     â”‚   |-- feature.py
433     â”‚   |-- testcase.py
434     â”‚   |-- unit.py
435     â”‚   |-- vnf.py
436     |-- energy
437     â”‚   |-- energy.py
438     |-- opnfv_tests
439     â”‚   `-- openstack
440     â”‚    Â Â  |-- rally
441     â”‚    Â Â  |-- refstack_client
442     â”‚    Â Â  |-- snaps
443     â”‚    Â Â  |-- tempest
444     â”‚    Â Â  |-- vping
445     â”‚   `-- sdn
446     â”‚   â”‚    `-- odl
447     â”‚   `-- vnf
448     â”‚       |-- ims
449     â”‚       `-- router
450     |-- tests
451     â”‚   `-- unit
452     â”‚       |-- ci
453     â”‚       |-- cli
454     â”‚       |-- core
455     â”‚       |-- energy
456     â”‚       |-- features
457     â”‚       |-- odl
458     â”‚       |-- openstack
459     â”‚       |-- opnfv_tests
460     â”‚       |-- test_utils.py
461     â”‚       |-- utils
462     â”‚       `-- vnf
463     |-- utils
464     |    |-- config.py
465     |    |-- constants.py
466     |    |-- decorators.py
467     |    |-- env.py
468     |    |-- functest_utils.py
469     |    |-- functest_vacation.py
470     |    |-- openstack_clean.py
471     |    |-- openstack_snapshot.py
472     |    |-- openstack_tacker.py
473     |    `-- openstack_utils.py
474   |-- requirements.txt
475   |-- setup.cfg
476   |-- setup.py
477   |-- test-requirements.txt
478   |-- tox.ini
479   |-- upper-constraints.txt
480
481   (Note: All *.pyc files removed from above list for brevity...)
482
483 We may distinguish several directories, the first level has 5 directories:
484
485 * **api**: This directory is dedicated to the API (framework) documentations.
486 * **commons**: This directory is dedicated for storage of traffic
487   profile or any other test inputs that could be reused by any test
488   project.
489 * **docker**: This directory includes the needed files and tools to
490   build the Functest Docker image.
491 * **docs**: This directory includes documentation: Release Notes,
492   User Guide, Configuration Guide and Developer Guide.
493 * **functest**: This directory contains all the code needed to run
494   functest internal cases and OPNFV onboarded feature or VNF test cases.
495
496 Functest directory has 7 sub-directories, which is located under
497 /usr/lib/python2.7/site-packages/functest:
498   * **api**: This directory is dedicated for the internal Functest API and the
499     API (framework) documentations.
500   * **ci**: This directory contains test structure definition files
501     (e.g <filename>.yaml) and bash shell/python scripts used to
502     configure and execute Functional tests. The test execution script
503     can be executed under the control of Jenkins CI jobs.
504   * **cli**: This directory holds the python based Functest CLI utility
505     source code, which is based on the Python 'click' framework.
506   * **core**: This directory holds the python based Functest core
507       source code. Three abstraction classes have been created to ease
508       the integration of internal, feature or vnf cases.
509   * **opnfv_tests**: This directory includes the scripts required by
510     Functest internal test cases and other feature projects test cases.
511   * **tests**: This directory includes the functest unit tests
512   * **utils**: this directory holds Python source code for some general
513     purpose helper utilities, which testers can also re-use in their
514     own test code. See for an example the Openstack helper utility:
515     'openstack_utils.py'.
516
517
518 Logs
519 ====
520 By default all the logs are put un /home/opnfv/functest/results/functest.log.
521 If you want to have more logs in console, you may edit the logging.ini file
522 manually.
523 Connect on the docker then edit the file located in
524 /usr/lib/python2.7/site-packages/functest/ci/logging.ini
525
526 Change wconsole to console in the desired module to get more traces.
527
528
529 Configuration
530 =============
531
532 You may also directly modify the python code or the configuration file (e.g.
533 testcases.yaml used to declare test constraints) under
534 /usr/lib/python2.7/site-packages/functest
535
536
537 Tips
538 ====
539
540 Docker
541 ------
542 When typing **exit** in the container prompt, this will cause exiting
543 the container and probably stopping it. When stopping a running Docker
544 container all the changes will be lost, there is a keyboard shortcut
545 to quit the container without stopping it: <CTRL>-P + <CTRL>-Q. To
546 reconnect to the running container **DO NOT** use the *run* command
547 again (since it will create a new container), use the *exec* or *attach*
548 command instead::
549
550   docker ps  # <check the container ID from the output>
551   docker exec -ti <CONTAINER_ID> /bin/bash
552
553 There are other useful Docker commands that might be needed to manage possible
554 issues with the containers.
555
556 List the running containers::
557
558   docker ps
559
560 List all the containers including the stopped ones::
561
562   docker ps -a
563
564 Start a stopped container named "FunTest"::
565
566   docker start FunTest
567
568 Attach to a running container named "StrikeTwo"::
569
570   docker attach StrikeTwo
571
572 It is useful sometimes to remove a container if there are some problems::
573
574   docker rm <CONTAINER_ID>
575
576 Use the *-f* option if the container is still running, it will force to
577 destroy it::
578
579   docker rm -f <CONTAINER_ID>
580
581 Check the Docker documentation [`dockerdocs`_] for more information.
582
583
584 Checking Openstack and credentials
585 ----------------------------------
586 It is recommended and fairly straightforward to check that Openstack
587 and credentials are working as expected.
588
589 Once the credentials are there inside the container, they should be
590 sourced before running any Openstack commands::
591
592   source /home/opnfv/functest/conf/openstack.creds
593
594 After this, try to run any OpenStack command to see if you get any
595 output, for instance::
596
597   openstack user list
598
599 This will return a list of the actual users in the OpenStack
600 deployment. In any other case, check that the credentials are sourced::
601
602   env|grep OS_
603
604 This command must show a set of environment variables starting with
605 *OS_*, for example::
606
607   OS_REGION_NAME=RegionOne
608   OS_USER_DOMAIN_NAME=Default
609   OS_PROJECT_NAME=admin
610   OS_AUTH_VERSION=3
611   OS_IDENTITY_API_VERSION=3
612   OS_PASSWORD=da54c27ae0d10dfae5297e6f0d6be54ebdb9f58d0f9dfc
613   OS_AUTH_URL=http://10.1.0.9:5000/v3
614   OS_USERNAME=admin
615   OS_TENANT_NAME=admin
616   OS_ENDPOINT_TYPE=internalURL
617   OS_INTERFACE=internalURL
618   OS_NO_CACHE=1
619   OS_PROJECT_DOMAIN_NAME=Default
620
621
622 If the OpenStack command still does not show anything or complains
623 about connectivity issues, it could be due to an incorrect url given to
624 the OS_AUTH_URL environment variable. Check the deployment settings.
625
626 Proxy support
627 -------------
628 If your Jumphost node is operating behind a http proxy, then there are
629 2 places where some special actions may be needed to make operations
630 succeed:
631
632   #. Initial installation of docker engine First, try following the
633      official Docker documentation for Proxy settings. Some issues were
634      experienced on CentOS 7 based Jumphost. Some tips are documented
635      in section: `Docker Installation on CentOS behind http proxy`_
636      below.
637
638 If that is the case, make sure the resolv.conf and the needed
639 http_proxy and https_proxy environment variables, as well as the
640 'no_proxy' environment variable are set correctly::
641
642   # Make double sure that the 'no_proxy=...' line in the
643   # 'openstack.creds' file is commented out first. Otherwise, the
644   # values set into the 'no_proxy' environment variable below will
645   # be ovewrwritten, each time the command
646   # 'source ~/functest/conf/openstack.creds' is issued.
647
648   cd ~/functest/conf/
649   sed -i 's/export no_proxy/#export no_proxy/' openstack.creds
650   source ./openstack.creds
651
652   # Next calculate some IP addresses for which http_proxy
653   # usage should be excluded:
654
655   publicURL_IP=$(echo $OS_AUTH_URL | grep -Eo "([0-9]+\.){3}[0-9]+")
656
657   adminURL_IP=$(openstack catalog show identity | \
658   grep adminURL | grep -Eo "([0-9]+\.){3}[0-9]+")
659
660   export http_proxy="<your http proxy settings>"
661   export https_proxy="<your https proxy settings>"
662   export no_proxy="127.0.0.1,localhost,$publicURL_IP,$adminURL_IP"
663
664   # Ensure that "git" uses the http_proxy
665   # This may be needed if your firewall forbids SSL based git fetch
666   git config --global http.sslVerify True
667   git config --global http.proxy <Your http proxy settings>
668
669 For example, try to use the **nc** command from inside the functest
670 docker container::
671
672   nc -v opnfv.org 80
673   Connection to opnfv.org 80 port [tcp/http] succeeded!
674
675   nc -v opnfv.org 443
676   Connection to opnfv.org 443 port [tcp/https] succeeded!
677
678 Note: In a Jumphost node based on the CentOS family OS, the **nc**
679 commands might not work. You can use the **curl** command instead.
680
681   curl http://www.opnfv.org:80
682
683   <HTML><HEAD><meta http-equiv="content-type"
684   .
685   .
686   </BODY></HTML>
687
688   curl https://www.opnfv.org:443
689
690   <HTML><HEAD><meta http-equiv="content-type"
691   .
692   .
693   </BODY></HTML>
694
695   (Ignore the content. If command returns a valid HTML page, it proves
696   the connection.)
697
698 Docker Installation on CentOS behind http proxy
699 -----------------------------------------------
700 This section is applicable for CentOS family OS on Jumphost which
701 itself is behind a proxy server. In that case, the instructions below
702 should be followed **before** installing the docker engine::
703
704   1) # Make a directory '/etc/systemd/system/docker.service.d'
705      # if it does not exist
706      sudo mkdir /etc/systemd/system/docker.service.d
707
708   2) # Create a file called 'env.conf' in that directory with
709      # the following contents:
710      [Service]
711      EnvironmentFile=-/etc/sysconfig/docker
712
713   3) # Set up a file called 'docker' in directory '/etc/sysconfig'
714      # with the following contents:
715      HTTP_PROXY="<Your http proxy settings>"
716      HTTPS_PROXY="<Your https proxy settings>"
717      http_proxy="${HTTP_PROXY}"
718      https_proxy="${HTTPS_PROXY}"
719
720   4) # Reload the daemon
721      systemctl daemon-reload
722
723   5) # Sanity check - check the following docker settings:
724      systemctl show docker | grep -i env
725
726      Expected result:
727      ----------------
728      EnvironmentFile=/etc/sysconfig/docker (ignore_errors=yes)
729      DropInPaths=/etc/systemd/system/docker.service.d/env.conf
730
731 Now follow the instructions in [`Install Docker on CentOS`_] to download
732 and install the **docker-engine**. The instructions conclude with a
733 "test pull" of a sample "Hello World" docker container. This should now
734 work with the above pre-requisite actions.
735
736
737 .. _`[4]`: http://docs.opnfv.org/en/latest/submodules/functest/docs/testing/user/configguide/index.html
738 .. _`dockerdocs`: https://docs.docker.com/
739 .. _`dockerhub`: https://hub.docker.com/r/opnfv/functest/
740 .. _`Proxy`: https://docs.docker.com/engine/admin/systemd/#http-proxy
741 .. _`FunctestDockerTags`: https://hub.docker.com/r/opnfv/functest/tags/
742 .. _`Install Docker on CentOS`: https://docs.docker.com/engine/installation/linux/centos/
743 .. _`Functest User Guide`: http://docs.opnfv.org/en/stable-danube/submodules/functest/docs/testing/user/userguide/index.html
744 .. _`images/CentOS-7-x86_64-GenericCloud.qcow2` http://download.cirros-cloud.net/0.3.5/cirros-0.3.5-x86_64-disk.img
745 .. _`images/cirros-0.3.5-x86_64-disk.img` https://cloud-images.ubuntu.com/releases/14.04/release/ubuntu-14.04-server-cloudimg-amd64-disk1.img
746 .. _`images/ubuntu-14.04-server-cloudimg-amd64-disk1.img` https://cloud.centos.org/centos/7/images/CentOS-7-x86_64-GenericCloud.qcow2