[check_postgres] [check_postgres-announce] problems running "make test"

Christoph Berg cb at df7cb.de
Thu Apr 18 09:21:54 UTC 2013


Re: Greg Sabino Mullane 2013-04-17 <20130417200818.GK3013 at broken.home>
> On Wed, Apr 17, 2013 at 09:40:01PM +0200, Guillaume Lelarge wrote:
> ...
> > You don't need to be the postgres user, but you surely need to have
> > access to initdb and the psql at the very least.
> 
> Thanks for replying to this Guillaume. Obviously our test suite needs 
> to be a little bit smarter and let the user know that the basic 
> requirements are not met. Anyone want to take a swing at that?

I haven't had time to bring this up here, but I also had trouble
getting the test suite to run. The script to run it at build time of
the Debian package now looks like this:

#!/bin/sh

set -eux

export LC_ALL=C
export PGBINDIR=$(ls -d /usr/lib/postgresql/*/bin | tail -n1)
export PGDATA="test_database_check_postgres/data space"

cleanup () {
	$PGBINDIR/pg_ctl stop || :
	rm -rf test_database_check_postgres*
	rm -f /tmp/cptesting_socket
}
trap cleanup 0 2 3 15
cleanup

mkdir test_database_check_postgres
$PGBINDIR/initdb
usd=$(grep -o 'unix_socket_dir[a-z]*' "$PGDATA/postgresql.conf") # changed between 9.2 and 9.3
echo "$usd = 'socket'" >> "$PGDATA/postgresql.conf"
mkdir "$PGDATA/socket"
echo "max_connections = 10" >> "$PGDATA/postgresql.conf"
$PGBINDIR/pg_ctl start
sleep 3

psql -h localhost -c 'CREATE USER check_postgres_testing SUPERUSER'

make test


... which looks much more complicated than it should be.

Maybe I am missing something, but if the test suite needs specific
socket, max_connections and etc settings, there should probably be
some setup_testsuite script provided with check_postgres. I couldn't
find anything in the docs, though.

Christoph
-- 
cb at df7cb.de | http://www.df7cb.de/


More information about the Check_postgres mailing list