Commit e68bfc76 authored by Christoph Berg's avatar Christoph Berg

Use PGUSER/PGPASSWORD in debian/tests/connect; unset TMPDIR.

parent 4b43cf99
pgbouncer (1.5.4-4) unstable; urgency=low
* Use PGUSER/PGPASSWORD in debian/tests/connect; unset TMPDIR.
-- Christoph Berg <myon@debian.org> Tue, 18 Jun 2013 13:11:40 +0200
pgbouncer (1.5.4-3) experimental; urgency=low
[ Peter Eisentraut ]
......
......@@ -3,6 +3,9 @@
# autopkgtest script for pgbouncer: starts a pgbouncer instance and connects
# through it to a postgres server running on port 5432
# autopkgtest's TMPDIR is not readable for postgres
unset TMPDIR
if [ -z "$WRAPPED" ]; then
WRAPPED=1 pg_virtualenv $0 "$@"
exit
......@@ -25,13 +28,13 @@ trap cleanup 0 2 3 15
# set up minimal pgbouncer config
sed -i.adt-save -e '/\[databases\]/ apostgres =' /etc/pgbouncer/pgbouncer.ini
cp -a /etc/pgbouncer/userlist.txt /etc/pgbouncer/userlist.txt.adt-save
echo '"postgres" "postgres"' >> /etc/pgbouncer/userlist.txt
echo "\"$PGUSER\" \"$PGPASSWORD\"" >> /etc/pgbouncer/userlist.txt
sed -i.adt-save -e 's/START=0/START=1/' /etc/default/pgbouncer
# start pgbouncer and test connection
/etc/init.d/pgbouncer start
echo "Trying simple SELECT ..."
result=$(PGPASSWORD="postgres" psql -p 6432 -U postgres -d postgres -c "SELECT 1+2" -tA)
result=$(psql -p 6432 -d postgres -c "SELECT 1+2" -tA)
echo "$result"
[ "$result" = "3" ]
echo "Result OK"
......@@ -41,7 +44,7 @@ echo "Trying online restart ..."
echo "SELECT 3+4;"
/etc/init.d/pgbouncer restart > /dev/null
echo "SELECT 5+6;"
) | PGPASSWORD="postgres" psql -p 6432 -U postgres -d postgres -tA > output
) | psql -p 6432 -d postgres -tA > output
[ "$(cat output)" = "7
11" ]
echo "Result OK"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment