5 # ******************************
6 # prepare the env for the tests
7 # ******************************
8 # clean useless results dir
9 # should be done at the end
10 # but in case of crash during unit test
12 if [ -d "/home/opnfv/functest/results" ]
14 sudo rm -rf /home/opnfv/functest
18 # Create log dir if needed
19 # log shall be disabled during unit tests
20 # fix to be done in Logger
21 echo "Create dummy log file...."
22 sudo mkdir -p /home/opnfv/functest/results/odl
23 sudo touch /home/opnfv/functest/results/functest.log
24 sudo touch /home/opnfv/functest/results/odl/stdout.txt
25 sudo chmod -Rf a+rw /home/opnfv
27 # Either Workspace is set (CI)
37 echo "Running unit tests..."
40 virtualenv $WORKSPACE/functest_venv
41 source $WORKSPACE/functest_venv/bin/activate
43 # install python packages
44 easy_install -U setuptools
46 pip install -r $WORKSPACE/docker/requirements.pip
47 pip install -e $WORKSPACE
49 python $WORKSPACE/setup.py develop
52 # TODO: remove cover-erase
53 # To be deleted when all functest packages will be listed
54 nosetests --with-xunit \
57 --cover-package=functest.core.TestCasesBase \
58 --cover-package=functest.testcases.Controllers.ODL.OpenDaylightTesting \
70 if [ -d "/home/opnfv/functest/results" ]
72 sudo rm -rf /home/opnfv/functest/results