From 94872362c492fa76617e5846dc53680718252e4f Mon Sep 17 00:00:00 2001 From: Thomas Goirand Date: Wed, 18 Mar 2015 23:15:24 +0100 Subject: [PATCH] Enables unit tests. Rewritten-From: c4581f0dccf52a6bc5af62d61cb64c71b3d72046 --- trusty/debian/rules | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/trusty/debian/rules b/trusty/debian/rules index 5f6b700..d2ed0f7 100755 --- a/trusty/debian/rules +++ b/trusty/debian/rules @@ -14,23 +14,21 @@ override_dh_install: dh_install -O--buildsystem=python_distutils install -D -m 0644 etc/neutron_lbaas.conf $(CURDIR)/debian/neutron-lbass/etc/neutron/neutron_lbaas.conf -# Unit tests are disabled, because it expects neutron.conf -# in /usr/lib/python2.7/dist-packages/etc/neutron.conf -#override_dh_auto_test: -#ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS))) -# @echo "===> Running tests" -# set -e ; set -x ; for i in 2.7 ; do \ -# PYMAJOR=`echo $$i | cut -d'.' -f1` ; \ -# echo "===> Testing with python$$i (python$$PYMAJOR)" ; \ -# rm -rf .testrepository ; \ -# testr-python$$PYMAJOR init ; \ -# TEMP_REZ=`mktemp -t` ; \ -# PYTHONPATH=$(CURDIR) PYTHON=python$$i testr-python$$PYMAJOR run --subunit neutron_lbaas.tests.unit | tee $$TEMP_REZ | subunit2pyunit ; \ -# cat $$TEMP_REZ | subunit-filter -s --no-passthrough | subunit-stats ; \ -# rm -f $$TEMP_REZ ; \ -# testr-python$$PYMAJOR slowest ; \ -# done -#endif +override_dh_auto_test: +ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS))) + @echo "===> Running tests" + set -e ; set -x ; for i in 2.7 ; do \ + PYMAJOR=`echo $$i | cut -d'.' -f1` ; \ + echo "===> Testing with python$$i (python$$PYMAJOR)" ; \ + rm -rf .testrepository ; \ + testr-python$$PYMAJOR init ; \ + TEMP_REZ=`mktemp -t` ; \ + PYTHONPATH=$(CURDIR) PYTHON=python$$i testr-python$$PYMAJOR run --subunit neutron_lbaas.tests.unit | tee $$TEMP_REZ | subunit2pyunit ; \ + cat $$TEMP_REZ | subunit-filter -s --no-passthrough | subunit-stats ; \ + rm -f $$TEMP_REZ ; \ + testr-python$$PYMAJOR slowest ; \ + done +endif override_dh_auto_clean: dh_auto_clean -- 2.45.2