rsyslog/tests/pgsql-actq-mt-withpause.sh
Dan Molik f334e2b250 ompgsql plugin - update postgres module
The PostgreSQL output module was woefully out-of-date the following
list is changes made to update the module to current Rsyslog standards.

  - allow for v6 configuration syntax
  - configurable ports
  - support transactional interface
  - push db connection into workers (libpq is threadsafe)
  - enable module testing on travis
  - ensure configuration syntax backwards compatibility
  - formatting around postgres core templating
  - use new test conventions
  - add new configuration syntax test
  - add valgrind tests for new and old syntax
  - add threading tests
  - add action queue long running tests
  - add action queue valgrind test
2017-12-09 09:04:46 -05:00

40 lines
1.2 KiB
Bash
Executable File

#!/bin/bash
# This file is part of the rsyslog project, released under ASL 2.0
. $srcdir/diag.sh init
psql -h localhost -U postgres -f testsuites/pgsql-basic.sql
. $srcdir/diag.sh generate-conf
. $srcdir/diag.sh add-conf '
module(load="../plugins/ompgsql/.libs/ompgsql")
if $msg contains "msgnum" then {
action(type="ompgsql" server="127.0.0.1"
db="syslogtest" user="postgres" pass="testbench"
queue.size="10000" queue.type="linkedList"
queue.workerthreads="5"
queue.workerthreadMinimumMessages="500"
queue.timeoutWorkerthreadShutdown="1000"
queue.timeoutEnqueue="10000"
)
}'
. $srcdir/diag.sh startup
. $srcdir/diag.sh injectmsg 0 50000
. $srcdir/diag.sh wait-queueempty
echo waiting for worker threads to timeout
./msleep 3000
. $srcdir/diag.sh injectmsg 50000 50000
. $srcdir/diag.sh wait-queueempty
echo waiting for worker threads to timeout
./msleep 2000
. $srcdir/diag.sh injectmsg 100000 50000
. $srcdir/diag.sh shutdown-when-empty
. $srcdir/diag.sh wait-shutdown
psql -h localhost -U postgres -d syslogtest -f testsuites/pgsql-select-msg.sql -t -A > rsyslog.out.log
. $srcdir/diag.sh seq-check 0 149999
echo cleaning up test database
psql -h localhost -U postgres -c 'DROP DATABASE IF EXISTS syslogtest;'
. $srcdir/diag.sh exit