debian/tests: Depend on postgresql, and run test as root

Prepare to test SSL connections, but do not exercise the test yet,
cl-plus-ssl is still broken.
This commit is contained in:
Christoph Berg 2018-06-21 15:36:52 +02:00
parent 7d8ac3b352
commit 20e5b0bf2a
2 changed files with 24 additions and 5 deletions

View File

@ -1,3 +1,3 @@
Depends: @, make
Depends: @, make, postgresql
Tests: regress
Restrictions: allow-stderr
Restrictions: allow-stderr, needs-root

25
debian/tests/regress vendored
View File

@ -1,11 +1,30 @@
#!/bin/sh
# test needs root so we have a SSL certificate
set -eux
cd test
pg_virtualenv << EOF
pg_virtualenv <<-'EOF'
set -eux
# force SSL connection
HBA=$(psql -XAtc 'SHOW hba_file')
sed -i -e 's/^host/hostssl/' $HBA
psql -XAtc 'SELECT pg_reload_conf()'
createdb pgloader
psql -d pgloader -c 'create schema expected'
make regress REGRESS=allcols.load PGHOST=::1
export PGDATABASE=pgloader
psql -XAtc 'create schema expected'
# test SSL connection
rm -rf /tmp/pgloader
#disabled until cl-plus-ssl is fixed:
#make regress REGRESS=allcols.load PGHOST=localhost
# test UNIX socket
rm -rf /tmp/pgloader
chmod 777 regress/out
unset PGHOST
su -c 'make regress REGRESS=allcols.load' postgres
EOF