2017-09-15 15:24:59 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2017-09-23 09:04:11 +02:00
|
|
|
export LC_ALL=C.UTF-8
|
|
|
|
export LANG=C.UTF-8
|
2018-02-06 14:56:37 +01:00
|
|
|
DCS=etcd
|
2017-09-23 09:04:11 +02:00
|
|
|
|
|
|
|
if [ $(id -u) -eq 0 ]
|
|
|
|
then
|
2018-02-06 11:41:42 +01:00
|
|
|
# required so that the postgres user can create .coverage* and features/output/
|
2017-09-23 09:04:11 +02:00
|
|
|
chmod 777 .
|
|
|
|
chmod 777 features
|
|
|
|
SU='su postgres -p -c'
|
2018-02-06 14:56:37 +01:00
|
|
|
|
|
|
|
# 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
|
2017-09-23 09:04:11 +02:00
|
|
|
else
|
|
|
|
SU='bash -c'
|
|
|
|
fi
|
2017-09-15 15:24:59 +02:00
|
|
|
|
2018-02-06 11:41:42 +01:00
|
|
|
# clean up afterwards
|
2018-02-06 14:56:37 +01:00
|
|
|
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
|
2018-02-06 11:41:42 +01:00
|
|
|
|
|
|
|
set -x
|
2017-09-29 16:27:16 +02:00
|
|
|
for PG_VERSION in /usr/lib/postgresql/*; do
|
2018-02-06 14:56:37 +01:00
|
|
|
$SU "DCS=$DCS PATH=/usr/lib/postgresql/$(basename ${PG_VERSION})/bin:$PATH behave"
|
2017-09-29 16:27:16 +02:00
|
|
|
done
|