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