Sha256: 7b0a7ce7ff05c255849f7144dd4c3920956a19b5fcce678187ac325a3aac72c0

Contents?: true

Size: 1.3 KB

Versions: 12

Compression:

Stored size: 1.3 KB

Contents

#! /bin/sh -x
#-------------------------------------------------------------------
# test script for native replication mode.
#
source $TESTLIBS
TESTDIR=testdir
PSQL=$PGBIN/psql
PGBENCH=$PGBENCH_PATH

rm -fr $TESTDIR
mkdir $TESTDIR
cd $TESTDIR

# create test environment
echo -n "creating test environment..."
sh $PGPOOL_SETUP -m r -n 2 || exit 1
echo "done."

source ./bashrc.ports

./startall

export PGPORT=$PGPOOL_PORT

wait_for_pgpool_startup

$PSQL test <<EOF
CREATE TABLE t1(i SERIAL, j TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP);
EOF

cat > pgbench.sql <<EOF
INSERT INTO t1 VALUES (DEFAULT);
EOF

$PGBENCH -i test
$PGBENCH -f pgbench.sql -c 10 -t 10 test

# test with extended protocol (autocommit on)
# per [pgpool-general: 2144].
cp ../PgTester.java .
javac PgTester.java
export CLASSPATH=.:$JDBC_DRIVER
psql -f ../create.sql test
env
psql -f $PGPOOL_INSTALL_DIR/share/pgpool-II/insert_lock.sql test

java PgTester 0 &
java PgTester 10 &
java PgTester 100 &
java PgTester 1000 &
wait

$PSQL -p 11000 test <<EOF
\copy (SELECT * FROM t1 ORDER BY i) to 'dump0.txt'
EOF

$PSQL -p 11001 test <<EOF
\copy (SELECT * FROM t1 ORDER BY i) to 'dump1.txt'
EOF

# check if database contents are identical
diff dump0.txt dump1.txt
if [ $? != 0 ];then
	# contents are not identical
	./shutdownall
	exit 1
fi

./shutdownall

exit 0

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
prestogres-0.4.8 pgpool2/test/regression/tests/002.native_replication/test.sh
prestogres-0.4.7 pgpool2/test/regression/tests/002.native_replication/test.sh
prestogres-0.4.6 pgpool2/test/regression/tests/002.native_replication/test.sh
prestogres-0.4.5 pgpool2/test/regression/tests/002.native_replication/test.sh
prestogres-0.4.4 pgpool2/test/regression/tests/002.native_replication/test.sh
prestogres-0.4.3 pgpool2/test/regression/tests/002.native_replication/test.sh
prestogres-0.4.2 pgpool2/test/regression/tests/002.native_replication/test.sh
prestogres-0.4.1 pgpool2/test/regression/tests/002.native_replication/test.sh
prestogres-0.4.0 pgpool2/test/regression/tests/002.native_replication/test.sh
prestogres-0.3.0 pgpool2/test/regression/tests/002.native_replication/test.sh
prestogres-0.2.0 pgpool2/test/regression/tests/002.native_replication/test.sh
prestogres-0.1.0 pgpool2/test/regression/tests/002.native_replication/test.sh