From: John Darrington Date: Tue, 28 Feb 2012 20:47:09 +0000 (+0100) Subject: Postgres test: Create socket in /tmp instead of current directory X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?p=pspp;a=commitdiff_plain;h=0a4544e34a22ea4b20af434d222524eda0f010f6 Postgres test: Create socket in /tmp instead of current directory It seems that some systems do not allow unix domain sockets with long pathnames. This change therefore creates a directory in /tmp using the mktemp command. --- diff --git a/tests/language/data-io/get-data-psql.at b/tests/language/data-io/get-data-psql.at index 9ac5737ac5..163b7e36d6 100644 --- a/tests/language/data-io/get-data-psql.at +++ b/tests/language/data-io/get-data-psql.at @@ -6,14 +6,15 @@ m4_define([INIT_PSQL], export PATH PGDATA=`pwd`/cluster export PGDATA - PGHOST=`pwd` - export PGHOST PGPORT=$PG_PORT export PGPORT + socket_dir=`mktemp -d` + PGHOST="$socket_dir" + export PGHOST AT_CHECK([initdb -A trust], [0], [ignore]) - AT_CHECK([pg_ctl start -w -o "-k `pwd` -h ''"], [0], [ignore]) + AT_CHECK([pg_ctl start -w -o "-k $socket_dir -h ''"], [0], [ignore]) trap 'CLEANUP_PSQL' 0 - AT_CHECK([createdb -h "`pwd`" -p $PG_PORT $PG_DBASE], + AT_CHECK([createdb -h "$socket_dir" -p $PG_PORT $PG_DBASE], [0], [ignore], [ignore]) AT_DATA([populate.sql], [CREATE TABLE empty (a int, b date, c numeric(23, 4)); @@ -115,10 +116,10 @@ m4_define([INIT_PSQL], '01:05:02 UTC-7' ); ]) - AT_CHECK([psql -h "`pwd`" -p $PG_PORT $PG_DBASE < populate.sql], + AT_CHECK([psql -h "$socket_dir" -p $PG_PORT $PG_DBASE < populate.sql], [0], [ignore])]) -m4_define([CLEANUP_PSQL], [pg_ctl stop -W -o "-k `pwd` -h ''"]) +m4_define([CLEANUP_PSQL], [pg_ctl stop -W -o "-k $socket_dir -h ''"]) AT_SETUP([GET DATA /TYPE=PSQL]) INIT_PSQL @@ -126,7 +127,7 @@ INIT_PSQL dnl Test with an ordinary query. AT_CHECK([cat > ordinary-query.sps < empty-result.sps < large-result.sps < get-data.sps <