debian/tests: Use zookeeperd when etcd-server is not available.

This commit is contained in:
Christoph Berg 2018-02-06 14:56:37 +01:00
parent 72fbeb4194
commit 35e242c759
3 changed files with 35 additions and 4 deletions

1
debian/changelog vendored
View file

@ -2,6 +2,7 @@ patroni (1.4.2-2) UNRELEASED; urgency=medium
[ Christoph Berg ]
* debian/tests: Tidy /tmp/pgpass?.
* debian/tests: Use zookeeperd when etcd-server is not available.
-- Debian PostgreSQL Maintainers <pkg-postgresql-public@lists.alioth.debian.org> Sat, 03 Feb 2018 14:09:20 +0100

View file

@ -4,6 +4,7 @@ set -e
export LC_ALL=C.UTF-8
export LANG=C.UTF-8
DCS=etcd
if [ $(id -u) -eq 0 ]
then
@ -11,14 +12,20 @@ then
chmod 777 .
chmod 777 features
SU='su postgres -p -c'
# zookeeper must be started manually (as root)
if ! [ -x /usr/bin/etcd ] && [ -x /etc/init.d/zookeeper ]; then
/etc/init.d/zookeeper start
DCS=zookeeper
fi
else
SU='bash -c'
fi
# clean up afterwards
trap 'rm -f /tmp/pgpass?' 0 2 3 15
trap 'rm -f /tmp/pgpass?; if [ $(id -u) -eq 0 ] && [ -x /etc/init.d/zookeeper ]; then /etc/init.d/zookeeper stop; fi' 0 2 3 15
set -x
for PG_VERSION in /usr/lib/postgresql/*; do
$SU "PATH=/usr/lib/postgresql/$(basename ${PG_VERSION})/bin:$PATH behave"
$SU "DCS=$DCS PATH=/usr/lib/postgresql/$(basename ${PG_VERSION})/bin:$PATH behave"
done

27
debian/tests/control vendored
View file

@ -1,3 +1,26 @@
Depends: @builddeps@, @, python3-behave, python3-coverage, postgresql, etcd-server
Tests: acceptance, test
# runs with etcd or zookeeper (zookeeper needs root, but we can't specify that here if we want to run etcd without root)
Depends:
etcd-server | zookeeperd,
postgresql,
python3-behave,
python3-consul (>= 0.7.0),
python3-etcd (>= 0.4.3),
python3-kazoo,
python3-kubernetes,
@,
Tests: acceptance
Restrictions: allow-stderr
Depends:
python3-boto,
python3-consul (>= 0.7.0),
python3-etcd (>= 0.4.3),
python3-flake8,
python3-kazoo,
python3-kubernetes,
python3-mock,
python3-pytest-cov,
python3-setuptools,
@,
Tests: test
Restrictions: allow-stderr