User Tools

Site Tools


functest_docker

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
functest_docker [2015/10/07 11:39]
Jose Lausuch
functest_docker [2015/11/27 13:42] (current)
Morgan Richomme
Line 54: Line 54:
     * INSTALLER_IP. Usually "​10.20.0.2"​ for fuel and "​172.30.10.73"​ foreman.     * INSTALLER_IP. Usually "​10.20.0.2"​ for fuel and "​172.30.10.73"​ foreman.
  
-  $ docker run -ti -e "​INSTALLER_TYPE=fuel"​ -e "​INSTALLER_IP=10.20.0.2"​ opnfv/​functest+  $ docker run -ti -e "​INSTALLER_TYPE=fuel"​ -e "​INSTALLER_IP=10.20.0.2" -e "​NODE_NAME=opnfv-jump-2" opnfv/​functest 
 + 
 +note: for the dev labs, it is also possible to precise the path of your openstack creds, see [[https://​wiki.opnfv.org/​functest_docker#​docker_options |Docker Options below]] 
  
 Now, you are inside the docker container. ​ Now, you are inside the docker container. ​
 ----  ​ ----  ​
-  * Run the script to install functest environment ​and start the tests.+  * Run the script to install functest environment
  
-  $ {repos_dir}/​functest/​docker/​start.sh+  ​${repos_dir}/​functest/​docker/​prepare_env.sh
  
 +
 +NOTE: ${repos_dir} is a default environment variable inside the docker container, which points to /​home/​opnfv/​repos
 +
 +  * Run the script to start the tests
 +
 +  $ ${repos_dir}/​functest/​docker/​run_tests.sh
 +  ​
 NOTE: This will run ALL the tests we have for SR1: NOTE: This will run ALL the tests we have for SR1:
    * vPing test case    * vPing test case
    * ODL suite    * ODL suite
-   * Rally benchmark (this will take long) <--- need to change ​something ​to run only 1 set of tests and not all (see below)+   * Rally benchmark (this will take long) <- in case you needchange ​a line to run only 1 set of tests and not all (see [[#​rally_suites|run_tests.sh options]] ​below)
    * Tempest    * Tempest
- 
----- 
----- 
-* In order to run only 1 suite of Rally bench, you need to modify the call to rally within start.sh script: 
- 
-  $ vi {repos_dir}/​functest/​docker/​start.sh 
-  (go to line 126) 
-  python ${FUNCTEST_REPO_DIR}/​testcases/​VIM/​OpenStack/​CI/​libraries/​run_rally.py --debug ${FUNCTEST_REPO_DIR}/​ all 
-  Change "​all"​ to "​keystone"​ for example: 
-  python ${FUNCTEST_REPO_DIR}/​testcases/​VIM/​OpenStack/​CI/​libraries/​run_rally.py --debug ${FUNCTEST_REPO_DIR}/​ glance 
-  Other options are: 
-  - ['​authenticate',​ '​glance',​ '​cinder',​ '​heat',​ '​keystone',​ '​neutron',​ '​nova',​ '​quotas',​ '​requests',​ '​vm',​ '​tempest',​ '​all',​ '​smoke'​] 
- 
- 
  
  
Line 95: Line 91:
   ​   ​
   # Run Functest (example for Fuel)   # Run Functest (example for Fuel)
 +  $ cmd1 = "/​home/​opnfv/​repos/​functest/​docker/​prepare_env.sh"​
 +  $ cmd2 = "/​home/​opnfv/​repos/​functest/​docker/​run_tests.sh"​
   $ docker run -t -e "​INSTALLER_TYPE=fuel"​ -e "​INSTALLER_IP=10.20.0.2"​ opnfv/​functest \   $ docker run -t -e "​INSTALLER_TYPE=fuel"​ -e "​INSTALLER_IP=10.20.0.2"​ opnfv/​functest \
-   "​/​home/​opnfv/​repos/​functest/​docker/​start.sh+   "​${cmd1} && ${cmd2}
-  + 
 NOTE: the output will be shown on the screen until you press ^C. To attach to the docker output again type: NOTE: the output will be shown on the screen until you press ^C. To attach to the docker output again type:
  
Line 103: Line 102:
   $ docker attach <​ID_of_the_container>​   $ docker attach <​ID_of_the_container>​
  
 +===== Docker options =====
 +==== I need to change some parameters in config_functest.yaml ====
 +In case you need to provide different configuration parameters to Functest (e.g. commit IDs or branches for the repositories,​ ...) copy the config_functest.yaml from the repository to your current directory and run docker with a volume:
 +  $ wget https://​git.opnfv.org/​cgit/​functest/​plain/​testcases/​config_functest.yaml
 +  $ cmd1 = "/​home/​opnfv/​repos/​functest/​docker/​prepare_env.sh"​
 +  $ cmd2 = "/​home/​opnfv/​repos/​functest/​docker/​run_tests.sh"​
 +  $ docker run -t -e "​INSTALLER_TYPE=fuel"​ -e "​INSTALLER_IP=10.20.0.2"​ opnfv/​functest \
 +    -v $(pwd)/​config_functest.yaml:/​home/​opnfv/​functest/​conf/​config_functest.yaml \
 +    "​${cmd1} && ${cmd2}"​
  
  
 +==== I don't use the default OpenStack credentials ====
 +You can also provide your own OpenStack credentials to the container. This way, it will not try to fetch the credentials automatically contacting the OS controller.
 +
 +If you do this, you don't need to specify any more the environment variables INSTALLER_TYPE and INSTALLER_IP,​ since they are used only by the script that gets the credentials automatically (a script called fetch_os_credentials.sh).
 +  $ docker run -t opnfv/​functest \
 +    -v $(pwd)/<​your_local_creds_file>:/​home/​opnfv/​functest/​conf/​openstack.creds \
 +    "​${cmd1} && ${cmd2}"​
 +
 +For more info: https://​gerrit.opnfv.org/​gerrit/#/​c/​3073/​
 +
 +This is recommended if you don't install OPNFV with the default OpenStack credentials.
 +
 +
 +===== run_tests.sh options =====
 +==== give test name as input ====
 +You can tell run_tests.sh to run only the tests you desire. To do that, add the flag "-t or --test"​ plus the name of the available tests separated by comas. ​
 +
 +Example:
 +
 +  $ ${repos_dir}/​functest/​docker/​run_tests.sh --test vping,odl
 +  Possible options are:
 +  ['​vping','​odl','​tempest','​rally'​]
 +
 +----
 +
 +==== Rally suites ====
 +In order to run only 1 suite of Rally bench, you need to modify the call to rally within run_tests.sh script:
 +
 +  $ vi ${repos_dir}/​functest/​docker/​run_tests.sh
 +  (go to line 68 or search the following line)
 +  python ${FUNCTEST_REPO_DIR}/​testcases/​VIM/​OpenStack/​CI/​libraries/​run_rally.py --debug ${FUNCTEST_REPO_DIR}/​ all
 +  Change "​all"​ to "​keystone"​ for example:
 +  python ${FUNCTEST_REPO_DIR}/​testcases/​VIM/​OpenStack/​CI/​libraries/​run_rally.py --debug ${FUNCTEST_REPO_DIR}/​ glance
 +  Other options are: 
 +  ['​authenticate',​ '​glance',​ '​cinder',​ '​ceilometer',​ '​heat',​ '​keystone',​ '​neutron',​ '​nova',​ '​quotas',​ '​requests',​ '​vm',​ '​all'​]
 +
 +
 +
 +
 +
 +===== Offline Functest =====
   ​   ​
 +Follow the steps described previously, but when running the scripts within the docker, add the flag - -offline. ​
 +
 +   $ cmd1 = "/​home/​opnfv/​repos/​functest/​docker/​prepare_env.sh --offline"​
 +   $ cmd2 = "/​home/​opnfv/​repos/​functest/​docker/​run_tests.sh --offline"​
 +   $ docker run -t -e "​INSTALLER_TYPE=fuel"​ -e "​INSTALLER_IP=10.20.0.2"​ opnfv/​functest \
 +   "​${cmd1} && ${cmd2}"​
 +  ​
 +IMPORTANT: This is still under test! And probably some things need to be updated to be completely offline.
 +
 +
 +
functest_docker.1444217987.txt.gz · Last modified: 2015/10/07 11:39 by Jose Lausuch