pgpool2.git / summary / log / commit / refs
commit 79fdc6f709728e5b9e7ecf55665aa51a5cfa67af
Author: Tatsuo Ishii <ishii@postgresql.org>
Date: Fri Jul 26 05:51:26 2013 +0000
Enhance pgpool_setup and regression test suite.
Patch contributed by Muhammad Usama. Below is the comment from him:
I tried to make some changes in the regression script, mainly because the
script uses lot of hard coded paths and regression starts reporting
failures if the pgpool-II or PostgreSQL are not found at the default path.
Please find the attached patch which enables the regress.sh script to
install the pgpool on fly in temp directory to run the tests on it
(optional), and now the regress script takes some additional arguments to
specify the paths of required components.
The list of all arguments accepted by regress.sh script as implemented by
the attached patch are
pgpool2/test/regression$ sh regress.sh -?
Usage:
regress.sh: [Options]... [test_name]
Options:
-p DIRECTORY Postgres installed directory
-b DIRECTORY pgbench installed directory, if different from
Postgres installed directory
-i DIRECTORY pgpool installed directory, if already installed
pgpool is to be used for tests
-m install/noinstall make install pgpool to temp directory for
executing regression tests [Default: install]
-j FILE Postgres jdbc jar file path
-? print this help and then exit
test/pgpool_setup | 19 ++--
test/regression/README | 15 ++-
test/regression/clean.sh | 1 +
test/regression/regress.sh | 122 ++++++++++++++++++++-
test/regression/tests/001.load_balance/test.sh | 5 +-
.../tests/002.native_replication/test.sh | 13 ++-
test/regression/tests/003.failover/test.sh | 8 +-
test/regression/tests/004.watchdog/test.sh | 2 +-
test/regression/tests/050.bug58/test.sh | 6 +-
test/regression/tests/051.bug60/test.sh | 8 +-
test/regression/tests/052.do_query/test.sh | 8 +-
.../regression/tests/053.insert_lock_hangs/test.sh | 8 +-
test/regression/tests/054.postgres_fdw/test.sh | 10 +-
test/regression/tests/056.bug63/test.sh | 6 +-
test/regression/tests/057.bug61/test.sh | 5 +-
15 files changed, 190 insertions(+), 46 deletions(-)
diff --git a/test/pgpool_setup b/test/pgpool_setup
index 59986836d..1922638f9 100755
--- a/test/pgpool_setup
+++ b/test/pgpool_setup
@@ -54,7 +54,7 @@ BASEPORT=11000
# Default number of PostgreSQL database clusters
NUMCLUSTERS=2
# Where to look for pgpool.conf.sample*
-PGPOOLDIR=/usr/local/etc
+PGPOOLDIR=$PGPOOL_INSTALL_DIR/etc
# LD_LIBRARY_PATH
LPATH=/usr/local/pgsql/lib
# initdb args
@@ -70,7 +70,6 @@ WHOAMI=`whoami`
BASEDIR=`pwd`
# PostgreSQL bin directory
-PGBIN=`pg_config --bindir` || (echo "$0: cannot locate pg_config";exit 1)
INITDB=$PGBIN/initdb
PG_CTL=$PGBIN/pg_ctl
PSQL=$PGBIN/psql
@@ -667,10 +666,10 @@ echo "LD_LIBRARY_PATH=$LPATH" > $STARTALL
echo 'dir=`pwd`' >> $STARTALL
chmod 755 $STARTALL
echo 'dir=`pwd`' > $SHUTDOWNALL
-echo 'pgpool -f $dir/etc/pgpool.conf -m f stop' >> $SHUTDOWNALL
+echo '$PGPOOL_INSTALL_DIR/bin/pgpool -f $dir/etc/pgpool.conf -m f stop' >> $SHUTDOWNALL
chmod 755 $SHUTDOWNALL
echo 'dir=`pwd`' > $PGPOOL_RELOAD
-echo 'pgpool -f $dir/etc/pgpool.conf reload' >> $PGPOOL_RELOAD
+echo '$PGPOOL_INSTALL_DIR/bin/pgpool -f $dir/etc/pgpool.conf reload' >> $PGPOOL_RELOAD
chmod 755 $PGPOOL_RELOAD
#-------------------------------------------
@@ -738,15 +737,15 @@ echo "pid_file_name = '$BASEDIR/run/pgpool.pid'" >> $CONF
test ! -d log && mkdir log
echo "logdir = '$BASEDIR/log'" >> $CONF
-echo 'pgpool -D -n -f $dir/etc/pgpool.conf -F $dir/etc/pcp.conf -a $dir/etc/pool_hba.conf > $dir/log/pgpool.log 2>&1 &' >> $STARTALL
+echo '$PGPOOL_INSTALL_DIR/bin/pgpool -D -n -f $dir/etc/pgpool.conf -F $dir/etc/pcp.conf -a $dir/etc/pool_hba.conf > $dir/log/pgpool.log 2>&1 &' >> $STARTALL
# create pcp.conf
cp $PGPOOLDIR/pcp.conf.sample etc/pcp.conf
echo -n "${WHOAMI}:" >> etc/pcp.conf
-pg_md5 $WHOAMI >> etc/pcp.conf
+$PGPOOL_INSTALL_DIR/bin/pg_md5 $WHOAMI >> etc/pcp.conf
# create pool_passwd
-pg_md5 -m -f etc/pgpool.conf -u $WHOAMI $WHOAMI
+$PGPOOL_INSTALL_DIR/bin/pg_md5 -m -f etc/pgpool.conf -u $WHOAMI $WHOAMI
# create archive directory
mkdir archivedir
@@ -777,7 +776,7 @@ EOF
# temporarily start pgpool
echo "temporarily start pgpool-II to create standby nodes"
- pgpool -D -n -f $BASEDIR/etc/pgpool.conf -F $BASEDIR/etc/pcp.conf -a $BASEDIR/etc/pool_hba.conf > $BASEDIR/log/pgpool.log 2>&1 &
+ $PGPOOL_INSTALL_DIR/bin/pgpool -D -n -f $BASEDIR/etc/pgpool.conf -F $BASEDIR/etc/pcp.conf -a $BASEDIR/etc/pool_hba.conf > $BASEDIR/log/pgpool.log 2>&1 &
wait_for_pgpool_startup
@@ -795,7 +794,7 @@ EOF
echo "backend_data_directory$n = '$CLUSTERDIR'" >> $CONF
n=`expr $n + 1`
done
- pgpool -f $BASEDIR/etc/pgpool.conf reload
+ $PGPOOL_INSTALL_DIR/bin/pgpool -f $BASEDIR/etc/pgpool.conf reload
fi
wait_for_pgpool_reload $NUMCLUSTERS
@@ -806,7 +805,7 @@ $PSQL -p $PGPOOL_PORT -c "show pool_nodes" test
while [ $n -lt $NUMCLUSTERS ]
do
echo -n "recovery node $n..."
- pcp_recovery_node 1 localhost $PCP_PORT $WHOAMI $WHOAMI $n
+ $PGPOOL_INSTALL_DIR/bin/pcp_recovery_node 1 localhost $PCP_PORT $WHOAMI $WHOAMI $n
echo "done."
n=`expr $n + 1`
if [ $n -lt $NUMCLUSTERS ];then
diff --git a/test/regression/README b/test/regression/README
index da54c594d..1ae68707c 100644
--- a/test/regression/README
+++ b/test/regression/README
@@ -7,7 +7,8 @@ To execute regress.sh you need to install:
- perl PostgreSQL interface
- other tools or libraries required in each test cases
-regress.sh: the regression test driver. To execute the test, type "sh regression.sh".
+regress.sh: the regression test driver. To execute the test, type "sh regress.sh".
+ To get the lists of arguments accepted by regress.sh type "sh regress.sh -?"
clean.sh: remove files including PostgreSQL DB clusters created by regress.sh.
@@ -19,10 +20,20 @@ tests: test scripts live here. Each test case has its own
create a shell script under this.
The test name "001.*" to "050.*" is for regular regression
- tests, while after "051.*" are for bugs.
+ tests, while after "051.*" are for bugs.
+
+ regress.sh exports following environment variables which can be
+ used by test scripts.
+
+ PGPOOL_SETUP file path of pgpool_setup file
+ PGPOOL_INSTALL_DIR pgpool-II installed directory
+ PGBIN directory path containing PostgreSQL binaries
+ JDBC_DRIVER file path of JDBC driver
+
log: any output of the test files above is created under the
directory. The log file name is same as the test name.
libs.sh: contains some useful bash functions. The file name is
exported as "$TESTLIBS",
+
diff --git a/test/regression/clean.sh b/test/regression/clean.sh
index d710eb33e..baecf653e 100644
--- a/test/regression/clean.sh
+++ b/test/regression/clean.sh
@@ -6,6 +6,7 @@ export PGPOOL_SETUP=$HOME/bin/pgpool_setup
log=$dir/log
rm -fr $log
+rm -fr $dir/temp
cd tests
dirs=`ls`
diff --git a/test/regression/regress.sh b/test/regression/regress.sh
index 1aa4b5078..7427be6ad 100644
--- a/test/regression/regress.sh
+++ b/test/regression/regress.sh
@@ -2,14 +2,126 @@
# pgpool-II regression test driver.
#
# usage: regress.sh [test_name]
+# -i install directory of pgpool
+# -p installation path of Postgres
+# -m install (install pgpool-II and use that for tests) / noinstall : Default install
+
dir=`pwd`
-export TESTLIBS=$dir/libs.sh
-export PGPOOL_SETUP=$HOME/bin/pgpool_setup
-export PSQL=psql
+MODE=install
+PGPOOL_PATH=/usr/local
+JDBC_DRIVER=/usr/local/pgsql/share/postgresql-9.2-1002.jdbc4.jar
log=$dir/log
fail=0
ok=0
+CRED=$(tput setaf 1)
+CGREEN=$(tput setaf 2)
+CBLUE=$(tput setaf 4)
+CNORM=$(tput sgr0)
+
+
+function install_pgpool
+{
+ echo "creating pgpool-II temporary installation ..."
+ PGPOOL_PATH=$dir/temp/installed
+
+ make install -C $dir/../../ -e prefix=${PGPOOL_PATH}
+
+ echo "moving pgpool_setup to temporary installation path ..."
+ cp $dir/../pgpool_setup ${PGPOOL_PATH}/pgpool_setup
+ export PGPOOL_SETUP=$PGPOOL_PATH/pgpool_setup
+}
+
+function verify_pginstallation
+{
+ # PostgreSQL bin directory
+ PGBIN=`$PG_INSTALL_DIR/pg_config --bindir` || (echo "$0: cannot locate pg_config";exit 1)
+}
+
+function export_env_vars
+{
+ if [[ -z "$PGPOOL_PATH" ]]; then
+ # check if pgpool is in the path
+ PGPOOL_PATH=/usr/local
+ export PGPOOL_SETUP=$HOME/bin/pgpool_setup
+ fi
+
+ if [[ -z "$PGBENCH_DIR" ]]; then
+ PGBENCH_DIR=`which pgbench`
+ if [[ -z "$PGBENCH_DIR" ]]; then
+ PGBENCH_DIR=$PGBIN
+ fi
+ fi
+
+ echo "using pgpool-II at "$PGPOOL_PATH
+ export PGPOOL_INSTALL_DIR=$PGPOOL_PATH
+
+ export TESTLIBS=$dir/libs.sh
+ export PGBIN=$PGBIN
+ export JDBC_DRIVER=$JDBC_DRIVER
+ export PGBENCH_DIR=$PGBENCH_DIR
+}
+function print_info
+{
+ echo ${CBLUE}"*************************"${CNORM}
+
+ echo "REGRESSION MODE : "${CBLUE}$MODE${CNORM}
+ echo "PGPOOL-II : "${CBLUE}$PGPOOL_PATH${CNORM}
+ echo "PostgreSQL bin : "${CBLUE}$PGBIN${CNORM}
+ echo "pgbench : "${CBLUE}$PGBENCH_DIR${CNORM}
+ echo "PostgreSQL jdbc : "${CBLUE}$JDBC_DRIVER${CNORM}
+ echo ${CBLUE}"*************************"${CNORM}
+}
+
+function print_usage
+{
+ printf "Usage:\n"
+ printf " %s: [Options]... [test_name]\n" $(basename $0) >&2
+ printf "\nOptions:\n"
+ printf " -p DIRECTORY Postgres installed directory\n" >&2
+ printf " -b DIRECTORY pgbench installed directory, if different from Postgres installed directory\n" >&2
+ printf " -i DIRECTORY pgpool installed directory, if already installed pgpool is to be used for tests\n" >&2
+ printf " -m install/noinstall make install pgpool to temp directory for executing regression tests [Default: install]\n" >&2
+ printf " -j FILE Postgres jdbc jar file path\n" >&2
+ printf " -? print this help and then exit\n\n" >&2
+ printf "Please read the README for details on adding new tests\n" >&2
+
+}
+
+trap "echo ; exit 0" SIGINT SIGQUIT
+
+while getopts "p:m:i:j:b:?" OPTION
+do
+ case $OPTION in
+ p) PG_INSTALL_DIR="$OPTARG";;
+ m) MODE="$OPTARG";;
+ i) PGPOOL_INSTALL_DIR="$OPTARG";;
+ j) JDBC_DRIVER="$OPTARG";;
+ b) PGBENCH_DIR="$OPTARG";;
+ ?) print_usage
+ exit 2;;
+ esac
+done
+
+shift $(($OPTIND - 1))
+if [ "$MODE" = "install" ]; then
+ install_pgpool
+
+elif [ "$MODE" = "noinstall" ]; then
+ echo not installing pgpool for the tests ...
+ if [[ -n "$PGPOOL_INSTALL_PATH" ]]; then
+ PGPOOL_PATH=$PGPOOL_INSTALL_PATH
+ fi
+else
+ echo $MODE : Invalid mode
+ exit -1
+fi
+
+verify_pginstallation
+export_env_vars
+print_info
+
+#Start executing tests
rm -fr $log
mkdir $log
@@ -27,10 +139,10 @@ do
echo -n "testing $i..."
./test.sh > $log/$i 2>&1
if [ $? = 0 ];then
- echo "ok."
+ echo ${CGREEN}"ok."${CNORM}
ok=`expr $ok + 1`
else
- echo "failed."
+ echo ${CRED}"failed."${CNORM}
fail=`expr $fail + 1`
fi
diff --git a/test/regression/tests/001.load_balance/test.sh b/test/regression/tests/001.load_balance/test.sh
index c563fc5bc..23e5a2118 100755
--- a/test/regression/tests/001.load_balance/test.sh
+++ b/test/regression/tests/001.load_balance/test.sh
@@ -4,6 +4,7 @@
#
source $TESTLIBS
TESTDIR=testdir
+PSQL=$PGBIN/psql
for mode in s r
do
@@ -28,7 +29,7 @@ do
wait_for_pgpool_startup
- psql test <<EOF
+ $PSQL test <<EOF
CREATE TABLE t1(i INTEGER);
CREATE FUNCTION f1(INTEGER) returns INTEGER AS 'SELECT \$1' LANGUAGE SQL;
SELECT * FROM t1; -- this load balances
@@ -56,7 +57,7 @@ EOF
./pgpool_reload
- psql test <<EOF
+ $PSQL test <<EOF
SELECT f1(1); -- this does load balance
EOF
diff --git a/test/regression/tests/002.native_replication/test.sh b/test/regression/tests/002.native_replication/test.sh
index 491fa34e7..1123de5a5 100755
--- a/test/regression/tests/002.native_replication/test.sh
+++ b/test/regression/tests/002.native_replication/test.sh
@@ -4,6 +4,9 @@
#
source $TESTLIBS
TESTDIR=testdir
+PSQL=$PGBIN/psql
+PGBENCH=$PGBENCH_DIR/pgbench
+
rm -fr $TESTDIR
mkdir $TESTDIR
cd $TESTDIR
@@ -21,7 +24,7 @@ export PGPORT=$PGPOOL_PORT
wait_for_pgpool_startup
-psql test <<EOF
+$PSQL test <<EOF
CREATE TABLE t1(i SERIAL, j TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP);
EOF
@@ -29,14 +32,14 @@ cat > pgbench.sql <<EOF
INSERT INTO t1 VALUES (DEFAULT);
EOF
-pgbench -i test
-pgbench -f pgbench.sql -c 10 -t 10 test
+$PGBENCH -i test
+$PGBENCH -f pgbench.sql -c 10 -t 10 test
-psql -p 11000 test <<EOF
+$PSQL -p 11000 test <<EOF
\copy (SELECT * FROM t1 ORDER BY i) to 'dump0.txt'
EOF
-psql -p 11001 test <<EOF
+$PSQL -p 11001 test <<EOF
\copy (SELECT * FROM t1 ORDER BY i) to 'dump1.txt'
EOF
diff --git a/test/regression/tests/003.failover/test.sh b/test/regression/tests/003.failover/test.sh
index 7805c229e..4b22edadb 100755
--- a/test/regression/tests/003.failover/test.sh
+++ b/test/regression/tests/003.failover/test.sh
@@ -4,6 +4,8 @@
#
source $TESTLIBS
TESTDIR=testdir
+PG_CTL=$PGBIN/pg_ctl
+PSQL=$PGBIN/psql
for mode in s r
do
@@ -20,12 +22,12 @@ do
export PGPORT=$PGPOOL_PORT
- psql -c "show pool_nodes" test
+ $PSQL -c "show pool_nodes" test
# trrigger failover
- pg_ctl -D data1 -m f stop
+ $PG_CTL -D data1 -m f stop
wait_for_pgpool_startup
- psql -c "show pool_nodes" test > result
+ $PSQL -c "show pool_nodes" test > result
# check the output of "show pool_nodes".
cmp result ../expected.$mode > /dev/null 2>&1
diff --git a/test/regression/tests/004.watchdog/test.sh b/test/regression/tests/004.watchdog/test.sh
index 11b2255e6..43f1f95ee 100755
--- a/test/regression/tests/004.watchdog/test.sh
+++ b/test/regression/tests/004.watchdog/test.sh
@@ -34,7 +34,7 @@ wait_for_pgpool_startup
cd ..
# stop master pgpool and see if standby take over
-pgpool -f master/etc/pgpool.conf -m f stop
+$PGPOOL_INSTALL_DIR/bin/pgpool -f master/etc/pgpool.conf -m f stop
sleep 1
diff --git a/test/regression/tests/050.bug58/test.sh b/test/regression/tests/050.bug58/test.sh
index 179d0dc24..8c8c3e9cd 100755
--- a/test/regression/tests/050.bug58/test.sh
+++ b/test/regression/tests/050.bug58/test.sh
@@ -5,6 +5,8 @@
WHOAMI=`whoami`
source $TESTLIBS
TESTDIR=testdir
+PSQL=$PGBIN/psql
+
rm -fr $TESTDIR
mkdir $TESTDIR
cd $TESTDIR
@@ -24,7 +26,7 @@ export PGPORT=$PGPOOL_PORT
wait_for_pgpool_startup
-psql test <<EOF
+$PSQL test <<EOF
CREATE TABLE t1(i INTEGER);
CREATE TABLE t2(i INTEGER);
SELECT * FROM t1; -- this creates a cache entry
@@ -45,4 +47,4 @@ if [ $? = 0 ];then
# cache found! The bug reveals.
exit 1
fi
-exit 0
\ No newline at end of file
+exit 0
diff --git a/test/regression/tests/051.bug60/test.sh b/test/regression/tests/051.bug60/test.sh
index 7ab45f8b5..e82bdcf8d 100755
--- a/test/regression/tests/051.bug60/test.sh
+++ b/test/regression/tests/051.bug60/test.sh
@@ -18,6 +18,8 @@
WHOAMI=`whoami`
source $TESTLIBS
TESTDIR=testdir
+PSQL=$PGBIN/psql
+
rm -fr $TESTDIR
mkdir $TESTDIR
cd $TESTDIR
@@ -35,10 +37,10 @@ wait_for_pgpool_startup
export PGPORT=$PGPOOL_PORT
# set up trigger
-psql -f ../database-setup.sql test
+$PSQL -f ../database-setup.sql test
# trigger the bug
-psql -f ../bug.sql test
+$PSQL -f ../bug.sql test
# trigger the bug in extended protocol mode
perl <<EOF
@@ -74,4 +76,4 @@ if [ $? = 0 ];then
# cache found! The bug reveals.
exit 1
fi
-exit 0
\ No newline at end of file
+exit 0
diff --git a/test/regression/tests/052.do_query/test.sh b/test/regression/tests/052.do_query/test.sh
index a1d52dcfa..140c1f751 100755
--- a/test/regression/tests/052.do_query/test.sh
+++ b/test/regression/tests/052.do_query/test.sh
@@ -9,6 +9,8 @@ BUG="do_query"
WHOAMI=`whoami`
source $TESTLIBS
TESTDIR=testdir
+PGBENCH=$PGBENCH_DIR/pgbench
+
rm -fr $TESTDIR
mkdir $TESTDIR
cd $TESTDIR
@@ -27,10 +29,10 @@ export PGPORT=$PGPOOL_PORT
wait_for_pgpool_startup
echo "SELECT 1" > select.pgbench
-pgbench -i test
+$PGBENCH -i test
# run test. This will hung if the bug is remained.
-(pgbench -c 10 -t 10 -M extended -f select.pgbench test)&
+($PGBENCH -c 10 -t 10 -M extended -f select.pgbench test)&
sleep 5
kill $!
@@ -39,4 +41,4 @@ if [ $? = 0 ];then
exit 1
fi
-./shutdownall
\ No newline at end of file
+./shutdownall
diff --git a/test/regression/tests/053.insert_lock_hangs/test.sh b/test/regression/tests/053.insert_lock_hangs/test.sh
index 5ea631acc..b2d5b1f5c 100755
--- a/test/regression/tests/053.insert_lock_hangs/test.sh
+++ b/test/regression/tests/053.insert_lock_hangs/test.sh
@@ -12,6 +12,8 @@
WHOAMI=`whoami`
source $TESTLIBS
TESTDIR=testdir
+PSQL=$PGBIN/psql
+
rm -fr $TESTDIR
mkdir $TESTDIR
cd $TESTDIR
@@ -30,7 +32,7 @@ export PGPORT=$PGPOOL_PORT
# create insert_lock table
-psql test <<EOF
+$PSQL test <<EOF
DROP TABLE IF EXISTS pgpool_catalog.insert_lock;
CREATE SCHEMA pgpool_catalog;
CREATE TABLE pgpool_catalog.insert_lock(reloid OID PRIMARY KEY);
@@ -46,7 +48,7 @@ EOF
# create test table
-psql test <<EOF
+$PSQL test <<EOF
DROP TABLE IF EXISTS kd_test_serial_pgpool;
CREATE TABLE kd_test_serial_pgpool(id SERIAL, content TEXT);
EOF
@@ -76,4 +78,4 @@ if [ $? = 0 ];then
exit 1
fi
-./shutdownall
\ No newline at end of file
+./shutdownall
diff --git a/test/regression/tests/054.postgres_fdw/test.sh b/test/regression/tests/054.postgres_fdw/test.sh
index 4a32cc39c..db8cfa4b5 100755
--- a/test/regression/tests/054.postgres_fdw/test.sh
+++ b/test/regression/tests/054.postgres_fdw/test.sh
@@ -10,6 +10,8 @@
WHOAMI=`whoami`
source $TESTLIBS
TESTDIR=testdir
+PG_CTL=$PGBIN/pg_ctl
+PSQL=$PGBIN/psql
rm -fr $TESTDIR
mkdir $TESTDIR
@@ -27,7 +29,7 @@ export PGPORT=$PGPOOL_PORT
wait_for_pgpool_startup
# create foreign table
-psql -p 11001 test <<EOF
+$PSQL -p 11001 test <<EOF
CREATE EXTENSION postgres_fdw;
CREATE SERVER pgpool FOREIGN DATA WRAPPER postgres_fdw OPTIONS (dbname 'test', port '11002');
CREATE USER MAPPING FOR PUBLIC SERVER pgpool;
@@ -35,13 +37,13 @@ CREATE FOREIGN TABLE fr1(i INTEGER) SERVER pgpool;
EOF
# create remote table
-psql -p 11000 test <<EOF
+$PSQL -p 11000 test <<EOF
CREATE TABLE fr1(i INTEGER);
EOF
# detach node #1 so that pgpool does not access
# postgres_fdw. Otherwise it will go into an inifinite loop.
-pcp_detach_node 1 localhost $PCP_PORT $WHOAMI $WHOAMI 1
+$PGPOOL_INSTALL_DIR/bin/pcp_detach_node 1 localhost $PCP_PORT $WHOAMI $WHOAMI 1
if [ $? != 0 ];then
echo "pcp_detach_node failed"
@@ -49,7 +51,7 @@ if [ $? != 0 ];then
fi
# access foreign table 11001(PostgreSQL)->11002(pgpool)->11000(PostgreSQL)
-psql -p 11001 test <<EOF
+$PSQL -p 11001 test <<EOF
SELECT * FROM fr1;
INSERT INTO fr1 VALUES(1); -- should call pgpool_regclass
EOF
diff --git a/test/regression/tests/056.bug63/test.sh b/test/regression/tests/056.bug63/test.sh
index 228f8af55..74061e608 100755
--- a/test/regression/tests/056.bug63/test.sh
+++ b/test/regression/tests/056.bug63/test.sh
@@ -5,7 +5,9 @@
#
# Fixed in: http://git.postgresql.org/gitweb/?p=pgpool2.git;a=commit;h=d428c5c27600dd82161dda6a240737d88db78732
# requires Java PostgreSQL JDBC driver.
-JDBC_DRIVER=/usr/local/pgsql/share/postgresql-9.2-1003.jdbc4.jar
+PGBENCH=$PGBENCH_DIR/pgbench
+
+
WHOAMI=`whoami`
source $TESTLIBS
TESTDIR=testdir
@@ -33,7 +35,7 @@ export CLASSPATH=.:$JDBC_DRIVER
./startall
wait_for_pgpool_startup
-pgbench -i test
+$PGBENCH -i test
java jdbctest2
if [ $? != 0 ];then
diff --git a/test/regression/tests/057.bug61/test.sh b/test/regression/tests/057.bug61/test.sh
index 2f1405fa5..b9592a322 100755
--- a/test/regression/tests/057.bug61/test.sh
+++ b/test/regression/tests/057.bug61/test.sh
@@ -6,6 +6,9 @@
# Fixed in: http://git.postgresql.org/gitweb/?p=pgpool2.git;a=commit;h=d493dd2b7d2065fb554654b137ecd587564f0043
source $TESTLIBS
TESTDIR=testdir
+PG_CTL=$PGBIN/pg_ctl
+PSQL=$PGBIN/psql
+PGBENCH=$PGBENCH_DIR/pgbench
rm -fr $TESTDIR
mkdir $TESTDIR
@@ -23,7 +26,7 @@ export PGPORT=$PGPOOL_PORT
./startall
wait_for_pgpool_startup
-pgbench -i test
+$PGBENCH -i test
EXPECT='psql: FATAL: no PostgreSQL user name specified in startup packet'
RESULT=`$PSQL -p $PGPOOL_PORT -U '' test 2>&1`
[parent: cacd4b11fd2a]