set -o errexit
set -o pipefail
-# ******************************
-# prepare the env for the tests
-# ******************************
-# clean useless results dir
-# should be done at the end
-# but in case of crash during unit test
-# clean it anyway
-if [ -d "/home/opnfv/functest/results" ]
-then
- sudo rm -rf /home/opnfv/functest
-fi
-
-# TODO clean that...
-# Create log dir if needed
-# log shall be disabled during unit tests
-# fix to be done in Logger
-echo "Create dummy log file...."
-sudo mkdir -p /home/opnfv/functest/results/odl
-sudo touch /home/opnfv/functest/results/functest.log
-sudo touch /home/opnfv/functest/results/odl/stdout.txt
-sudo chmod -Rf a+rw /home/opnfv
-
# Either Workspace is set (CI)
if [ -z $WORKSPACE ]
then
- WORKSPACE="."
+ WORKSPACE=`pwd`
fi
pip install -r $WORKSPACE/test-requirements.txt
pip install $WORKSPACE
+#install releng
+cd $WORKSPACE/../
+git clone https://gerrit.opnfv.org/gerrit/releng
+pip install releng/modules/
+rm -fr releng
+cd $WORKSPACE
+
export CONFIG_FUNCTEST_YAML=$(pwd)/functest/ci/config_functest.yaml
# unit tests
# TODO: remove cover-erase
nosetests --with-xunit \
--with-coverage \
--cover-erase \
+ --cover-tests \
+ --cover-package=functest.cli \
--cover-package=functest.core.testcase_base \
--cover-package=functest.opnfv_tests.sdn.odl.odl \
+ --cover-package=functest.utils \
+ --cover-package=functest.opnfv_tests.openstack.rally \
--cover-xml \
--cover-html \
+ --log-config=$(pwd)/functest/tests/unit/test_logging.ini \
functest/tests/unit
rc=$?
deactivate
-# *******
-# clean
-# *******
-# Clean useless logs
-if [ -d "/home/opnfv/functest/results" ]
-then
- sudo rm -rf /home/opnfv/functest/results
-fi
-
exit $rc