summaryrefslogtreecommitdiffstats
path: root/tests/queue-persist-drvr.sh
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2009-05-27 11:29:47 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2009-05-27 11:29:47 +0200
commita900a7c34b674573f4b86350af0d68838da6550a (patch)
tree2915594fc1feeaddc31e690f29608cd1bc94da32 /tests/queue-persist-drvr.sh
parentddf74cc165c828139632170224356175c9c24e96 (diff)
downloadrsyslog-a900a7c34b674573f4b86350af0d68838da6550a.tar.gz
rsyslog-a900a7c34b674573f4b86350af0d68838da6550a.tar.xz
rsyslog-a900a7c34b674573f4b86350af0d68838da6550a.zip
greatly enhanced testbench
The imdiag module now can very effectively inject messages, which also frees us from uncertainties of tcp reception and processing. All shell script based tests have been modularized, what makes it far easier to create new tests. Also, the test bench now executes more reliable and much faster, because we can now rely on actual engine information where we previously did just a dumb sleep.
Diffstat (limited to 'tests/queue-persist-drvr.sh')
-rwxr-xr-xtests/queue-persist-drvr.sh28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/queue-persist-drvr.sh b/tests/queue-persist-drvr.sh
new file mode 100755
index 00000000..ea5386a7
--- /dev/null
+++ b/tests/queue-persist-drvr.sh
@@ -0,0 +1,28 @@
+# Test for queue data persisting at shutdown. The
+# plan is to start an instance, emit some data, do a relatively
+# fast shutdown and then re-start the engine to process the
+# remaining data.
+# added 2009-05-27 by Rgerhards
+# This file is part of the rsyslog project, released under GPLv3
+# uncomment for debugging support:
+echo testing memory queue persisting to disk, mode $1
+source $srcdir/diag.sh init
+
+# prepare config
+echo \$MainMsgQueueType $1 > work-queuemode.conf
+echo "*.* :omtesting:sleep 0 1000" > work-delay.conf
+
+# inject 5000 msgs, so that we do not hit the high watermark
+source $srcdir/diag.sh startup queue-persist.conf
+source $srcdir/diag.sh injectmsg 0 5000
+$srcdir/diag.sh shutdown-immediate
+$srcdir/diag.sh wait-shutdown
+source $srcdir/diag.sh check-mainq-spool
+
+# restart engine and have rest processed
+#remove delay
+echo "#" > work-delay.conf
+source $srcdir/diag.sh startup queue-persist.conf
+source $srcdir/diag.sh shutdown-when-empty # shut down rsyslogd when done processing messages
+source $srcdir/diag.sh seq-check 0 4999
+source $srcdir/diag.sh exit