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-15 19:01:46 +01:00
|
|
|
export TZ=UTC # suppress UnknownTimeZoneError('Etc/UTC',)
|
2019-01-30 12:57:32 +01:00
|
|
|
DCS=$1
|
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
|
2019-01-26 21:19:25 +01:00
|
|
|
# JAVA_OPTS need to be set, otherwise zookeeper is not reachable via IPV4
|
|
|
|
sed -i -e 's/#JAVA_OPTS=""/JAVA_OPTS="-Djava.net.preferIPv4Stack=true"/' /etc/default/zookeeper
|
2018-02-06 14:56:37 +01:00
|
|
|
/etc/init.d/zookeeper start
|
2019-01-29 11:22:16 +01:00
|
|
|
# let Java have some more time to startup
|
|
|
|
sleep 5
|
2018-02-06 14:56:37 +01:00
|
|
|
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-10-05 12:06:10 +02:00
|
|
|
$SU "ETCD_UNSUPPORTED_ARCH=386 DCS=$DCS PATH=/usr/lib/postgresql/$(basename ${PG_VERSION})/bin:$PATH behave" || \
|
2018-09-25 15:44:49 +02:00
|
|
|
(for file in $(ls features/output/*_failed/*); do echo "$file:"; cat $file; done && exit 1)
|
2017-09-29 16:27:16 +02:00
|
|
|
done
|