CVS User Account cvsuser
Wed May 4 21:43:21 PDT 2005
Log Message:
-----------
Add move set test, test_D_moveset

Also, take out simple comparison of pg_bench into a script,
compare_pgbench_dumps

Also, add $Id$ tag where missing

Modified Files:
--------------
    slony1-engine/src/ducttape:
        test_1_pgbench (r1.23 -> r1.24)
        test_1_pgbench_no_node1 (r1.3 -> r1.4)
        test_1_update_functions (r1.2 -> r1.3)
        test_2_extra_1 (r1.2 -> r1.3)
        test_2_extra_2 (r1.2 -> r1.3)
        test_2_pgbench (r1.15 -> r1.16)
        test_3_pgbench (r1.12 -> r1.13)
        test_4_pgbench (r1.9 -> r1.10)
        test_7_defines (r1.4 -> r1.5)
        test_8_logship (r1.3 -> r1.4)
        test_9_fileconf (r1.1 -> r1.2)
        test_A_namequoting (r1.2 -> r1.3)
        test_B_notables (r1.1 -> r1.2)

Added Files:
-----------
    slony1-engine/src/ducttape:
        compare_pgbench_dumps (r1.1)
        test_D_moveset (r1.1)

-------------- next part --------------
Index: test_1_pgbench
===================================================================
RCS file: /usr/local/cvsroot/slony1/slony1-engine/src/ducttape/test_1_pgbench,v
retrieving revision 1.23
retrieving revision 1.24
diff -Lsrc/ducttape/test_1_pgbench -Lsrc/ducttape/test_1_pgbench -u -w -r1.23 -r1.24
--- src/ducttape/test_1_pgbench
+++ src/ducttape/test_1_pgbench
@@ -1,5 +1,5 @@
 #!/bin/sh
-
+# $Id$
 # **********
 # test_1_pgbench
 #
@@ -270,32 +270,4 @@
 kill $slon1_pid 2>/dev/null
 kill $slon2_pid 2>/dev/null
 
-echo -n "**** comparing databases ... "
-psql $DB1 >dump.tmp.1.$$ <<_EOF_
-	select 'accounts:'::text, aid, bid, abalance, filler
-			from accounts order by aid;
-	select 'branches:'::text, bid, bbalance, filler
-			from branches order by bid;
-	select 'tellers:'::text, tid, bid, tbalance, filler
-			from tellers order by tid;
-	select 'history:'::text, tid, bid, aid, delta, mtime, filler,
-			"_Slony-I_T1_rowID" from history order by "_Slony-I_T1_rowID";
-_EOF_
-psql $DB2 >dump.tmp.2.$$ <<_EOF_
-	select 'accounts:'::text, aid, bid, abalance, filler
-			from accounts order by aid;
-	select 'branches:'::text, bid, bbalance, filler
-			from branches order by bid;
-	select 'tellers:'::text, tid, bid, tbalance, filler
-			from tellers order by tid;
-	select 'history:'::text, tid, bid, aid, delta, mtime, filler,
-			"_Slony-I_T1_rowID" from history order by "_Slony-I_T1_rowID";
-_EOF_
-
-if diff dump.tmp.1.$$ dump.tmp.2.$$ >test_1.diff ; then
-	echo "success - databases are equal."
-	rm dump.tmp.?.$$
-	rm test_1.diff
-else
-	echo "FAILED - see test_1.diff for database differences"
-fi
+. compare_pgbench_dumps $DB1 $DB2
Index: test_1_update_functions
===================================================================
RCS file: /usr/local/cvsroot/slony1/slony1-engine/src/ducttape/test_1_update_functions,v
retrieving revision 1.2
retrieving revision 1.3
diff -Lsrc/ducttape/test_1_update_functions -Lsrc/ducttape/test_1_update_functions -u -w -r1.2 -r1.3
--- src/ducttape/test_1_update_functions
+++ src/ducttape/test_1_update_functions
@@ -1,5 +1,5 @@
 #!/bin/sh
-
+# $Id$
 # **********
 # test_1_update_functions
 #
Index: test_2_extra_2
===================================================================
RCS file: /usr/local/cvsroot/slony1/slony1-engine/src/ducttape/test_2_extra_2,v
retrieving revision 1.2
retrieving revision 1.3
diff -Lsrc/ducttape/test_2_extra_2 -Lsrc/ducttape/test_2_extra_2 -u -w -r1.2 -r1.3
--- src/ducttape/test_2_extra_2
+++ src/ducttape/test_2_extra_2
@@ -1,5 +1,5 @@
 #!/bin/sh
-
+# $Id$
 #
 # script test_2_extra_2
 #
Index: test_8_logship
===================================================================
RCS file: /usr/local/cvsroot/slony1/slony1-engine/src/ducttape/test_8_logship,v
retrieving revision 1.3
retrieving revision 1.4
diff -Lsrc/ducttape/test_8_logship -Lsrc/ducttape/test_8_logship -u -w -r1.3 -r1.4
--- src/ducttape/test_8_logship
+++ src/ducttape/test_8_logship
@@ -278,33 +278,5 @@
 kill $slon1_pid 2>/dev/null
 kill $slon2_pid 2>/dev/null
 
-echo -n "**** comparing databases ... "
-psql $DB1 >dump.tmp.1.$$ <<_EOF_
-	select 'accounts:'::text, aid, bid, abalance, filler
-			from accounts order by aid;
-	select 'branches:'::text, bid, bbalance, filler
-			from branches order by bid;
-	select 'tellers:'::text, tid, bid, tbalance, filler
-			from tellers order by tid;
-	select 'history:'::text, tid, bid, aid, delta, mtime, filler,
-			"_Slony-I_${CLUSTERNAME}_rowID" from history order by "_Slony-I_${CLUSTERNAME}_rowID";
-_EOF_
-psql $DB2 >dump.tmp.2.$$ <<_EOF_
-	select 'accounts:'::text, aid, bid, abalance, filler
-			from accounts order by aid;
-	select 'branches:'::text, bid, bbalance, filler
-			from branches order by bid;
-	select 'tellers:'::text, tid, bid, tbalance, filler
-			from tellers order by tid;
-	select 'history:'::text, tid, bid, aid, delta, mtime, filler,
-			"_Slony-I_${CLUSTERNAME}_rowID" from history order by "_Slony-I_${CLUSTERNAME}_rowID";
-_EOF_
-
-if diff dump.tmp.1.$$ dump.tmp.2.$$ >test_1.diff ; then
-	echo "success - databases are equal."
-	rm dump.tmp.?.$$
-	rm test_1.diff
-else
-	echo "FAILED - see test_1.diff for database differences"
-fi
+. compare_pgbench_dumps $DB1 $DB2
 rm $PREAMBLE_FILE
Index: test_9_fileconf
===================================================================
RCS file: /usr/local/cvsroot/slony1/slony1-engine/src/ducttape/test_9_fileconf,v
retrieving revision 1.1
retrieving revision 1.2
diff -Lsrc/ducttape/test_9_fileconf -Lsrc/ducttape/test_9_fileconf -u -w -r1.1 -r1.2
--- src/ducttape/test_9_fileconf
+++ src/ducttape/test_9_fileconf
@@ -1,5 +1,5 @@
 #!/bin/sh    
-
+# $Id$
 # **********
 # test_9_fileconf
 #
@@ -294,33 +294,5 @@
 kill $slon1_pid 2>/dev/null
 kill $slon2_pid 2>/dev/null
 
-echo -n "**** comparing databases ... "
-psql $DB1 >dump.tmp.1.$$ <<_EOF_
-	select 'accounts:'::text, aid, bid, abalance, filler
-			from accounts order by aid;
-	select 'branches:'::text, bid, bbalance, filler
-			from branches order by bid;
-	select 'tellers:'::text, tid, bid, tbalance, filler
-			from tellers order by tid;
-	select 'history:'::text, tid, bid, aid, delta, mtime, filler,
-			"_Slony-I_T1_rowID" from history order by "_Slony-I_T1_rowID";
-_EOF_
-psql $DB2 >dump.tmp.2.$$ <<_EOF_
-	select 'accounts:'::text, aid, bid, abalance, filler
-			from accounts order by aid;
-	select 'branches:'::text, bid, bbalance, filler
-			from branches order by bid;
-	select 'tellers:'::text, tid, bid, tbalance, filler
-			from tellers order by tid;
-	select 'history:'::text, tid, bid, aid, delta, mtime, filler,
-			"_Slony-I_T1_rowID" from history order by "_Slony-I_T1_rowID";
-_EOF_
-
-if diff dump.tmp.1.$$ dump.tmp.2.$$ >test_1.diff ; then
-	echo "success - databases are equal."
-	rm dump.tmp.?.$$
-	rm test_1.diff
-else
-	echo "FAILED - see test_1.diff for database differences"
-fi
+. compare_pgbench_dumps $DB1 $DB2
 rm $PREAMBLE_FILE $SLONCONF1 $SLONCONF2
Index: test_2_pgbench
===================================================================
RCS file: /usr/local/cvsroot/slony1/slony1-engine/src/ducttape/test_2_pgbench,v
retrieving revision 1.15
retrieving revision 1.16
diff -Lsrc/ducttape/test_2_pgbench -Lsrc/ducttape/test_2_pgbench -u -w -r1.15 -r1.16
--- src/ducttape/test_2_pgbench
+++ src/ducttape/test_2_pgbench
@@ -1,5 +1,5 @@
 #!/bin/sh
-
+# $Id$
 # **********
 # test_2_pgbench
 #
--- /dev/null
+++ src/ducttape/test_D_moveset
@@ -0,0 +1,318 @@
+#!/bin/sh    
+# $Id: test_D_moveset,v 1.1 2005/05/04 20:43:16 cbbrowne Exp $
+# **********
+# test_D_moveset
+#
+# 	This test script creates a standalone pgbench database 
+#	as slony_test1 and then:
+#
+#	- initializes a primary node and starts the node daemon
+#	- creates a set containing all 4 pgbench tables
+#	- creates a second database as slony_test2
+#	- adds database slony_test2 to the system
+#	- starts the second replication daemon
+#	- creates the pgbench tables (schema only)
+#	- subscribes the replication set from the primary node
+#
+#       - when pgbench ends, it does a MOVE SET request
+#         and then runs pgbench for a while again against
+#         the new master node
+#
+#  The test is on MOVE SET
+# **********
+
+export PATH
+TMPOUT=/tmp/output.$$
+DB1=slony_test1
+DB2=slony_test2
+DEBUG_LEVEL=2
+
+PGBENCH_SCALE=1
+PGBENCH_CLIENTS=5
+PGBENCH_TRANS=`expr 8000 / $PGBENCH_CLIENTS`
+
+trap '
+	echo ""
+	echo "**** user abort"
+	if [ ! -z $pgbench_pid ] ; then
+		echo "**** killing pgbench"
+		kill -15 $pgbench_pid
+	fi
+	if [ ! -z $slon1_pid ] ; then
+		echo "**** killing node daemon 1"
+		kill -15 $slon1_pid
+	fi
+	if [ ! -z $slon2_pid ] ; then
+		echo "**** killing node daemon 2"
+		kill -15 $slon2_pid
+	fi
+	exit 1
+' 2 15
+
+######################################################################
+# Preparations ... create a standalone pgbench database and
+# have the "application" (pgbench) running.
+######################################################################
+
+#####
+# Make sure the install is up to date
+#####
+WGM=`which gmake | egrep '^/'`
+if [ -z "$WGM" ] ; then
+    MAKE=make
+    CGNU=`make -v | grep GNU`
+    if [ -z "$CGNU" ] ; then
+	echo "GNU Make not found - please install GNU Make"
+	exit 1
+    fi
+else
+    MAKE=gmake
+fi
+echo -n "**** running 'make install' in src directory ... "
+if ! ${MAKE} -C .. install >$TMPOUT 2>&1 ; then
+    echo "failed"; cat $TMPOUT; rm $TMPOUT; exit 1
+fi
+echo "done"
+rm $TMPOUT
+
+PREAMBLE_FILE=/tmp/preamble.$$
+cat <<EOF > $PREAMBLE_FILE
+define origin 11;
+define sub1 22;
+cluster name = T1;
+node @origin admin conninfo='dbname=$DB1';
+node @sub1 admin conninfo='dbname=$DB2';
+EOF
+
+
+
+#####
+# Remove old databases, if they exist
+#####
+echo "**** remove old test databases"
+dropdb $DB1 || echo "**** ignored"
+sleep 1
+dropdb $DB2 || echo "**** ignored"
+sleep 1
+
+#####
+# Create the "Primary Node"
+#####
+echo "**** creating database for Node 11"
+
+createdb $DB1 || exit 1
+pgbench -i -s $PGBENCH_SCALE $DB1
+pg_dump -s $DB1 >pgbench_schema.sql
+
+#####
+# Start pgbench in the background and give it rampup time
+#####
+pgbench -n -s $PGBENCH_SCALE -c $PGBENCH_CLIENTS -t $PGBENCH_TRANS $DB1 &
+pgbench_pid=$!
+echo "**** pgbench is running in background with pid $pgbench_pid"
+echo -n "**** sleeping 10 seconds to give pgbench time for rampup ... "
+sleep 10
+echo "done"
+
+echo ""
+echo "**********************************************************************"
+echo "**** $DB1 is now a standalone database with a running pgbench"
+echo "**********************************************************************"
+echo ""
+
+######################################################################
+# Setup DB1 as the primary cluster T1 node, start the node daemon,
+# and create a replication set containing the pgbench tables.
+######################################################################
+
+echo "**** initializing $DB1 as Primary Node for Slony-I cluster T1"
+slonik <<_EOF_
+	include <$PREAMBLE_FILE>;
+	init cluster (id = @origin, comment = 'Node @origin');
+	echo 'Database $DB1 initialized as Node 11';
+_EOF_
+if [ $? -ne 0 ] ; then
+	kill $pgbench_pid;
+	exit 1
+fi
+
+echo "**** starting the Slony-I node daemon for $DB1"
+xterm -title "Slon node 11" -e sh -c "slon -d$DEBUG_LEVEL -s500 -g10 T1 dbname=$DB1; echo -n 'Enter>'; read line" &
+slon1_pid=$!
+echo "slon[$slon1_pid] on dbname=$DB1"
+
+echo "**** creating a replication set containing the 4 pgbench tables ... "
+slonik <<_EOF_
+	include <$PREAMBLE_FILE>;
+	try {
+		table add key (node id = @origin, fully qualified name = 'public.history');
+	}
+	on error {
+		exit 1;
+	}
+
+	try {
+		create set (id = 1, origin = @origin, comment = 'Set 1 - pgbench tables');
+		set add table (set id = 1, origin = @origin,
+			id = 1, fully qualified name = 'public.accounts',
+			comment = 'Table accounts');
+		set add table (set id = 1, origin = @origin,
+			id = 2, fully qualified name = 'public.branches',
+			comment = 'Table branches');
+		set add table (set id = 1, origin = @origin,
+			id = 3, fully qualified name = 'public.tellers',
+			comment = 'Table tellers');
+		set add table (set id = 1, origin = @origin,
+			id = 4, fully qualified name = 'public.history',
+			key = serial, comment = 'Table accounts');
+	}
+	on error {
+		exit 1;
+	}
+_EOF_
+
+if [ $? -ne 0 ] ; then
+	echo "failed"
+	kill $pgbench_pid 2>/dev/null
+	kill $slon1_pid 2>/dev/null
+	cat $TMPOUT
+	rm $TMPOUT
+	exit 1
+fi
+echo "**** set created"
+
+#####
+# Check that pgbench is still running
+#####
+if ! kill -0 $pgbench_pid 2>/dev/null ; then
+	echo "**** pgbench terminated ???"
+	kill $slon1_pid 2>/dev/null
+	exit 1
+fi
+
+echo ""
+echo "**********************************************************************"
+echo "**** $DB1 is now the Slony-I origin for set 1"
+echo "**********************************************************************"
+echo ""
+
+######################################################################
+# Setup DB2 as a subscriber node and let it subscribe the replication
+# set of the running pgbench
+######################################################################
+echo "**** creating database for node 22"
+if ! createdb $DB2 ; then
+	kill $pgbench_pid 2>/dev/null
+	kill $slon1_pid 2>/dev/null
+	exit 1
+fi
+
+echo "**** initializing $DB2 as node 22 of Slony-I cluster T1"
+slonik <<_EOF_
+	include <$PREAMBLE_FILE>;
+	echo 'Creating node 22';
+	try {
+		store node (id = @sub1, comment = 'node @sub1', event node = @origin);
+        } on error {
+	    echo 'could not establish node @sub1';
+	    exit -1;
+	}
+	try {
+		store path (server = @origin, client = @sub1, conninfo = 'dbname=$DB1');
+		store path (server = @sub1, client = @origin, conninfo = 'dbname=$DB2');
+	}
+	on error { 
+	    echo 'could not establish paths between @origin and @sub1';
+	    exit -1; 
+	}
+	echo 'Database $DB2 added as node @sub1';
+_EOF_
+if [ $? -ne 0 ] ; then
+	kill $pgbench_pid 2>/dev/null
+	kill $slon1_pid 2>/dev/null
+	exit 1
+fi
+
+echo "**** starting the Slony-I node daemon for $DB1"
+xterm -title "Slon node 22" -e sh -c "slon -d$DEBUG_LEVEL -s10000 -o10000 -g10 T1 dbname=$DB2; echo -n 'Enter>'; read line" &
+slon2_pid=$!
+echo "slon[$slon2_pid] on dbname=$DB2"
+
+#####
+# Check that pgbench is still running
+#####
+if ! kill -0 $pgbench_pid 2>/dev/null ; then
+	echo "**** pgbench terminated ???"
+	kill $slon1_pid 2>/dev/null
+	exit 1
+fi
+
+######################################################################
+# And now comes the moment where the big elephant starts to pee
+# and the attendants in the first row climb on their chairs ...
+######################################################################
+echo "**** creating pgbench tables and subscribing node 22 to set 1"
+(
+	cat pgbench_schema.sql
+) | psql -q $DB2
+slonik <<_EOF_
+	include <$PREAMBLE_FILE>;
+	subscribe set ( id = 1, provider = @origin, receiver = @sub1, forward = yes );
+_EOF_
+
+echo ""
+echo "**********************************************************************"
+echo "**** $DB2 should now be copying data and attempting to catch up."
+echo "**********************************************************************"
+echo ""
+
+echo -n "**** waiting for pgbench to finish "
+while kill -0 $pgbench_pid 2>/dev/null ; do
+	echo -n "."
+	sleep 10
+done
+echo "
+****************************************************************************
+**** Now, switch roles so that $DB2 becomes master, and $DB1 the slave. ****
+****************************************************************************
+"
+
+echo "**** switching $DB2 to be origin of Slony-I cluster T1"
+slonik <<_EOF_
+	include <$PREAMBLE_FILE>;
+	echo 'Lock set';
+	lock set (id = 1, origin = @origin);
+	move set (id = 1, old origin = @origin, new origin = @sub1);
+_EOF_
+if [ $? -ne 0 ] ; then
+	kill $pgbench_pid 2>/dev/null
+	kill $slon1_pid 2>/dev/null
+	exit 1
+fi
+
+echo <<EOF
+ Start up pgbench against $DB2
+EOF
+pgbench -n -s $PGBENCH_SCALE -c $PGBENCH_CLIENTS -t $PGBENCH_TRANS $DB2 &
+pgbench_pid=$!
+
+echo -n "**** waiting for pgbench to finish "
+while kill -0 $pgbench_pid 2>/dev/null ; do
+	echo -n "."
+	sleep 10
+done
+echo <<EOF
+
+echo "**** pgbench finished"
+echo "**** please terminate the replication engines when caught up."
+wait $slon1_pid
+wait $slon2_pid
+
+kill $pgbench_pid 2>/dev/null
+kill $slon1_pid 2>/dev/null
+kill $slon2_pid 2>/dev/null
+
+echo "Terminated slons, pg_bench, comparing..."
+
+. compare_pgbench_dumps $DB1 $DB2
+rm $PREAMBLE_FILE
Index: test_7_defines
===================================================================
RCS file: /usr/local/cvsroot/slony1/slony1-engine/src/ducttape/test_7_defines,v
retrieving revision 1.4
retrieving revision 1.5
diff -Lsrc/ducttape/test_7_defines -Lsrc/ducttape/test_7_defines -u -w -r1.4 -r1.5
--- src/ducttape/test_7_defines
+++ src/ducttape/test_7_defines
@@ -1,5 +1,5 @@
 #!/bin/sh    
-
+# $Id$
 # **********
 # test_7_defines
 #
@@ -277,33 +277,5 @@
 kill $slon1_pid 2>/dev/null
 kill $slon2_pid 2>/dev/null
 
-echo -n "**** comparing databases ... "
-psql $DB1 >dump.tmp.1.$$ <<_EOF_
-	select 'accounts:'::text, aid, bid, abalance, filler
-			from accounts order by aid;
-	select 'branches:'::text, bid, bbalance, filler
-			from branches order by bid;
-	select 'tellers:'::text, tid, bid, tbalance, filler
-			from tellers order by tid;
-	select 'history:'::text, tid, bid, aid, delta, mtime, filler,
-			"_Slony-I_T1_rowID" from history order by "_Slony-I_T1_rowID";
-_EOF_
-psql $DB2 >dump.tmp.2.$$ <<_EOF_
-	select 'accounts:'::text, aid, bid, abalance, filler
-			from accounts order by aid;
-	select 'branches:'::text, bid, bbalance, filler
-			from branches order by bid;
-	select 'tellers:'::text, tid, bid, tbalance, filler
-			from tellers order by tid;
-	select 'history:'::text, tid, bid, aid, delta, mtime, filler,
-			"_Slony-I_T1_rowID" from history order by "_Slony-I_T1_rowID";
-_EOF_
-
-if diff dump.tmp.1.$$ dump.tmp.2.$$ >test_1.diff ; then
-	echo "success - databases are equal."
-	rm dump.tmp.?.$$
-	rm test_1.diff
-else
-	echo "FAILED - see test_1.diff for database differences"
-fi
+. compare_pgbench_dumps $DB1 $DB2
 rm $PREAMBLE_FILE
Index: test_B_notables
===================================================================
RCS file: /usr/local/cvsroot/slony1/slony1-engine/src/ducttape/test_B_notables,v
retrieving revision 1.1
retrieving revision 1.2
diff -Lsrc/ducttape/test_B_notables -Lsrc/ducttape/test_B_notables -u -w -r1.1 -r1.2
--- src/ducttape/test_B_notables
+++ src/ducttape/test_B_notables
@@ -1,5 +1,5 @@
 #!/bin/sh    
-
+# $Id$
 # **********
 # test_B_notables
 #
--- /dev/null
+++ src/ducttape/compare_pgbench_dumps
@@ -0,0 +1,41 @@
+#!/bin/sh    
+# $Id: compare_pgbench_dumps,v 1.1 2005/05/04 20:43:16 cbbrowne Exp $
+# **********
+# compare_pgbench_dumps
+# **********
+
+export PATH
+TMPOUT=/tmp/output.$$
+DB1=$1    # First database
+DB2=$2    # Second database
+DEBUG_LEVEL=2
+
+echo -n "**** comparing databases ... "
+psql $DB1 >dump.tmp.1.$$ <<_EOF_
+	select 'accounts:'::text, aid, bid, abalance, filler
+			from accounts order by aid;
+	select 'branches:'::text, bid, bbalance, filler
+			from branches order by bid;
+	select 'tellers:'::text, tid, bid, tbalance, filler
+			from tellers order by tid;
+	select 'history:'::text, tid, bid, aid, delta, mtime, filler,
+			"_Slony-I_T1_rowID" from history order by "_Slony-I_T1_rowID";
+_EOF_
+psql $DB2 >dump.tmp.2.$$ <<_EOF_
+	select 'accounts:'::text, aid, bid, abalance, filler
+			from accounts order by aid;
+	select 'branches:'::text, bid, bbalance, filler
+			from branches order by bid;
+	select 'tellers:'::text, tid, bid, tbalance, filler
+			from tellers order by tid;
+	select 'history:'::text, tid, bid, aid, delta, mtime, filler,
+			"_Slony-I_T1_rowID" from history order by "_Slony-I_T1_rowID";
+_EOF_
+
+if diff dump.tmp.1.$$ dump.tmp.2.$$ >test_1.diff ; then
+	echo "success - databases are equal."
+	rm dump.tmp.?.$$
+	rm test_1.diff
+else
+	echo "FAILED - see test_1.diff for database differences"
+fi
Index: test_1_pgbench_no_node1
===================================================================
RCS file: /usr/local/cvsroot/slony1/slony1-engine/src/ducttape/test_1_pgbench_no_node1,v
retrieving revision 1.3
retrieving revision 1.4
diff -Lsrc/ducttape/test_1_pgbench_no_node1 -Lsrc/ducttape/test_1_pgbench_no_node1 -u -w -r1.3 -r1.4
--- src/ducttape/test_1_pgbench_no_node1
+++ src/ducttape/test_1_pgbench_no_node1
@@ -1,5 +1,5 @@
 #!/bin/sh
-
+# $Id$
 # **********
 # test_1_pgbench_no_node1
 #
@@ -276,32 +276,4 @@
 kill $slon1_pid 2>/dev/null
 kill $slon2_pid 2>/dev/null
 
-echo -n "**** comparing databases ... "
-psql $DB1 >dump.tmp.1.$$ <<_EOF_
-	select 'accounts:'::text, aid, bid, abalance, filler
-			from accounts order by aid;
-	select 'branches:'::text, bid, bbalance, filler
-			from branches order by bid;
-	select 'tellers:'::text, tid, bid, tbalance, filler
-			from tellers order by tid;
-	select 'history:'::text, tid, bid, aid, delta, mtime, filler,
-			"_Slony-I_T1_rowID" from history order by "_Slony-I_T1_rowID";
-_EOF_
-psql $DB2 >dump.tmp.2.$$ <<_EOF_
-	select 'accounts:'::text, aid, bid, abalance, filler
-			from accounts order by aid;
-	select 'branches:'::text, bid, bbalance, filler
-			from branches order by bid;
-	select 'tellers:'::text, tid, bid, tbalance, filler
-			from tellers order by tid;
-	select 'history:'::text, tid, bid, aid, delta, mtime, filler,
-			"_Slony-I_T1_rowID" from history order by "_Slony-I_T1_rowID";
-_EOF_
-
-if diff dump.tmp.1.$$ dump.tmp.2.$$ >test_1.diff ; then
-	echo "success - databases are equal."
-	rm dump.tmp.?.$$
-	rm test_1.diff
-else
-	echo "FAILED - see test_1.diff for database differences"
-fi
+. compare_pgbench_dumps $DB1 $DB2
\ No newline at end of file
Index: test_4_pgbench
===================================================================
RCS file: /usr/local/cvsroot/slony1/slony1-engine/src/ducttape/test_4_pgbench,v
retrieving revision 1.9
retrieving revision 1.10
diff -Lsrc/ducttape/test_4_pgbench -Lsrc/ducttape/test_4_pgbench -u -w -r1.9 -r1.10
--- src/ducttape/test_4_pgbench
+++ src/ducttape/test_4_pgbench
@@ -1,5 +1,5 @@
 #!/bin/sh
-
+# $Id$
 # **********
 # test_4_pgbench
 #
@@ -304,32 +304,4 @@
 kill $slon1_pid 2>/dev/null
 kill $slon2_pid 2>/dev/null
 
-echo -n "**** comparing databases ... "
-psql $DB1 >dump.tmp.1.$$ <<_EOF_
-	select 'accounts:'::text, aid, bid, abalance, filler
-			from accounts order by aid;
-	select 'branches:'::text, bid, bbalance, filler
-			from branches order by bid;
-	select 'tellers:'::text, tid, bid, tbalance, filler
-			from tellers order by tid;
-	select 'history:'::text, tid, bid, aid, delta, mtime, filler,
-			"_Slony-I_T1_rowID" from history order by "_Slony-I_T1_rowID";
-_EOF_
-psql $DB2 >dump.tmp.2.$$ <<_EOF_
-	select 'accounts:'::text, aid, bid, abalance, filler
-			from accounts order by aid;
-	select 'branches:'::text, bid, bbalance, filler
-			from branches order by bid;
-	select 'tellers:'::text, tid, bid, tbalance, filler
-			from tellers order by tid;
-	select 'history:'::text, tid, bid, aid, delta, mtime, filler,
-			"_Slony-I_T1_rowID" from history order by "_Slony-I_T1_rowID";
-_EOF_
-
-if diff dump.tmp.1.$$ dump.tmp.2.$$ >test_1.diff ; then
-	echo "success - databases are equal."
-	rm dump.tmp.?.$$
-	rm test_1.diff
-else
-	echo "FAILED - see test_1.diff for database differences"
-fi
+. compare_pgbench_dumps $DB1 $DB2
Index: test_3_pgbench
===================================================================
RCS file: /usr/local/cvsroot/slony1/slony1-engine/src/ducttape/test_3_pgbench,v
retrieving revision 1.12
retrieving revision 1.13
diff -Lsrc/ducttape/test_3_pgbench -Lsrc/ducttape/test_3_pgbench -u -w -r1.12 -r1.13
--- src/ducttape/test_3_pgbench
+++ src/ducttape/test_3_pgbench
@@ -1,5 +1,5 @@
 #!/bin/sh
-
+# $Id$
 # **********
 # test_3_pgbench
 #
Index: test_2_extra_1
===================================================================
RCS file: /usr/local/cvsroot/slony1/slony1-engine/src/ducttape/test_2_extra_1,v
retrieving revision 1.2
retrieving revision 1.3
diff -Lsrc/ducttape/test_2_extra_1 -Lsrc/ducttape/test_2_extra_1 -u -w -r1.2 -r1.3
--- src/ducttape/test_2_extra_1
+++ src/ducttape/test_2_extra_1
@@ -1,5 +1,5 @@
 #!/bin/sh
-
+# $Id$
 #
 # script test_2_extra_1
 #
Index: test_A_namequoting
===================================================================
RCS file: /usr/local/cvsroot/slony1/slony1-engine/src/ducttape/test_A_namequoting,v
retrieving revision 1.2
retrieving revision 1.3
diff -Lsrc/ducttape/test_A_namequoting -Lsrc/ducttape/test_A_namequoting -u -w -r1.2 -r1.3
--- src/ducttape/test_A_namequoting
+++ src/ducttape/test_A_namequoting
@@ -1,5 +1,5 @@
 #!/bin/sh    
-
+# $Id$
 # **********
 # test_A_fileconf
 #


More information about the Slony1-commit mailing list