]> granicus.if.org Git - pgbouncer/commitdiff
Sync ssl/test.sh with test.sh
authorPeter Eisentraut <peter@eisentraut.org>
Thu, 1 Aug 2019 19:24:57 +0000 (21:24 +0200)
committerPeter Eisentraut <peter@eisentraut.org>
Thu, 1 Aug 2019 19:26:55 +0000 (21:26 +0200)
Make locations for logs and pid files consistent.

.gitignore
test/ssl/test.ini
test/ssl/test.sh
test/test.sh

index 86619efd2981ab7b6f099dbb1ac68229e4840dca..a0eb45ee39e1e9553404d4ecb93c753b6e364ccc 100644 (file)
 /test/pgdata/
 /test/test.log
 /test/test.pid
+/test/ssl/log
+/test/ssl/tmp/
+/test/ssl/pgdata/
+/test/ssl/test.log
+/test/ssl/test.pid
 /test/ssl/TestCA1/
 
 *.html
index a3aa2477716c2f68ece421fc816c444e712ae71a..feb4434caec0fcc7c2f0edea295ef238c0a1f7eb 100644 (file)
@@ -11,8 +11,8 @@ p1 = port=6666 host=localhost dbname=p1 user=bouncer
 ;;; Administrative settings
 ;;;
 
-logfile = tmp/test.log
-pidfile = tmp/test.pid
+logfile = test.log
+pidfile = test.pid
 
 ;;;
 ;;; Where to wait for clients
index 35c57c4dd9e6218e659c07c68feeade085d196b2..a817e05c922935da27e67d62192890454a544a5b 100755 (executable)
@@ -1,5 +1,7 @@
 #! /bin/sh
 
+cd $(dirname $0)
+
 rm -rf TestCA1
 
 (
@@ -17,13 +19,13 @@ export EF_ALLOW_MALLOC_0=1
 
 mkdir -p tmp
 
-BOUNCER_LOG=tmp/test.log
+BOUNCER_LOG=test.log
 BOUNCER_INI=test.ini
-BOUNCER_PID=tmp/test.pid
+BOUNCER_PID=test.pid
 BOUNCER_PORT=`sed -n '/^listen_port/s/listen_port.*=[^0-9]*//p' $BOUNCER_INI`
 BOUNCER_EXE="../../pgbouncer"
 
-LOGDIR=tmp
+LOGDIR=log
 PG_PORT=6666
 PG_LOG=$LOGDIR/pg.log
 
@@ -31,16 +33,15 @@ pgctl() {
        pg_ctl -o "-p $PG_PORT" -D $PGDATA $@ >>$PG_LOG 2>&1
 }
 
-rm -f core
 ulimit -c unlimited
 
-for f in pgdata/postmaster.pid tmp/test.pid; do
-       test -f $f && { kill `cat $f` || true; }
+for f in pgdata/postmaster.pid test.pid; do
+       test -f $f && { kill `head -n1 $f` || true; }
 done
 
 mkdir -p $LOGDIR
-rm -fr $BOUNCER_LOG $PG_LOG
-rm -fr $PGDATA
+rm -f $BOUNCER_LOG $PG_LOG
+rm -rf $PGDATA
 
 if [ ! -d $PGDATA ]; then
        echo "initdb"
@@ -82,7 +83,7 @@ reconf_bouncer() {
        for ln in "$@"; do
                echo "$ln" >> tmp/test.ini
        done
-       test -f tmp/test.pid && kill `cat tmp/test.pid`
+       test -f test.pid && kill `cat test.pid`
        sleep 1
        $BOUNCER_EXE -v -v -v -d tmp/test.ini
 }
@@ -132,6 +133,7 @@ runtest() {
                echo "ok"
        else
                echo "FAILED"
+               cat $LOGDIR/$1.log | sed 's/^/# /'
        fi
        date >> $LOGDIR/$1.log
 
index dcba8c31d5483ebd1ea467df34960e307bc9a579..505a683b335db59ca0728bdb355af16c502c7033 100755 (executable)
@@ -79,7 +79,7 @@ rm -rf $PGDATA
 
 if [ ! -d $PGDATA ]; then
        mkdir $PGDATA
-       initdb >> $PG_LOG 2>&1
+       initdb --nosync >> $PG_LOG 2>&1
        sed $SED_ERE_OP -i "/unix_socket_director/s:.*(unix_socket_director.*=).*:\\1 '/tmp':" pgdata/postgresql.conf
        cat >>pgdata/postgresql.conf <<-EOF
        log_connections = on