be seen from location [FunctestDockerTags_]. For example, when running
on the first official release of the OPNFV Colorado system platform,
tag "colorado.1.0" is needed. Pulling other tags might cause some
-problems while running the tests. If you need to specifically pull the
-latest Functest docker image, then omit the tag argument::
+problems while running the tests.
+Docker images pulled without a tag specifier bear the implicitly
+assigned label "latest". If you need to specifically pull the latest
+Functest docker image, then omit the tag argument::
docker pull opnfv/functest
[functester@jumphost ~]$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
- opnfv/functest latest 8cd6683c32ae 2 weeks ago 1.611 GB
- opnfv/functest brahmaputra.3.0 94b78faa94f7 4 weeks ago 874.9 MB
- hello-world latest 94df4f0ce8a4 7 weeks ago 967 B
-
-Docker images pulled without a tag specifier bear the implicitly
-assigned label "latest", as seen above.
+ opnfv/functest latest 8cd6683c32ae 2 weeks ago 1.321 GB
+ opnfv/functest danube.1.0 13fa54a1b238 4 weeks ago 1.29 GB
+ opnfv/functest colorado.1.0 94b78faa94f7 9 weeks ago 968 MB
The Functest docker container environment can -in principle- be also
used with non-OPNFV official installers (e.g. 'devstack'), with the
#. Log in to container and execute the following command. Replace
the IP with installer address after the "-a" parameter::
- $repos_dir/releng/utils/fetch_os_creds.sh \
+ $REPOS_DIR/releng/utils/fetch_os_creds.sh \
-d /home/opnfv/functest/conf/openstack.creds \
-i fuel \
-a 10.20.0.2 \
-e "INSTALLER_TYPE=<type>"
# Use one of following apex, compass, fuel or joid
- #. Functest needs to know the IP of the installer::
+ #. Functest needs to know the IP of some installers::
-e "INSTALLER_IP=<Specific IP Address>"
+ This IP is needed to fetch RC file from deployment, fetch logs, ...
+ If not provided, there is no way to fetch the RC file. It must be
+ provided manually as a volume
+
#. Credentials for accessing the Openstack.
Most convenient way of passing them to container is by having a
local copy of the credentials file in Jumphost and then using the
The credentials file needs to exist in the Docker container
under the path: '/home/opnfv/functest/conf/openstack.creds'.
- WARNING: If you are using the Joid installer, you must pass the
- credentials using the **-v** option. See the section
- `Accessing the Openstack credentials`_ above.
+ **WARNING:** If you are using the Joid installer, you must pass the
+ credentials using the **-v** option:
+ -v /var/lib/jenkins/admin-openrc:/home/opnfv/functest/conf/openstack.creds.
+ See the section `Accessing the Openstack credentials`_ above.
#. Passing deployment scenario
When running Functest against any of the supported OPNFV scenarios,
-e "DEPLOY_SCENARIO=os-<controller>-<nfv_feature>-<ha_mode>"
where:
os = OpenStack (No other VIM choices currently available)
- controller is one of ( nosdn | odl_l2 | odl_l3 | onos )
+ controller is one of ( nosdn | odl_l2 | odl_l3 | onos | ocl)
nfv_feature is one or more of ( ovs | kvm | sfc | bgpvpn | nofeature )
If several features are pertinent then use the underscore
character '_' to separate each feature (e.g. ovs_kvm)
'nofeature' indicates no NFV feature is deployed
- ha_mode is one of ( ha | noha )
+ ha_mode (high availability) is one of ( ha | noha )
**NOTE:** Not all possible combinations of "DEPLOY_SCENARIO" are
supported. The name passed in to the Functest Docker container
must match the scenario used when the actual OPNFV platform was
- deployed.
+ deployed. See release note to see the list of supported scenarios.
+
+ **NOTE:** The scenario name is mainly used to automatically detect
+ if a test suite is runnable or not (e.g. it will prevent ONOS test suite
+ to be run on ODL scenarios). If not set, Functest will try to run the
+ default test cases that might not include SDN controller or a specific
+ feature
+
+ **NOTE:** A HA scenario means that 3 OpenStack controller nodes are
+ deployed. It does not necessarily mean that the whole system is HA. See
+ installer release notes for details.
+
Putting all above together, when using installer 'fuel' and an invented
INSTALLER_IP of '10.20.0.2', the recommended command to create the
-v ~/overcloudrc:/home/opnfv/functest/conf/openstack.creds \
opnfv/functest /bin/bash
+Compass installer local development env usage Tips
+--------------------------------------------------
+In the compass-functest local test case check and development environment,
+in order to get openstack service inside the functest container, some
+parameters should be configured during container creation, which are
+hard to guess for freshman. This section will provide the guideline, the
+parameters values are defaults here, which should be adjusted according
+to the settings, the complete steps are given here so as not to appear
+too abruptly.
+
+1, Pull Functest docker image from public dockerhub::
+
+ docker pull opnfv/functest:<Tag>
+
+<Tag> here can be "brahmaputra.1.0", "colorado.1.0", etc.
+Tag omitted means the latest docker image::
+
+ docker pull opnfv/functest
+
+2, Functest Docker container creation
+
+To make a file used for the environment, such as 'functest-docker-env'::
+
+ OS_AUTH_URL=http://172.16.1.222:35357/v2.0
+ OS_USERNAME=admin
+ OS_PASSWORD=console
+ OS_TENANT_NAME=admin
+ OS_VOLUME_API_VERSION=2
+ OS_PROJECT_NAME=admin
+ INSTALLER_TYPE=compass
+ INSTALLER_IP=192.168.200.2
+ EXTERNAL_NETWORK=ext-net
+
+Note: please adjust the content according to the environment, such as
+'TENANT_ID' maybe used for some special cases.
+
+Then to create the Functest docker::
+
+ docker run --privileged=true --rm -t \
+ --env-file functest-docker-env \
+ --name <Functest_Container_Name> \
+ opnfv/functest:<Tag> /bin/bash
+
+3, To attach Functest container
+
+Before trying to attach the Functest container, the status can be checked by::
+
+ docker ps -a
+
+to attach the 'Up' status Functest container and start bash mode::
+
+ docker exec -it <Functest_Container_Name> bash
+
+4, Functest environemnt preparation and check
+
+To see the Section below `Preparing the Functest environment`_.
+
Functest docker container directory structure
---------------------------------------------
Inside the Functest docker container, the following directory structure
| `-- results
`-- repos
|-- bgpvpn
+ |-- copper
|-- doctor
+ |-- domino
|-- functest
- |-- odl_integration
+ |-- kingbird
+ |-- moon
+ |-- odl_test
|-- onos
+ |-- ovno
+ |-- parser
|-- promise
|-- rally
|-- releng
- `-- vims-test
+ |-- sdnvpn
+ |-- securityscanning
+ |-- sfc
+ |-- tempest
+ |-- vims_test
+ `-- vnfs
Underneath the '/home/opnfv/' directory, the Functest docker container
includes two main directories:
. |-- INFO
|-- LICENSE
- |-- __init__.py
- |-- ci
- | |-- __init__.py
- | |-- check_os.sh
- | |-- config_functest.yaml
- | |-- exec_test.sh
- | |-- prepare_env.py
- | |-- run_tests.py
- | |-- testcases.yaml
- | |-- tier_builder.py
- | `-- tier_handler.py
- |-- cli
- | |-- __init__.py
- | |-- cli_base.py
- | |-- commands
- | |-- functest-complete.sh
- | `-- setup.py
+ |-- requirements.txt
+ |-- run_unit_tests.sh
+ |-- setup.py
+ |-- test-requirements.txt
|-- commons
| |-- ims
| |-- mobile
|-- docker
| |-- Dockerfile
| |-- config_install_env.sh
- | `-- requirements.pip
+ | `-- docker_remote_api
|-- docs
| |-- com
| |-- configguide
| |-- devguide
| |-- images
+ | |-- internship
| |-- release-notes
| |-- results
| `--userguide
- |-- testcases
- | |-- Controllers
- | |-- OpenStack
- | |-- __init__.py
- | |-- features
- | |-- security_scan
- | `-- vIMS
- `-- utils
+ |-- functest
|-- __init__.py
- |-- functest_logger.py
- |-- functest_utils.py
- |-- openstack_clean.py
- |-- openstack_snapshot.py
- `-- openstack_utils.py
+ |-- ci
+ | |-- __init__.py
+ | |-- check_os.sh
+ | |-- config_functest.yaml
+ | |-- config_patch.yaml
+ | |-- exec_test.sh
+ | |-- generate_report.py
+ | |-- prepare_env.py
+ | |-- run_tests.py
+ | |-- testcases.yaml
+ | |-- tier_builder.py
+ | `-- tier_handler.py
+ |-- cli
+ | |-- __init__.py
+ | |-- cli_base.py
+ | |-- commands
+ | |-- functest-complete.sh
+ | `-- setup.py
+ |-- core
+ | |-- __init__.py
+ | |-- feature_base.py
+ | |-- pytest_suite_runner.py
+ | |-- testcase_base.py
+ | |-- vnf_base.py
+ |-- opnfv_tests
+ | |-- __init__.py
+ | |-- features
+ | |-- mano
+ | |-- openstack
+ | |-- sdn
+ | |-- security_scan
+ | `-- vnf
+ |-- tests
+ | |-- __init__.py
+ | `-- unit
+ `-- utils
+ |-- __init__.py
+ |-- config.py
+ |-- constants.py
+ |-- env.py
+ |-- functest_constants.py
+ |-- functest_logger.py
+ |-- functest_utils.py
+ |-- openstack
+ |-- openstack_clean.py
+ |-- openstack_snapshot.py
+ |-- openstack_tacker.py
+ `-- openstack_utils.py
+
(Note: All *.pyc files removed from above list for brevity...)
-We may distinguish 7 different directories:
+We may distinguish several directories, the first level has 4 directories:
+
+* **commons**: This directory is dedicated for storage of traffic
+ profile or any other test inputs that could be reused by any test
+ project.
+* **docker**: This directory includes the needed files and tools to
+ build the Funtest Docker image.
+* **docs**: This directory includes documentation: Release Notes,
+ User Guide, Configuration Guide and Developer Guide. Test results
+ are also located in a sub--directory called 'results'.
+* **functest**: This directory contains all the code needed to run
+ functest internal cases and OPNFV onboarded feature or VNF test cases.
+Functest directory has 6 directories:
* **ci**: This directory contains test structure definition files
(e.g <filename>.yaml) and bash shell/python scripts used to
configure and execute Functional tests. The test execution script
can be executed under the control of Jenkins CI jobs.
* **cli**: This directory holds the python based Functest CLI utility
source code, which is based on the Python 'click' framework.
- * **commons**: This directory is dedicated for storage of traffic
- profile or any other test inputs that could be reused by any test
- project.
- * **docker**: This directory includes the needed files and tools to
- build the Funtest Docker container image.
- * **docs**: This directory includes documentation: Release Notes,
- User Guide, Configuration Guide and Developer Guide. Test results
- are also located in a sub--directory called 'results'.
- * **testcases**: This directory includes the scripts required by
+ * **core**: This directory holds the python based Functest core
+ source code. Three abstraction classes have been created to ease
+ the integration of internal, feature or vnf cases.
+ * **opnfv_tests**: This directory includes the scripts required by
Functest internal test cases and other feature projects test cases.
+ * **tests**: This directory includes the functest unit tests
* **utils**: this directory holds Python source code for some general
purpose helper utilities, which testers can also re-use in their
own test code. See for an example the Openstack helper utility:
Use the *-f* option if the container is still running, it will force to
destroy it::
- docker -f rm <CONTAINER_ID>
+ docker rm -f <CONTAINER_ID>
Check the Docker documentation dockerdocs_ for more information.
For example, try to use the **nc** command from inside the functest
docker container::
- nc -v google.com 80
- Connection to google.com 80 port [tcp/http] succeeded!
+ nc -v opnfv.org 80
+ Connection to opnfv.org 80 port [tcp/http] succeeded!
- nc -v google.com 443
- Connection to google.com 443 port [tcp/https] succeeded!
+ nc -v opnfv.org 443
+ Connection to opnfv.org 443 port [tcp/https] succeeded!
Note: In a Jumphost node based on the CentOS family OS, the **nc**
commands might not work. You can use the **curl** command instead.
- curl http://www.google.com:80
+ curl http://www.opnfv.org:80
<HTML><HEAD><meta http-equiv="content-type"
.
.
</BODY></HTML>
- curl https://www.google.com:443
+ curl https://www.opnfv.org:443
<HTML><HEAD><meta http-equiv="content-type"
.
.