From 7cab19050ee929584d07845b7e8a4e0111629a7f Mon Sep 17 00:00:00 2001 From: Marko Kreen Date: Fri, 7 Dec 2007 15:02:48 +0000 Subject: more test work --- tests/setadm/conf/admin.ini | 4 ++++ tests/setadm/conf/ticker_zbranch.ini | 10 ++++++++++ tests/setadm/conf/ticker_zleaf.ini | 10 ++++++++++ tests/setadm/conf/ticker_zroot.ini | 10 ++++++++++ tests/setadm/conf/zbranch.ini | 8 ++++++++ tests/setadm/conf/zleaf.ini | 8 ++++++++ tests/setadm/conf/zroot.ini | 7 +++++++ tests/setadm/gendb.sh | 10 +++++++--- tests/setadm/master.ini | 4 ---- tests/setadm/stop.sh | 13 +++++++++++++ tests/setadm/test.ini | 4 ---- tests/setadm/testconsumer.py | 11 +++++++++++ 12 files changed, 88 insertions(+), 11 deletions(-) create mode 100644 tests/setadm/conf/admin.ini create mode 100644 tests/setadm/conf/ticker_zbranch.ini create mode 100644 tests/setadm/conf/ticker_zleaf.ini create mode 100644 tests/setadm/conf/ticker_zroot.ini create mode 100644 tests/setadm/conf/zbranch.ini create mode 100644 tests/setadm/conf/zleaf.ini create mode 100644 tests/setadm/conf/zroot.ini delete mode 100644 tests/setadm/master.ini create mode 100755 tests/setadm/stop.sh delete mode 100644 tests/setadm/test.ini create mode 100755 tests/setadm/testconsumer.py diff --git a/tests/setadm/conf/admin.ini b/tests/setadm/conf/admin.ini new file mode 100644 index 00000000..ed045108 --- /dev/null +++ b/tests/setadm/conf/admin.ini @@ -0,0 +1,4 @@ +[set_admin] +set_name = zset +root_db = dbname=zset_root + diff --git a/tests/setadm/conf/ticker_zbranch.ini b/tests/setadm/conf/ticker_zbranch.ini new file mode 100644 index 00000000..7bf1746b --- /dev/null +++ b/tests/setadm/conf/ticker_zbranch.ini @@ -0,0 +1,10 @@ +[pgqadm] + +job_name = pgqadm_zbranch + +db = dbname=zset_branch + +logfile = sys/log.%(job_name)s +pidfile = sys/pid.%(job_name)s + + diff --git a/tests/setadm/conf/ticker_zleaf.ini b/tests/setadm/conf/ticker_zleaf.ini new file mode 100644 index 00000000..0f768acf --- /dev/null +++ b/tests/setadm/conf/ticker_zleaf.ini @@ -0,0 +1,10 @@ +[pgqadm] + +job_name = pgqadm_zleaf + +db = dbname=zset_leaf + +logfile = sys/log.%(job_name)s +pidfile = sys/pid.%(job_name)s + + diff --git a/tests/setadm/conf/ticker_zroot.ini b/tests/setadm/conf/ticker_zroot.ini new file mode 100644 index 00000000..5e87bde5 --- /dev/null +++ b/tests/setadm/conf/ticker_zroot.ini @@ -0,0 +1,10 @@ +[pgqadm] + +job_name = pgqadm_zroot + +db = dbname=zset_root + +logfile = sys/log.%(job_name)s +pidfile = sys/pid.%(job_name)s + + diff --git a/tests/setadm/conf/zbranch.ini b/tests/setadm/conf/zbranch.ini new file mode 100644 index 00000000..c27f23e6 --- /dev/null +++ b/tests/setadm/conf/zbranch.ini @@ -0,0 +1,8 @@ +[test_consumer] +set_name = zset +subscriber_db = dbname=zset_branch + +job_name = branch_consumer +logfile = sys/log.%(job_name)s +pidfile = sys/pid.%(job_name)s + diff --git a/tests/setadm/conf/zleaf.ini b/tests/setadm/conf/zleaf.ini new file mode 100644 index 00000000..55dad167 --- /dev/null +++ b/tests/setadm/conf/zleaf.ini @@ -0,0 +1,8 @@ +[test_consumer] +set_name = zset +subscriber_db = dbname=zset_leaf + +job_name = leaf_consumer +logfile = sys/log.%(job_name)s +pidfile = sys/pid.%(job_name)s + diff --git a/tests/setadm/conf/zroot.ini b/tests/setadm/conf/zroot.ini new file mode 100644 index 00000000..d3435170 --- /dev/null +++ b/tests/setadm/conf/zroot.ini @@ -0,0 +1,7 @@ +[test_consumer] +set_name = zset +subscriber_db = dbname=zset_root +job_name = root_consumer +logfile = sys/log.%(job_name)s +pidfile = sys/pid.%(job_name)s + diff --git a/tests/setadm/gendb.sh b/tests/setadm/gendb.sh index 168e3261..59917bdf 100755 --- a/tests/setadm/gendb.sh +++ b/tests/setadm/gendb.sh @@ -1,6 +1,7 @@ #! /bin/sh . ../env.sh +./stop.sh dropdb zset_root dropdb zset_branch @@ -9,8 +10,11 @@ createdb zset_root createdb zset_branch createdb zset_leaf -setadm.py master.ini init-root z-root "dbname=zset_root" -setadm.py master.ini init-branch z-branch "dbname=zset_branch" --provider=z-root -setadm.py master.ini init-leaf z-leaf "dbname=zset_leaf" --provider=z-branch +setadm.py conf/admin.ini init-root z-root "dbname=zset_root" +setadm.py conf/admin.ini init-branch z-branch "dbname=zset_branch" --provider=z-root +setadm.py conf/admin.ini init-leaf z-leaf "dbname=zset_leaf" --provider=z-branch +./testconsumer.py -v -d conf/zroot.ini +./testconsumer.py -v -d conf/zbranch.ini +./testconsumer.py -v -d conf/zleaf.ini diff --git a/tests/setadm/master.ini b/tests/setadm/master.ini deleted file mode 100644 index ed045108..00000000 --- a/tests/setadm/master.ini +++ /dev/null @@ -1,4 +0,0 @@ -[set_admin] -set_name = zset -root_db = dbname=zset_root - diff --git a/tests/setadm/stop.sh b/tests/setadm/stop.sh new file mode 100755 index 00000000..12295f86 --- /dev/null +++ b/tests/setadm/stop.sh @@ -0,0 +1,13 @@ +#! /bin/sh + +. ../env.sh + +./testconsumer.py -s conf/zroot.ini +./testconsumer.py -s conf/zbranch.ini +./testconsumer.py -s conf/zleaf.ini + +#sleep 1 + +#pgqadm.py -s conf/ticker.ini +#pgqadm.py -s conf/linkticker.ini + diff --git a/tests/setadm/test.ini b/tests/setadm/test.ini deleted file mode 100644 index a976160f..00000000 --- a/tests/setadm/test.ini +++ /dev/null @@ -1,4 +0,0 @@ -[setconsumer] -set_name = aset -subscriber_db = dbname=settest - diff --git a/tests/setadm/testconsumer.py b/tests/setadm/testconsumer.py new file mode 100755 index 00000000..bce25a31 --- /dev/null +++ b/tests/setadm/testconsumer.py @@ -0,0 +1,11 @@ +#! /usr/bin/env python + +import sys, pgq + +class TestConsumer(pgq.SetConsumer): + pass + +if __name__ == '__main__': + script = TestConsumer('test_consumer', sys.argv[1:]) + script.start() + -- cgit v1.2.3