From 8bdba99642e9fb2eb0e2302d9b066daf19493401 Mon Sep 17 00:00:00 2001 From: Daniele Varrazzo Date: Tue, 25 Apr 2017 13:23:44 +0100 Subject: [PATCH] Fixed hba configuration to test on PG 10 Use env vars instead of hardcoded PG version to select config options. --- .travis.yml | 1 + regress/travis_prepare.sh | 16 +++++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index ed94cad..2ffb09c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,6 +5,7 @@ sudo: required env: - PGVER=10 + PGTESTING=1 - PGVER=9.6 - PGVER=9.5 - PGVER=9.4 diff --git a/regress/travis_prepare.sh b/regress/travis_prepare.sh index 1656147..dbb1b40 100755 --- a/regress/travis_prepare.sh +++ b/regress/travis_prepare.sh @@ -30,6 +30,12 @@ else # See https://github.com/reorg/pg_repack/issues/63 sudo sed -i "s/main[[:space:]]*$/main ${PGVER}/" \ /etc/apt/sources.list.d/pgdg.list + + if [ "$PGTESTING" != "" ]; then + sudo sed -i "s/trusty-pgdg/trusty-pgdg-testing/" \ + /etc/apt/sources.list.d/pgdg.list + fi + sudo apt-get update sudo apt-get install -y "libpq5=${PGVER}*" "libpq-dev=${PGVER}*" sudo apt-mark hold libpq5 @@ -45,7 +51,15 @@ sudo -u postgres mkdir -p /var/lib/postgresql/testts sudo -u postgres "$PGBIN/psql" \ -c "create tablespace testts location '/var/lib/postgresql/testts'" -if [ $PGVER -eq "10" ]; then +# If the database was not provided by Travis it needs some customization +if [ "$PGTESTING" != "" ]; then + + # Allow local connections with no password + sudo sed -i \ + 's/\(^local[[:space:]]\+all[[:space:]]\+all[[:space:]]\+\).*/\1trust/' \ + "$CONFDIR/pg_hba.conf" + sudo -u postgres "$PGBIN/pg_ctl" -D "$DATADIR" reload + sudo -u postgres "$PGBIN/psql" -c "create user travis superuser" fi