5 function clean_results_dir {
6 if [ -d "/home/opnfv/functest/results" ]
8 sudo rm -rf /home/opnfv/functest/results
12 # ******************************
13 # prepare the env for the tests
14 # ******************************
15 # clean useless results dir
16 # should be done at the end
17 # but in case of crash during unit test
22 # Create log dir if needed
23 # log shall be disabled during unit tests
24 # fix to be done in Logger
25 echo "Create dummy log file...."
26 sudo mkdir -p /home/opnfv/functest/results/odl
27 sudo touch /home/opnfv/functest/results/functest.log
28 sudo touch /home/opnfv/functest/results/odl/stdout.txt
29 sudo chmod -Rf a+rw /home/opnfv
31 # Either Workspace is set (CI)
41 echo "Running unit tests..."
44 virtualenv $WORKSPACE/functest_venv
45 source $WORKSPACE/functest_venv/bin/activate
47 # install python packages
48 sudo apt-get install -y build-essential python-dev python-pip
49 pip install --upgrade pip
50 pip install -r $WORKSPACE/test-requirements.txt
51 pip install $WORKSPACE
53 export CONFIG_FUNCTEST_YAML=$(pwd)/functest/ci/config_functest.yaml
55 # TODO: remove cover-erase
56 # To be deleted when all functest packages will be listed
57 nosetests --with-xunit \
61 --cover-package=functest.core.testcase_base \
62 --cover-package=functest.opnfv_tests.sdn.odl.odl \