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