Clone
8
functest docker setup
wluhan edited this page 2016-08-24 10:58:36 +02:00

Prepare docker environment

You can refer here to install docker engine on your host machine.

Download Latest Functest

When running functest, you need to give it some information of your OpNFV. We set following environment vars:

env_vars="-e INSTALLER_TYPE=fuel -e INSTALLER_IP=10.20.0.2 -e DEPLOY_SCENARIO=os-nosdn-nofeature-noha"
result_vol="-v {your_path}/results:/home/opnfv/functest/results"

Download and run functest in docker image:

sudo docker run -id --privileged=true --name functest_demo $env_vars $results_vol opnfv/functest

Log into the docker container:

sudo docker exec -ti functest_demo /bin/bash

When you log in, it should be like this:

image

Prepare env

Before running functest, you need to prepare the environment firstly. Run the following command:

functest env prepare

When it is done, it should appear like this:

image

Type functest testcase list to show what tests can be executed.

You can run a test like this:

functest testcase run vping_ssh

When it is finished, it should be like this:

image

All the test case codes are located at /home/opnfv/repos/functest/testcases, you can refer to them to create your own test cases.

-----------------------OBSOLETE----------------------

Download Functest

When running functest, you need to give it some information of your OpNFV. We set following environment vars:

env_vars="-e INSTALLER_TYPE=fuel -e INSTALLER_IP=10.20.0.2 -e DEPLOY_SCENARIO=os-nosdn-nofeature-noha"
result_vol="-v {your_path}/results:/home/opnfv/functest/results"

Download and run functest in docker image:

sudo docker run -id --privileged=true --name functest_demo $env_vars $results_vol opnfv/functest:brahmaputra

Log into the docker container:

sudo docker exec -ti functest_demo /bin/bash

When you log in, it should be like this:

image

Prepare env

Run the script prepare_env.sh, located at /home/opnfv/repos/functest/docker. You might fail at the first time, after you run the first time, it will create a credentials file located at :/home/opnfv/functest/conf/openstack.creds.

Change the line: export OS_AUTH_URL='http://192.168.0.2:5000/' to export OS_AUTH_URL='http://192.168.0.2:5000/v2.0' And also remember to change the default settings to yours accordingly. Be careful, OS_USERNAME, and OS_PASSWORD is username and password of openstack, not fuel.

Run prepare_env.sh again, it will pass.

Then you will be able to run functest, for example:

cd /home/opnfv/repos/functest/docker
./run_tests.sh -t vping_ssh

When it is finished, it should be like this:

image