From 20e5b0bf2a3d3bd41113d1fc026ef952e21014d4 Mon Sep 17 00:00:00 2001 From: Christoph Berg Date: Thu, 21 Jun 2018 15:36:52 +0200 Subject: [PATCH] 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. --- debian/tests/control | 4 ++-- debian/tests/regress | 25 ++++++++++++++++++++++--- 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/debian/tests/control b/debian/tests/control index 6503bc4..a80dad9 100644 --- a/debian/tests/control +++ b/debian/tests/control @@ -1,3 +1,3 @@ -Depends: @, make +Depends: @, make, postgresql Tests: regress -Restrictions: allow-stderr +Restrictions: allow-stderr, needs-root diff --git a/debian/tests/regress b/debian/tests/regress index e903a3a..14f155f 100755 --- a/debian/tests/regress +++ b/debian/tests/regress @@ -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