diff --git a/debian/tests/control b/debian/tests/control index 13d85d7..ac205f5 100644 --- a/debian/tests/control +++ b/debian/tests/control @@ -1,3 +1,7 @@ Depends: pgloader, ca-certificates, cl-postmodern, postgresql Tests: ssl Restrictions: allow-stderr, needs-root + +Depends: pgloader, postgresql +Tests: testsuite +Restrictions: allow-stderr diff --git a/debian/tests/testsuite b/debian/tests/testsuite index 5bdccbe..eeb536d 100755 --- a/debian/tests/testsuite +++ b/debian/tests/testsuite @@ -2,8 +2,9 @@ set -eux -pg_virtualenv << EOF - set -eux - cd test - PGSUPERUSER=\$PGUSER make -k all -EOF +case $USER in + root) PGSUPERUSER=postgres ;; + *) PGSUPERUSER=$USER ;; +esac + +PGSUPERUSER=$PGSUPERUSER pg_virtualenv make -C test all diff --git a/test/Makefile b/test/Makefile index f14bd01..3a940ab 100644 --- a/test/Makefile +++ b/test/Makefile @@ -67,6 +67,7 @@ prepare: bossa.sql -dropdb -U $(PGSUPERUSER) pgloader -dropdb -U $(PGSUPERUSER) stocks -dropdb -U $(PGSUPERUSER) ip4r + -createuser -U $(PGSUPERUSER) --superuser `whoami` createdb -U $(PGSUPERUSER) -O `whoami` pgloader createdb -U $(PGSUPERUSER) -O `whoami` stocks createdb -U $(PGSUPERUSER) -O `whoami` ip4r