X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;f=xenial%2Fdebian%2Frules;h=b17160a3d2495829bb3d585ca39c399c754c0bba;hb=b7ba3250cedf69a6f35c3a4411bf304a966fa0c7;hp=60bf97e9e60a0b753ddeb0716a4781f690057676;hpb=ce80e2e8821a4b400818acca5a74e8aab9bcb90c;p=openstack-build%2Fceilometer-build.git diff --git a/xenial/debian/rules b/xenial/debian/rules index 60bf97e..b17160a 100755 --- a/xenial/debian/rules +++ b/xenial/debian/rules @@ -7,19 +7,27 @@ include /usr/share/openstack-pkg-tools/pkgos.make export OSLO_PACKAGE_VERSION=$(VERSION) %: - dh $@ --with python2 + dh $@ --with python2,systemd override_dh_clean: dh_clean + rm -rf .testrepository rm -rf ceilometer.egg-info rm -f debian/ceilometer-common.config debian/ceilometer-common.postinst debian/ceilometer-api.config debian/ceilometer-api.postinst override_dh_install: - dh_install - install -D -m 0644 $(CURDIR)/etc/ceilometer/ceilometer.conf.sample $(CURDIR)/debian/ceilometer-common/usr/share/ceilometer-common/ceilometer.conf - install -D -m 0644 $(CURDIR)/etc/ceilometer/policy.json $(CURDIR)/debian/ceilometer-common/usr/share/ceilometer-common/policy.json - install -D -m 0644 $(CURDIR)/etc/ceilometer/sources.json $(CURDIR)/debian/ceilometer-common/usr/share/ceilometer-common/sources.json - install -D -m 0644 $(CURDIR)/etc/ceilometer/pipeline.yaml $(CURDIR)/debian/ceilometer-common/usr/share/ceilometer-common/pipeline.yaml + dh_install --fail-missing + + # Manage ceilometer.conf + mkdir -p $(CURDIR)/debian/ceilometer-common/usr/share/ceilometer-common + oslo-config-generator --output-file $(CURDIR)/debian/ceilometer-common/usr/share/ceilometer-common/ceilometer.conf \ + --namespace ceilometer \ + --namespace oslo.db \ + --namespace oslo.messaging \ + --namespace keystonemiddleware.auth_token + sed -i 's|[# \t]*auth_protocol[\t ]*=.*|auth_protocol=http|' $(CURDIR)/debian/ceilometer-common/usr/share/ceilometer-common/ceilometer.conf + chmod 0644 $(CURDIR)/debian/ceilometer-common/usr/share/ceilometer-common/ceilometer.conf + sed -i 's|#connection=.*|connection=mongodb://localhost:27017/ceilometer|' $(CURDIR)/debian/ceilometer-common/usr/share/ceilometer-common/ceilometer.conf override_dh_auto_build: dh_auto_build @@ -34,9 +42,14 @@ override_dh_auto_clean: rm -rf debian/ceilometer-common.postinst find . -iname '*.pyc' -delete -ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS))) override_dh_auto_test: - bash -x ./setup-test-env.sh python setup.py testr --slowest || true - #./run-tests.sh || true - #PYTHONPATH=. nosetests -P || true +ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS))) + rm -rf .testrepository + testr init + set -e && \ + TEMP_REZ=`mktemp -t` && \ + bash -x ./setup-test-env-mongodb.sh testr run --subunit 'tests\.(?!.*test_bin.*)' | tee $$TEMP_REZ | subunit2pyunit || true ; \ + cat $$TEMP_REZ | subunit-filter -s --no-passthrough | subunit-stats || true ; \ + rm -f $$TEMP_REZ ; + testr slowest endif