mirror of
https://github.com/rsyslog/rsyslog.git
synced 2025-12-13 04:50:41 +01:00
Test refactor part 2
This commit is contained in:
parent
68b6f3ac79
commit
aa0b3e4657
@ -6,7 +6,26 @@ export TCPFLOOD_EXTRA_OPTS="-M'msg:msg: 1:2, 3:4, 5:6, 7:8 b test'"
|
||||
echo ===============================================================================
|
||||
echo \[msgvar-concurrency-array-event.tags.sh\]: testing concurrency of local variables
|
||||
. $srcdir/diag.sh init
|
||||
startup msgvar-concurrency-array-event.tags.conf
|
||||
generate_conf
|
||||
add_conf '
|
||||
module(load="../plugins/mmnormalize/.libs/mmnormalize")
|
||||
module(load="../plugins/imtcp/.libs/imtcp")
|
||||
input(type="imtcp" port="13514")
|
||||
|
||||
template(name="outfmt" type="string" string="%$!%\n")
|
||||
|
||||
#action(type="omfile" file="rsyslog2.out.log" template="outfmt" queue.type="linkedList")
|
||||
action(type="mmnormalize" ruleBase="testsuites/msgvar-concurrency-array-event.tags.rulebase")
|
||||
if $msg contains "msg:" then {
|
||||
# set $!tree!here!nbr = field($msg, 58, 2); # Delimiter = :
|
||||
action(type="omfile" file="rsyslog2.out.log" template="outfmt" queue.type="linkedList")
|
||||
set $!tree!here!save = $!tree!here!nbr;
|
||||
set $!tree!here!nbr = "";
|
||||
set $!tree!here!nbr = $!tree!here!save;
|
||||
action(type="omfile" file="rsyslog.out.log" template="outfmt" queue.type="linkedList")
|
||||
}
|
||||
'
|
||||
startup
|
||||
sleep 1
|
||||
. $srcdir/diag.sh tcpflood -m500000
|
||||
shutdown_when_empty # shut down rsyslogd when done processing messages
|
||||
|
||||
@ -6,7 +6,26 @@ export TCPFLOOD_EXTRA_OPTS="-M'msg:msg: 1:2, 3:4, 5:6, 7:8 b test'"
|
||||
echo ===============================================================================
|
||||
echo \[msgvar-concurrency-array.sh\]: testing concurrency of local variables
|
||||
. $srcdir/diag.sh init
|
||||
startup msgvar-concurrency-array.conf
|
||||
generate_conf
|
||||
add_conf '
|
||||
module(load="../plugins/mmnormalize/.libs/mmnormalize")
|
||||
module(load="../plugins/imtcp/.libs/imtcp")
|
||||
input(type="imtcp" port="13514")
|
||||
|
||||
template(name="outfmt" type="string" string="%$!%\n")
|
||||
|
||||
#action(type="omfile" file="rsyslog2.out.log" template="outfmt" queue.type="linkedList")
|
||||
action(type="mmnormalize" ruleBase="testsuites/msgvar-concurrency-array.rulebase")
|
||||
if $msg contains "msg:" then {
|
||||
# set $!tree!here!nbr = field($msg, 58, 2); # Delimiter = :
|
||||
action(type="omfile" file="rsyslog2.out.log" template="outfmt" queue.type="linkedList")
|
||||
set $!tree!here!save = $!tree!here!nbr;
|
||||
set $!tree!here!nbr = "";
|
||||
set $!tree!here!nbr = $!tree!here!save;
|
||||
action(type="omfile" file="rsyslog.out.log" template="outfmt" queue.type="linkedList")
|
||||
}
|
||||
'
|
||||
startup
|
||||
sleep 1
|
||||
. $srcdir/diag.sh tcpflood -m500000
|
||||
shutdown_when_empty # shut down rsyslogd when done processing messages
|
||||
|
||||
@ -12,7 +12,25 @@ if [ `uname` = "SunOS" ] ; then
|
||||
fi
|
||||
|
||||
. $srcdir/diag.sh init
|
||||
startup msgvar-concurrency.conf
|
||||
generate_conf
|
||||
add_conf '
|
||||
module(load="../plugins/imtcp/.libs/imtcp")
|
||||
input(type="imtcp" port="13514")
|
||||
|
||||
template(name="outfmt" type="string" string="%$!tree!here!nbr%\n")
|
||||
|
||||
if $msg contains "msgnum:" then {
|
||||
set $!tree!here!nbr = field($msg, 58, 2);
|
||||
action(type="omfile" file="rsyslog2.out.log" template="outfmt"
|
||||
queue.type="linkedList")
|
||||
|
||||
set $!tree!here!save = $!tree!here!nbr;
|
||||
set $!tree!here!nbr = "";
|
||||
set $!tree!here!nbr = $!tree!here!save;
|
||||
action(type="omfile" file="rsyslog.out.log" template="outfmt")
|
||||
}
|
||||
'
|
||||
startup
|
||||
sleep 1
|
||||
. $srcdir/diag.sh tcpflood -m500000
|
||||
shutdown_when_empty # shut down rsyslogd when done processing messages
|
||||
|
||||
@ -11,9 +11,21 @@ fi
|
||||
echo ===============================================================================
|
||||
echo \[multiple_lookup_table.sh\]: test for multiple lookup-table and HUP based reloading of it
|
||||
. $srcdir/diag.sh init
|
||||
generate_conf
|
||||
add_conf '
|
||||
lookup_table(name="xlate_0" file="xlate.lkp_tbl")
|
||||
lookup_table(name="xlate_1" file="xlate_1.lkp_tbl")
|
||||
|
||||
template(name="outfmt" type="string" string="- %msg% 0_%$.lkp_0% 1_%$.lkp_1%\n")
|
||||
|
||||
set $.lkp_0 = lookup("xlate_0", $msg);
|
||||
set $.lkp_1 = lookup("xlate_1", $msg);
|
||||
|
||||
action(type="omfile" file="./rsyslog.out.log" template="outfmt")
|
||||
'
|
||||
cp -f $srcdir/testsuites/xlate.lkp_tbl xlate.lkp_tbl
|
||||
cp -f $srcdir/testsuites/xlate.lkp_tbl xlate_1.lkp_tbl
|
||||
startup multiple_lookup_tables.conf
|
||||
startup
|
||||
. $srcdir/diag.sh injectmsg 0 3
|
||||
. $srcdir/diag.sh wait-queueempty
|
||||
. $srcdir/diag.sh content-check "msgnum:00000000: 0_foo_old 1_foo_old"
|
||||
|
||||
@ -4,8 +4,23 @@
|
||||
echo ===============================================================================
|
||||
echo \[mysql-act-mt.sh\]: test for mysql with multithread actionq
|
||||
. $srcdir/diag.sh init
|
||||
generate_conf
|
||||
add_conf '
|
||||
module(load="../plugins/ommysql/.libs/ommysql")
|
||||
|
||||
:msg, contains, "msgnum:" {
|
||||
action(type="ommysql" server="127.0.0.1"
|
||||
db="Syslog" uid="rsyslog" pwd="testbench"
|
||||
queue.size="10000" queue.type="linkedList"
|
||||
queue.workerthreads="5"
|
||||
queue.workerthreadMinimumMessages="500"
|
||||
queue.timeoutWorkerthreadShutdown="100"
|
||||
queue.timeoutEnqueue="10000"
|
||||
)
|
||||
}
|
||||
'
|
||||
mysql --user=rsyslog --password=testbench < testsuites/mysql-truncate.sql
|
||||
startup mysql-actq-mt-withpause-extended.conf
|
||||
startup
|
||||
|
||||
|
||||
let "strtnum = 0"
|
||||
|
||||
@ -3,8 +3,23 @@
|
||||
echo ===============================================================================
|
||||
echo \[mysql-act-mt.sh\]: test for mysql with multithread actionq
|
||||
. $srcdir/diag.sh init
|
||||
generate_conf
|
||||
add_conf '
|
||||
module(load="../plugins/ommysql/.libs/ommysql")
|
||||
|
||||
:msg, contains, "msgnum:" {
|
||||
action(type="ommysql" server="127.0.0.1"
|
||||
db="Syslog" uid="rsyslog" pwd="testbench"
|
||||
queue.size="10000" queue.type="linkedList"
|
||||
queue.workerthreads="5"
|
||||
queue.workerthreadMinimumMessages="500"
|
||||
queue.timeoutWorkerthreadShutdown="1000"
|
||||
queue.timeoutEnqueue="10000"
|
||||
)
|
||||
}
|
||||
'
|
||||
mysql --user=rsyslog --password=testbench < testsuites/mysql-truncate.sql
|
||||
startup_vg mysql-actq-mt.conf
|
||||
startup_vg
|
||||
. $srcdir/diag.sh injectmsg 0 50000
|
||||
. $srcdir/diag.sh wait-queueempty
|
||||
echo waiting for worker threads to timeout
|
||||
|
||||
@ -3,8 +3,23 @@
|
||||
echo ===============================================================================
|
||||
echo \[mysql-act-mt.sh\]: test for mysql with multithread actionq
|
||||
. $srcdir/diag.sh init
|
||||
generate_conf
|
||||
add_conf '
|
||||
module(load="../plugins/ommysql/.libs/ommysql")
|
||||
|
||||
:msg, contains, "msgnum:" {
|
||||
action(type="ommysql" server="127.0.0.1"
|
||||
db="Syslog" uid="rsyslog" pwd="testbench"
|
||||
queue.size="10000" queue.type="linkedList"
|
||||
queue.workerthreads="5"
|
||||
queue.workerthreadMinimumMessages="500"
|
||||
queue.timeoutWorkerthreadShutdown="1000"
|
||||
queue.timeoutEnqueue="10000"
|
||||
)
|
||||
}
|
||||
'
|
||||
mysql --user=rsyslog --password=testbench < testsuites/mysql-truncate.sql
|
||||
startup mysql-actq-mt.conf
|
||||
startup
|
||||
. $srcdir/diag.sh injectmsg 0 50000
|
||||
. $srcdir/diag.sh wait-queueempty
|
||||
echo waiting for worker threads to timeout
|
||||
|
||||
@ -3,8 +3,23 @@
|
||||
echo ===============================================================================
|
||||
echo \[mysql-act-mt.sh\]: test for mysql with multithread actionq
|
||||
. $srcdir/diag.sh init
|
||||
generate_conf
|
||||
add_conf '
|
||||
module(load="../plugins/ommysql/.libs/ommysql")
|
||||
|
||||
:msg, contains, "msgnum:" {
|
||||
action(type="ommysql" server="127.0.0.1"
|
||||
db="Syslog" uid="rsyslog" pwd="testbench"
|
||||
queue.size="10000" queue.type="linkedList"
|
||||
queue.workerthreads="5"
|
||||
queue.workerthreadMinimumMessages="500"
|
||||
queue.timeoutWorkerthreadShutdown="1000"
|
||||
queue.timeoutEnqueue="10000"
|
||||
)
|
||||
}
|
||||
'
|
||||
mysql --user=rsyslog --password=testbench < testsuites/mysql-truncate.sql
|
||||
startup mysql-actq-mt.conf
|
||||
startup
|
||||
. $srcdir/diag.sh injectmsg 0 150000
|
||||
shutdown_when_empty
|
||||
wait_shutdown
|
||||
|
||||
@ -3,8 +3,15 @@
|
||||
echo ===============================================================================
|
||||
echo \[mysql-asyn.sh\]: asyn test for mysql functionality
|
||||
. $srcdir/diag.sh init
|
||||
generate_conf
|
||||
add_conf '
|
||||
$ModLoad ../plugins/ommysql/.libs/ommysql
|
||||
$ActionQueueType LinkedList
|
||||
$ActionQueueTimeoutEnqueue 10000 # 10 second to make sure we do not loose due to action q full
|
||||
:msg, contains, "msgnum:" :ommysql:127.0.0.1,Syslog,rsyslog,testbench;
|
||||
'
|
||||
mysql --user=rsyslog --password=testbench < testsuites/mysql-truncate.sql
|
||||
startup_vg mysql-asyn.conf
|
||||
startup_vg
|
||||
. $srcdir/diag.sh injectmsg 0 50000
|
||||
shutdown_when_empty
|
||||
wait_shutdown_vg
|
||||
|
||||
@ -3,8 +3,15 @@
|
||||
echo ===============================================================================
|
||||
echo \[mysql-asyn.sh\]: asyn test for mysql functionality
|
||||
. $srcdir/diag.sh init
|
||||
generate_conf
|
||||
add_conf '
|
||||
$ModLoad ../plugins/ommysql/.libs/ommysql
|
||||
$ActionQueueType LinkedList
|
||||
$ActionQueueTimeoutEnqueue 10000 # 10 second to make sure we do not loose due to action q full
|
||||
:msg, contains, "msgnum:" :ommysql:127.0.0.1,Syslog,rsyslog,testbench;
|
||||
'
|
||||
mysql --user=rsyslog --password=testbench < testsuites/mysql-truncate.sql
|
||||
startup mysql-asyn.conf
|
||||
startup
|
||||
. $srcdir/diag.sh injectmsg 0 50000
|
||||
shutdown_when_empty
|
||||
wait_shutdown
|
||||
|
||||
@ -3,8 +3,16 @@
|
||||
echo ===============================================================================
|
||||
echo \[mysql-basic.sh\]: basic test for mysql-basic functionality
|
||||
. $srcdir/diag.sh init
|
||||
generate_conf
|
||||
add_conf '
|
||||
$ModLoad ../plugins/ommysql/.libs/ommysql
|
||||
if $msg contains 'msgnum' then {
|
||||
action(type="ommysql" server="127.0.0.1"
|
||||
db="Syslog" uid="rsyslog" pwd="testbench")
|
||||
}
|
||||
'
|
||||
mysql --user=rsyslog --password=testbench < testsuites/mysql-truncate.sql
|
||||
startup mysql-basic-cnf6.conf
|
||||
startup
|
||||
. $srcdir/diag.sh injectmsg 0 5000
|
||||
shutdown_when_empty
|
||||
wait_shutdown
|
||||
|
||||
@ -3,8 +3,13 @@
|
||||
echo ===============================================================================
|
||||
echo \[mysql-basic-vg.sh\]: basic test for mysql-basic functionality/valgrind
|
||||
. $srcdir/diag.sh init
|
||||
generate_conf
|
||||
add_conf '
|
||||
$ModLoad ../plugins/ommysql/.libs/ommysql
|
||||
:msg, contains, "msgnum:" :ommysql:127.0.0.1,Syslog,rsyslog,testbench;
|
||||
'
|
||||
mysql --user=rsyslog --password=testbench < testsuites/mysql-truncate.sql
|
||||
startup_vg mysql-basic.conf
|
||||
startup_vg
|
||||
. $srcdir/diag.sh injectmsg 0 5000
|
||||
shutdown_when_empty
|
||||
wait_shutdown_vg
|
||||
|
||||
@ -3,8 +3,13 @@
|
||||
echo ===============================================================================
|
||||
echo \[mysql-basic.sh\]: basic test for mysql-basic functionality
|
||||
. $srcdir/diag.sh init
|
||||
generate_conf
|
||||
add_conf '
|
||||
$ModLoad ../plugins/ommysql/.libs/ommysql
|
||||
:msg, contains, "msgnum:" :ommysql:127.0.0.1,Syslog,rsyslog,testbench;
|
||||
'
|
||||
mysql --user=rsyslog --password=testbench < testsuites/mysql-truncate.sql
|
||||
startup mysql-basic.conf
|
||||
startup
|
||||
. $srcdir/diag.sh injectmsg 0 5000
|
||||
shutdown_when_empty
|
||||
wait_shutdown
|
||||
|
||||
@ -4,7 +4,17 @@
|
||||
echo ===============================================================================
|
||||
echo \[no-dynstats-json.sh\]: test for verifying stats are reported correctly in json format in absence of any dynstats buckets being configured
|
||||
. $srcdir/diag.sh init
|
||||
startup no-dynstats-json.conf
|
||||
generate_conf
|
||||
add_conf '
|
||||
ruleset(name="stats") {
|
||||
action(type="omfile" file="./rsyslog.out.stats.log")
|
||||
}
|
||||
|
||||
module(load="../plugins/impstats/.libs/impstats" interval="1" severity="7" resetCounters="on" Ruleset="stats" bracketing="on" format="json")
|
||||
|
||||
action(type="omfile" file="./rsyslog.out.log")
|
||||
'
|
||||
startup
|
||||
. $srcdir/diag.sh wait-for-stats-flush 'rsyslog.out.stats.log'
|
||||
echo doing shutdown
|
||||
shutdown_when_empty
|
||||
|
||||
@ -4,7 +4,17 @@
|
||||
echo ===============================================================================
|
||||
echo \[no-dynstats.sh\]: test for verifying stats are reported correctly in legacy format in absence of any dynstats buckets being configured
|
||||
. $srcdir/diag.sh init
|
||||
startup no-dynstats.conf
|
||||
generate_conf
|
||||
add_conf '
|
||||
ruleset(name="stats") {
|
||||
action(type="omfile" file="./rsyslog.out.stats.log")
|
||||
}
|
||||
|
||||
module(load="../plugins/impstats/.libs/impstats" interval="1" severity="7" resetCounters="on" Ruleset="stats" bracketing="on")
|
||||
|
||||
action(type="omfile" file="./rsyslog.out.log")
|
||||
'
|
||||
startup
|
||||
. $srcdir/diag.sh wait-for-stats-flush 'rsyslog.out.stats.log'
|
||||
echo doing shutdown
|
||||
shutdown_when_empty
|
||||
|
||||
@ -4,12 +4,22 @@
|
||||
# requires faketime
|
||||
echo \[now-utc\]: test \$NOW-UTC
|
||||
. $srcdir/diag.sh init
|
||||
generate_conf
|
||||
add_conf '
|
||||
$ModLoad ../plugins/imtcp/.libs/imtcp
|
||||
$InputTCPServerRun 13514
|
||||
|
||||
template(name="outfmt" type="string"
|
||||
string="%$now%,%$now-utc%\n")
|
||||
:msg, contains, "msgnum:" action(type="omfile" template="outfmt"
|
||||
file="rsyslog.out.log")
|
||||
'
|
||||
|
||||
. $srcdir/faketime_common.sh
|
||||
|
||||
export TZ=TEST-02:00
|
||||
|
||||
FAKETIME='2016-01-01 01:00:00' startup now-utc.conf
|
||||
FAKETIME='2016-01-01 01:00:00' startup
|
||||
# what we send actually is irrelevant, as we just use system properties.
|
||||
# but we need to send one message in order to gain output!
|
||||
. $srcdir/diag.sh tcpflood -m1
|
||||
|
||||
@ -4,12 +4,22 @@
|
||||
# requires faketime
|
||||
echo \[now_family_utc\]: test \$NOW family of system properties
|
||||
. $srcdir/diag.sh init
|
||||
generate_conf
|
||||
add_conf '
|
||||
$ModLoad ../plugins/imtcp/.libs/imtcp
|
||||
$InputTCPServerRun 13514
|
||||
|
||||
template(name="outfmt" type="string"
|
||||
string="%$hour%:%$minute%,%$hour-utc%:%$minute-utc%\n")
|
||||
:msg, contains, "msgnum:" action(type="omfile" template="outfmt"
|
||||
file="rsyslog.out.log")
|
||||
'
|
||||
|
||||
. $srcdir/faketime_common.sh
|
||||
|
||||
export TZ=TEST+06:30
|
||||
|
||||
FAKETIME='2016-01-01 01:00:00' startup now_family_utc.conf
|
||||
FAKETIME='2016-01-01 01:00:00' startup
|
||||
# what we send actually is irrelevant, as we just use system properties.
|
||||
# but we need to send one message in order to gain output!
|
||||
. $srcdir/diag.sh tcpflood -m1
|
||||
|
||||
@ -6,7 +6,31 @@
|
||||
# the unresponsive child if killUnresponsive=on.
|
||||
|
||||
. $srcdir/diag.sh init
|
||||
startup omprog-close-unresponsive-noterm.conf
|
||||
generate_conf
|
||||
add_conf '
|
||||
module(load="../plugins/omprog/.libs/omprog")
|
||||
|
||||
template(name="outfmt" type="string" string="%msg%\n")
|
||||
|
||||
main_queue(
|
||||
queue.timeoutShutdown="60000" # give time to omprog to wait for the child
|
||||
)
|
||||
|
||||
:msg, contains, "msgnum:" {
|
||||
action(
|
||||
type="omprog"
|
||||
binary=`echo $srcdir/testsuites/omprog-close-unresponsive-bin.sh`
|
||||
template="outfmt"
|
||||
name="omprog_action"
|
||||
queue.type="Direct" # the default; facilitates sync with the child process
|
||||
confirmMessages="on" # facilitates sync with the child process
|
||||
signalOnClose="off"
|
||||
closeTimeout="1000" # ms
|
||||
killUnresponsive="on" # default value: the value of signalOnClose
|
||||
)
|
||||
}
|
||||
'
|
||||
startup
|
||||
. $srcdir/diag.sh wait-startup
|
||||
. $srcdir/diag.sh injectmsg 0 10
|
||||
. $srcdir/diag.sh wait-queueempty
|
||||
|
||||
@ -6,7 +6,31 @@
|
||||
# rest of checks (this simplifies the maintenance of the tests).
|
||||
|
||||
. $srcdir/diag.sh init
|
||||
startup_vg omprog-close-unresponsive.conf
|
||||
generate_conf
|
||||
add_conf '
|
||||
module(load="../plugins/omprog/.libs/omprog")
|
||||
|
||||
template(name="outfmt" type="string" string="%msg%\n")
|
||||
|
||||
main_queue(
|
||||
queue.timeoutShutdown="60000" # give time to omprog to wait for the child
|
||||
)
|
||||
|
||||
:msg, contains, "msgnum:" {
|
||||
action(
|
||||
type="omprog"
|
||||
binary=`echo $srcdir/testsuites/omprog-close-unresponsive-bin.sh`
|
||||
template="outfmt"
|
||||
name="omprog_action"
|
||||
queue.type="Direct" # the default; facilitates sync with the child process
|
||||
confirmMessages="on" # facilitates sync with the child process
|
||||
signalOnClose="on"
|
||||
closeTimeout="1000" # ms
|
||||
#killUnresponsive="on" # default value: the value of signalOnClose
|
||||
)
|
||||
}
|
||||
'
|
||||
startup_vg
|
||||
. $srcdir/diag.sh wait-startup
|
||||
. $srcdir/diag.sh injectmsg 0 10
|
||||
. $srcdir/diag.sh wait-queueempty
|
||||
|
||||
@ -6,7 +6,31 @@
|
||||
# child if unresponsive.
|
||||
|
||||
. $srcdir/diag.sh init
|
||||
startup omprog-close-unresponsive.conf
|
||||
generate_conf
|
||||
add_conf '
|
||||
module(load="../plugins/omprog/.libs/omprog")
|
||||
|
||||
template(name="outfmt" type="string" string="%msg%\n")
|
||||
|
||||
main_queue(
|
||||
queue.timeoutShutdown="60000" # give time to omprog to wait for the child
|
||||
)
|
||||
|
||||
:msg, contains, "msgnum:" {
|
||||
action(
|
||||
type="omprog"
|
||||
binary=`echo $srcdir/testsuites/omprog-close-unresponsive-bin.sh`
|
||||
template="outfmt"
|
||||
name="omprog_action"
|
||||
queue.type="Direct" # the default; facilitates sync with the child process
|
||||
confirmMessages="on" # facilitates sync with the child process
|
||||
signalOnClose="on"
|
||||
closeTimeout="1000" # ms
|
||||
#killUnresponsive="on" # default value: the value of signalOnClose
|
||||
)
|
||||
}
|
||||
'
|
||||
startup
|
||||
. $srcdir/diag.sh wait-startup
|
||||
. $srcdir/diag.sh injectmsg 0 10
|
||||
. $srcdir/diag.sh wait-queueempty
|
||||
|
||||
@ -6,7 +6,27 @@
|
||||
# rest of checks (this simplifies the maintenance of the tests).
|
||||
|
||||
. $srcdir/diag.sh init
|
||||
startup_vg omprog-feedback.conf
|
||||
generate_conf
|
||||
add_conf '
|
||||
module(load="../plugins/omprog/.libs/omprog")
|
||||
|
||||
template(name="outfmt" type="string" string="%msg%\n")
|
||||
|
||||
:msg, contains, "msgnum:" {
|
||||
action(
|
||||
type="omprog"
|
||||
binary=`echo $srcdir/testsuites/omprog-feedback-bin.sh`
|
||||
template="outfmt"
|
||||
name="omprog_action"
|
||||
queue.type="Direct" # the default; facilitates sync with the child process
|
||||
confirmMessages="on"
|
||||
useTransactions="off"
|
||||
action.resumeRetryCount="10"
|
||||
action.resumeInterval="1"
|
||||
)
|
||||
}
|
||||
'
|
||||
startup_vg
|
||||
. $srcdir/diag.sh wait-startup
|
||||
. $srcdir/diag.sh injectmsg 0 10
|
||||
. $srcdir/diag.sh wait-queueempty
|
||||
|
||||
@ -6,7 +6,27 @@
|
||||
# it has failed to process.
|
||||
|
||||
. $srcdir/diag.sh init
|
||||
startup omprog-feedback.conf
|
||||
generate_conf
|
||||
add_conf '
|
||||
module(load="../plugins/omprog/.libs/omprog")
|
||||
|
||||
template(name="outfmt" type="string" string="%msg%\n")
|
||||
|
||||
:msg, contains, "msgnum:" {
|
||||
action(
|
||||
type="omprog"
|
||||
binary=`echo $srcdir/testsuites/omprog-feedback-bin.sh`
|
||||
template="outfmt"
|
||||
name="omprog_action"
|
||||
queue.type="Direct" # the default; facilitates sync with the child process
|
||||
confirmMessages="on"
|
||||
useTransactions="off"
|
||||
action.resumeRetryCount="10"
|
||||
action.resumeInterval="1"
|
||||
)
|
||||
}
|
||||
'
|
||||
startup
|
||||
. $srcdir/diag.sh wait-startup
|
||||
. $srcdir/diag.sh injectmsg 0 10
|
||||
. $srcdir/diag.sh wait-queueempty
|
||||
|
||||
@ -6,9 +6,31 @@
|
||||
# descriptors handled by omprog.
|
||||
|
||||
. $srcdir/diag.sh init
|
||||
generate_conf
|
||||
add_conf '
|
||||
module(load="../plugins/omprog/.libs/omprog")
|
||||
|
||||
template(name="outfmt" type="string" string="%msg%\n")
|
||||
|
||||
:msg, contains, "msgnum:" {
|
||||
action(
|
||||
type="omprog"
|
||||
binary=`echo $srcdir/testsuites/omprog-restart-terminated-bin.sh`
|
||||
template="outfmt"
|
||||
name="omprog_action"
|
||||
queue.type="Direct" # the default; facilitates sync with the child process
|
||||
confirmMessages="on" # facilitates sync with the child process
|
||||
action.resumeRetryCount="10"
|
||||
action.resumeInterval="1"
|
||||
action.reportSuspensionContinuation="on"
|
||||
signalOnClose="off"
|
||||
output="./rsyslog.omprog.out.log"
|
||||
)
|
||||
}
|
||||
'
|
||||
. $srcdir/diag.sh check-command-available lsof
|
||||
|
||||
startup omprog-restart-terminated-outfile.conf
|
||||
startup
|
||||
. $srcdir/diag.sh wait-startup
|
||||
. $srcdir/diag.sh injectmsg 0 1
|
||||
. $srcdir/diag.sh wait-queueempty
|
||||
|
||||
@ -6,7 +6,28 @@
|
||||
# rest of checks (this simplifies the maintenance of the tests).
|
||||
|
||||
. $srcdir/diag.sh init
|
||||
startup_vg omprog-restart-terminated.conf
|
||||
generate_conf
|
||||
add_conf '
|
||||
module(load="../plugins/omprog/.libs/omprog")
|
||||
|
||||
template(name="outfmt" type="string" string="%msg%\n")
|
||||
|
||||
:msg, contains, "msgnum:" {
|
||||
action(
|
||||
type="omprog"
|
||||
binary=`echo $srcdir/testsuites/omprog-restart-terminated-bin.sh`
|
||||
template="outfmt"
|
||||
name="omprog_action"
|
||||
queue.type="Direct" # the default; facilitates sync with the child process
|
||||
confirmMessages="on" # facilitates sync with the child process
|
||||
action.resumeRetryCount="10"
|
||||
action.resumeInterval="1"
|
||||
action.reportSuspensionContinuation="on"
|
||||
signalOnClose="off"
|
||||
)
|
||||
}
|
||||
'
|
||||
startup_vg
|
||||
. $srcdir/diag.sh wait-startup
|
||||
. $srcdir/diag.sh injectmsg 0 1
|
||||
. $srcdir/diag.sh wait-queueempty
|
||||
|
||||
@ -9,9 +9,30 @@
|
||||
# is expecting the program to confirm the last message).
|
||||
|
||||
. $srcdir/diag.sh init
|
||||
generate_conf
|
||||
add_conf '
|
||||
module(load="../plugins/omprog/.libs/omprog")
|
||||
|
||||
template(name="outfmt" type="string" string="%msg%\n")
|
||||
|
||||
:msg, contains, "msgnum:" {
|
||||
action(
|
||||
type="omprog"
|
||||
binary=`echo $srcdir/testsuites/omprog-restart-terminated-bin.sh`
|
||||
template="outfmt"
|
||||
name="omprog_action"
|
||||
queue.type="Direct" # the default; facilitates sync with the child process
|
||||
confirmMessages="on" # facilitates sync with the child process
|
||||
action.resumeRetryCount="10"
|
||||
action.resumeInterval="1"
|
||||
action.reportSuspensionContinuation="on"
|
||||
signalOnClose="off"
|
||||
)
|
||||
}
|
||||
'
|
||||
. $srcdir/diag.sh check-command-available lsof
|
||||
|
||||
startup omprog-restart-terminated.conf
|
||||
startup
|
||||
. $srcdir/diag.sh wait-startup
|
||||
. $srcdir/diag.sh injectmsg 0 1
|
||||
. $srcdir/diag.sh wait-queueempty
|
||||
|
||||
@ -6,6 +6,27 @@
|
||||
# transaction commits.
|
||||
|
||||
. $srcdir/diag.sh init
|
||||
generate_conf
|
||||
add_conf '
|
||||
module(load="../plugins/omprog/.libs/omprog")
|
||||
|
||||
template(name="outfmt" type="string" string="%msg%\n")
|
||||
|
||||
:msg, contains, "msgnum:" {
|
||||
action(
|
||||
type="omprog"
|
||||
binary=`echo $srcdir/testsuites/omprog-transactions-bin.sh --failed_commits`
|
||||
template="outfmt"
|
||||
name="omprog_action"
|
||||
queue.type="Direct" # the default; facilitates sync with the child process
|
||||
queue.dequeueBatchSize="6"
|
||||
confirmMessages="on"
|
||||
useTransactions="on"
|
||||
action.resumeRetryCount="10"
|
||||
action.resumeInterval="1"
|
||||
)
|
||||
}
|
||||
'
|
||||
|
||||
uname
|
||||
if [ `uname` = "SunOS" ] ; then
|
||||
@ -16,7 +37,7 @@ if [ `uname` = "SunOS" ] ; then
|
||||
exit 77
|
||||
fi
|
||||
|
||||
startup omprog-transactions-failed-commits.conf
|
||||
startup
|
||||
. $srcdir/diag.sh wait-startup
|
||||
. $srcdir/diag.sh injectmsg 0 10
|
||||
. $srcdir/diag.sh wait-queueempty
|
||||
|
||||
@ -6,7 +6,28 @@
|
||||
# messages.
|
||||
|
||||
. $srcdir/diag.sh init
|
||||
startup omprog-transactions-failed-messages.conf
|
||||
generate_conf
|
||||
add_conf '
|
||||
module(load="../plugins/omprog/.libs/omprog")
|
||||
|
||||
template(name="outfmt" type="string" string="%msg%\n")
|
||||
|
||||
:msg, contains, "msgnum:" {
|
||||
action(
|
||||
type="omprog"
|
||||
binary=`echo $srcdir/testsuites/omprog-transactions-bin.sh --failed_messages`
|
||||
template="outfmt"
|
||||
name="omprog_action"
|
||||
queue.type="Direct" # the default; facilitates sync with the child process
|
||||
queue.dequeueBatchSize="6"
|
||||
confirmMessages="on"
|
||||
useTransactions="on"
|
||||
action.resumeRetryCount="10"
|
||||
action.resumeInterval="1"
|
||||
)
|
||||
}
|
||||
'
|
||||
startup
|
||||
. $srcdir/diag.sh wait-startup
|
||||
. $srcdir/diag.sh injectmsg 0 10
|
||||
. $srcdir/diag.sh wait-queueempty
|
||||
|
||||
@ -6,7 +6,30 @@
|
||||
# rest of checks (this simplifies the maintenance of the tests).
|
||||
|
||||
. $srcdir/diag.sh init
|
||||
startup_vg omprog-transactions.conf
|
||||
generate_conf
|
||||
add_conf '
|
||||
module(load="../plugins/omprog/.libs/omprog")
|
||||
|
||||
template(name="outfmt" type="string" string="%msg%\n")
|
||||
|
||||
:msg, contains, "msgnum:" {
|
||||
action(
|
||||
type="omprog"
|
||||
binary=`echo $srcdir/testsuites/omprog-transactions-bin.sh`
|
||||
template="outfmt"
|
||||
name="omprog_action"
|
||||
queue.type="Direct" # the default; facilitates sync with the child process
|
||||
queue.dequeueBatchSize="6"
|
||||
confirmMessages="on"
|
||||
useTransactions="on"
|
||||
beginTransactionMark="BEGIN TRANSACTION"
|
||||
commitTransactionMark="COMMIT TRANSACTION"
|
||||
action.resumeRetryCount="10"
|
||||
action.resumeInterval="1"
|
||||
)
|
||||
}
|
||||
'
|
||||
startup_vg
|
||||
. $srcdir/diag.sh wait-startup
|
||||
. $srcdir/diag.sh injectmsg 0 10
|
||||
. $srcdir/diag.sh wait-queueempty
|
||||
|
||||
@ -6,7 +6,30 @@
|
||||
# and transactions.
|
||||
|
||||
. $srcdir/diag.sh init
|
||||
startup omprog-transactions.conf
|
||||
generate_conf
|
||||
add_conf '
|
||||
module(load="../plugins/omprog/.libs/omprog")
|
||||
|
||||
template(name="outfmt" type="string" string="%msg%\n")
|
||||
|
||||
:msg, contains, "msgnum:" {
|
||||
action(
|
||||
type="omprog"
|
||||
binary=`echo $srcdir/testsuites/omprog-transactions-bin.sh`
|
||||
template="outfmt"
|
||||
name="omprog_action"
|
||||
queue.type="Direct" # the default; facilitates sync with the child process
|
||||
queue.dequeueBatchSize="6"
|
||||
confirmMessages="on"
|
||||
useTransactions="on"
|
||||
beginTransactionMark="BEGIN TRANSACTION"
|
||||
commitTransactionMark="COMMIT TRANSACTION"
|
||||
action.resumeRetryCount="10"
|
||||
action.resumeInterval="1"
|
||||
)
|
||||
}
|
||||
'
|
||||
startup
|
||||
. $srcdir/diag.sh wait-startup
|
||||
. $srcdir/diag.sh injectmsg 0 10
|
||||
. $srcdir/diag.sh wait-queueempty
|
||||
|
||||
@ -17,7 +17,26 @@ if [ `uname` = "SunOS" ] ; then
|
||||
fi
|
||||
|
||||
. $srcdir/diag.sh init
|
||||
startup omruleset-queue.conf
|
||||
generate_conf
|
||||
add_conf '
|
||||
$ModLoad ../plugins/omruleset/.libs/omruleset
|
||||
$ModLoad ../plugins/imtcp/.libs/imtcp
|
||||
$InputTCPServerRun 13514
|
||||
|
||||
$ruleset rsinclude
|
||||
# create ruleset main queue with default parameters
|
||||
$RulesetCreateMainQueue on
|
||||
# make sure we do not terminate too early!
|
||||
$MainMsgQueueTimeoutShutdown 10000
|
||||
$template outfmt,"%msg:F,58:2%\n"
|
||||
$template dynfile,"rsyslog.out.log" # trick to use relative path names!
|
||||
:msg, contains, "msgnum:" ?dynfile;outfmt
|
||||
|
||||
$ruleset RSYSLOG_DefaultRuleset
|
||||
$ActionOmrulesetRulesetName rsinclude
|
||||
*.* :omruleset:
|
||||
'
|
||||
startup
|
||||
. $srcdir/diag.sh injectmsg 0 20000
|
||||
echo doing shutdown
|
||||
shutdown_when_empty
|
||||
|
||||
@ -13,7 +13,22 @@
|
||||
echo ===============================================================================
|
||||
echo \[omruleset.sh\]: basic test for omruleset functionality
|
||||
. $srcdir/diag.sh init
|
||||
startup omruleset.conf
|
||||
generate_conf
|
||||
add_conf '
|
||||
$ModLoad ../plugins/omruleset/.libs/omruleset
|
||||
$ModLoad ../plugins/imtcp/.libs/imtcp
|
||||
$InputTCPServerRun 13514
|
||||
|
||||
$ruleset rsinclude
|
||||
$template outfmt,"%msg:F,58:2%\n"
|
||||
$template dynfile,"rsyslog.out.log" # trick to use relative path names!
|
||||
:msg, contains, "msgnum:" ?dynfile;outfmt
|
||||
|
||||
$ruleset RSYSLOG_DefaultRuleset
|
||||
$ActionOmrulesetRulesetName rsinclude
|
||||
*.* :omruleset:
|
||||
'
|
||||
startup
|
||||
. $srcdir/diag.sh injectmsg 0 5000
|
||||
echo doing shutdown
|
||||
shutdown_when_empty
|
||||
|
||||
@ -5,7 +5,12 @@
|
||||
|
||||
psql -h localhost -U postgres -f testsuites/pgsql-basic.sql
|
||||
|
||||
startup_vg pgsql-basic.conf
|
||||
generate_conf
|
||||
add_conf '
|
||||
$ModLoad ../plugins/ompgsql/.libs/ompgsql
|
||||
:msg, contains, "msgnum:" :ompgsql:127.0.0.1,syslogtest,postgres,testbench
|
||||
'
|
||||
startup_vg
|
||||
. $srcdir/diag.sh injectmsg 0 5000
|
||||
shutdown_when_empty
|
||||
wait_shutdown_vg
|
||||
|
||||
@ -5,7 +5,12 @@
|
||||
|
||||
psql -h localhost -U postgres -f testsuites/pgsql-basic.sql
|
||||
|
||||
startup pgsql-basic.conf
|
||||
generate_conf
|
||||
add_conf '
|
||||
$ModLoad ../plugins/ompgsql/.libs/ompgsql
|
||||
:msg, contains, "msgnum:" :ompgsql:127.0.0.1,syslogtest,postgres,testbench
|
||||
'
|
||||
startup
|
||||
. $srcdir/diag.sh injectmsg 0 5000
|
||||
shutdown_when_empty
|
||||
wait_shutdown
|
||||
|
||||
@ -5,7 +5,15 @@
|
||||
|
||||
psql -h localhost -U postgres -f testsuites/pgsql-basic.sql
|
||||
|
||||
startup_vg pgsql-template.conf
|
||||
generate_conf
|
||||
add_conf '
|
||||
# putting the message in the SyslogTag field, so we know the template is actually used
|
||||
$template mytemplate,"insert into SystemEvents (SysLogTag) values ('%msg%')",STDSQL
|
||||
|
||||
$ModLoad ../plugins/ompgsql/.libs/ompgsql
|
||||
:msg, contains, "msgnum:" :ompgsql:127.0.0.1,syslogtest,postgres,testbench;mytemplate
|
||||
'
|
||||
startup_vg
|
||||
. $srcdir/diag.sh injectmsg 0 5000
|
||||
shutdown_when_empty
|
||||
wait_shutdown_vg
|
||||
|
||||
@ -5,7 +5,15 @@
|
||||
|
||||
psql -h localhost -U postgres -f testsuites/pgsql-basic.sql
|
||||
|
||||
startup pgsql-template.conf
|
||||
generate_conf
|
||||
add_conf '
|
||||
# putting the message in the SyslogTag field, so we know the template is actually used
|
||||
$template mytemplate,"insert into SystemEvents (SysLogTag) values ('%msg%')",STDSQL
|
||||
|
||||
$ModLoad ../plugins/ompgsql/.libs/ompgsql
|
||||
:msg, contains, "msgnum:" :ompgsql:127.0.0.1,syslogtest,postgres,testbench;mytemplate
|
||||
'
|
||||
startup
|
||||
. $srcdir/diag.sh injectmsg 0 5000
|
||||
shutdown_when_empty
|
||||
wait_shutdown
|
||||
|
||||
@ -19,8 +19,17 @@ echo TEST: \[pipe_noreader.sh\]: test for pipe writing without reader
|
||||
#export RSYSLOG_DEBUG="debug nostdout noprintmutexaction"
|
||||
#export RSYSLOG_DEBUGLOG="log"
|
||||
. $srcdir/diag.sh init
|
||||
generate_conf
|
||||
add_conf '
|
||||
$ModLoad ../plugins/imtcp/.libs/imtcp
|
||||
$MainMsgQueueTimeoutShutdown 10000
|
||||
$InputTCPServerRun 13514
|
||||
|
||||
$template outfmt,"%msg:F,58:2%\n"
|
||||
:msg, contains, "msgnum:" |./rsyslog.pipe
|
||||
'
|
||||
mkfifo ./rsyslog.pipe
|
||||
startup pipe_noreader.conf
|
||||
startup
|
||||
# we need to emit ~ 128K of data according to bug report
|
||||
. $srcdir/diag.sh tcpflood -m1000 -d500
|
||||
shutdown_when_empty # shut down rsyslogd when done processing messages
|
||||
|
||||
@ -16,6 +16,21 @@ fi
|
||||
# create the pipe and start a background process that copies data from
|
||||
# it to the "regular" work file
|
||||
. $srcdir/diag.sh init
|
||||
generate_conf
|
||||
add_conf '
|
||||
$MainMsgQueueTimeoutShutdown 10000
|
||||
|
||||
# set spool locations and switch queue to disk-only mode
|
||||
$WorkDirectory test-spool
|
||||
$MainMsgQueueFilename mainq
|
||||
$MainMsgQueueType disk
|
||||
|
||||
$template outfmt,"%msg:F,58:2%\n"
|
||||
# with pipes, we do not need to use absolute path names, so
|
||||
# we can simply refer to our working pipe via the usual relative
|
||||
# path name
|
||||
:msg, contains, "msgnum:" |rsyslog-testbench-fifo;outfmt
|
||||
'
|
||||
rm -f rsyslog-testbench-fifo
|
||||
mkfifo rsyslog-testbench-fifo
|
||||
cp rsyslog-testbench-fifo rsyslog.out.log &
|
||||
@ -23,7 +38,7 @@ CPPROCESS=$!
|
||||
echo background cp process id is $CPPROCESS
|
||||
|
||||
# now do the usual run
|
||||
startup pipeaction.conf
|
||||
startup
|
||||
# 20000 messages should be enough
|
||||
#. $srcdir/diag.sh tcpflood -m20000
|
||||
. $srcdir/diag.sh injectmsg 0 20000
|
||||
|
||||
@ -5,7 +5,27 @@
|
||||
echo ===============================================================================
|
||||
echo \[prop-all-json-concurrency.sh\]: testing concurrency of $!all-json variables
|
||||
. $srcdir/diag.sh init
|
||||
startup prop-all-json-concurrency.conf
|
||||
generate_conf
|
||||
add_conf '
|
||||
module(load="../plugins/imtcp/.libs/imtcp")
|
||||
input(type="imtcp" port="13514")
|
||||
|
||||
template(name="interim" type="string" string="%$!tree!here!nbr%")
|
||||
template(name="outfmt" type="string" string="%$.interim%\n")
|
||||
template(name="all-json" type="string" string="%$!%\n")
|
||||
|
||||
if $msg contains "msgnum:" then {
|
||||
set $!tree!here!nbr = field($msg, 58, 2);
|
||||
action(type="omfile" file="rsyslog2.out.log" template="all-json"
|
||||
queue.type="linkedList")
|
||||
|
||||
set $.interim = $!all-json;
|
||||
unset $!tree!here!nbr;
|
||||
action(type="omfile" file="rsyslog.out.log" template="outfmt"
|
||||
queue.type="fixedArray")
|
||||
}
|
||||
'
|
||||
startup
|
||||
sleep 1
|
||||
. $srcdir/diag.sh tcpflood -m500000
|
||||
shutdown_when_empty # shut down rsyslogd when done processing messages
|
||||
|
||||
@ -8,13 +8,32 @@
|
||||
# uncomment for debugging support:
|
||||
echo testing memory queue persisting to disk, mode $1
|
||||
. $srcdir/diag.sh init
|
||||
generate_conf
|
||||
add_conf '
|
||||
$ModLoad ../plugins/imtcp/.libs/imtcp
|
||||
$MainMsgQueueTimeoutShutdown 1
|
||||
$MainMsgQueueSaveOnShutdown on
|
||||
$InputTCPServerRun 13514
|
||||
|
||||
$ModLoad ../plugins/omtesting/.libs/omtesting
|
||||
|
||||
# set spool locations and switch queue to disk-only mode
|
||||
$WorkDirectory test-spool
|
||||
$MainMsgQueueFilename mainq
|
||||
$IncludeConfig work-queuemode.conf
|
||||
|
||||
$template outfmt,"%msg:F,58:2%\n"
|
||||
$template dynfile,"rsyslog.out.log" # trick to use relative path names!
|
||||
:msg, contains, "msgnum:" ?dynfile;outfmt
|
||||
|
||||
$IncludeConfig work-delay.conf
|
||||
'
|
||||
# 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
|
||||
startup queue-persist.conf
|
||||
startup
|
||||
. $srcdir/diag.sh injectmsg 0 5000
|
||||
. $srcdir/diag.sh shutdown-immediate
|
||||
wait_shutdown
|
||||
@ -23,7 +42,7 @@ wait_shutdown
|
||||
# restart engine and have rest processed
|
||||
#remove delay
|
||||
echo "#" > work-delay.conf
|
||||
startup queue-persist.conf
|
||||
startup
|
||||
shutdown_when_empty # shut down rsyslogd when done processing messages
|
||||
./msleep 1000
|
||||
$srcdir/diag.sh wait-shutdown
|
||||
|
||||
@ -6,7 +6,22 @@
|
||||
echo ===============================================================================
|
||||
echo TEST: \[random.sh\]: testing random data
|
||||
. $srcdir/diag.sh init
|
||||
startup random.conf
|
||||
generate_conf
|
||||
add_conf '
|
||||
# The random data will generate TCP framing error messages. We will
|
||||
# not clutter the test output with them. So we disable error messages
|
||||
# to stderr.
|
||||
$ErrorMessagesToStderr off
|
||||
|
||||
$ModLoad ../plugins/imtcp/.libs/imtcp
|
||||
$MainMsgQueueTimeoutShutdown 10000
|
||||
$InputTCPServerRun 13514
|
||||
|
||||
$template outfmt,"%rawmsg%\n"
|
||||
$template dynfile,"rsyslog.out.log" # trick to use relative path names!
|
||||
*.* /dev/null
|
||||
'
|
||||
startup
|
||||
# generate random data
|
||||
./randomgen -f rsyslog.random.data -s 100000
|
||||
ls -l rsyslog.random.data
|
||||
|
||||
@ -1,7 +1,16 @@
|
||||
#!/bin/bash
|
||||
# This file is part of the rsyslog project, released under ASL 2.0
|
||||
. $srcdir/diag.sh init
|
||||
startup rawmsg-after-pri.conf
|
||||
generate_conf
|
||||
add_conf '
|
||||
module(load="../plugins/imtcp/.libs/imtcp")
|
||||
input(type="imtcp" port="13514")
|
||||
|
||||
template(type="string" name="outfmt" string="%rawmsg-after-pri%\n")
|
||||
if $syslogfacility-text == "local0" then
|
||||
action(type="omfile" file="rsyslog.out.log" template="outfmt")
|
||||
'
|
||||
startup
|
||||
. $srcdir/diag.sh tcpflood -m1 -P 129
|
||||
shutdown_when_empty # shut down rsyslogd when done processing messages
|
||||
wait_shutdown # and wait for it to terminate
|
||||
|
||||
@ -4,7 +4,18 @@
|
||||
echo ===============================================================================
|
||||
echo \[rfc5424parser.sh\]: testing mmpstrucdata
|
||||
. $srcdir/diag.sh init
|
||||
startup rfc5424parser.conf
|
||||
generate_conf
|
||||
add_conf '
|
||||
module(load="../plugins/imtcp/.libs/imtcp")
|
||||
|
||||
template(name="outfmt" type="string" string="%msg:F,58:2%\n")
|
||||
|
||||
input(type="imtcp" port="13514")
|
||||
|
||||
if $msg contains "msgnum" then
|
||||
action(type="omfile" template="outfmt" file="rsyslog.out.log")
|
||||
'
|
||||
startup
|
||||
sleep 1
|
||||
. $srcdir/diag.sh tcpflood -m100 -y
|
||||
shutdown_when_empty # shut down rsyslogd when done processing messages
|
||||
|
||||
@ -8,7 +8,17 @@
|
||||
echo ===============================================================================
|
||||
echo \[rs_optimizer_pri.sh\]: testing RainerScript PRI optimizer
|
||||
. $srcdir/diag.sh init
|
||||
startup rs_optimizer_pri.conf
|
||||
generate_conf
|
||||
add_conf '
|
||||
template(name="outfmt" type="string" string="%msg:F,58:2%\n")
|
||||
|
||||
module(load="../plugins/imtcp/.libs/imtcp")
|
||||
input(type="imtcp" port="13514")
|
||||
|
||||
if $syslogfacility-text == "local4" then
|
||||
action(type="omfile" template="outfmt" file="rsyslog.out.log")
|
||||
'
|
||||
startup
|
||||
sleep 1
|
||||
. $srcdir/diag.sh tcpflood -m100 # correct facility
|
||||
. $srcdir/diag.sh tcpflood -m100 -P175 # incorrect facility --> must be ignored
|
||||
|
||||
@ -4,7 +4,12 @@
|
||||
echo ===============================================================================
|
||||
echo \[rscript_contains.sh\]: test for contains script-filter
|
||||
. $srcdir/diag.sh init
|
||||
startup rscript_contains.conf
|
||||
generate_conf
|
||||
add_conf '
|
||||
$template outfmt,"%msg:F,58:2%\n"
|
||||
if $msg contains 'msgnum' then ./rsyslog.out.log;outfmt
|
||||
'
|
||||
startup
|
||||
. $srcdir/diag.sh injectmsg 0 5000
|
||||
echo doing shutdown
|
||||
shutdown_when_empty
|
||||
|
||||
@ -4,7 +4,22 @@
|
||||
echo ===============================================================================
|
||||
echo \[rscript_eq.sh\]: testing rainerscript EQ statement
|
||||
. $srcdir/diag.sh init
|
||||
startup rscript_eq.conf
|
||||
generate_conf
|
||||
add_conf '
|
||||
template(name="outfmt" type="list") {
|
||||
property(name="$!usr!msgnum")
|
||||
constant(value="\n")
|
||||
}
|
||||
|
||||
if $msg contains 'msgnum' then {
|
||||
set $!usr!msgnum = field($msg, 58, 2);
|
||||
if $!usr!msgnum == "00005000" or
|
||||
$!usr!msgnum == "00005001" or
|
||||
$!usr!msgnum == "00005002" then
|
||||
action(type="omfile" file="./rsyslog.out.log" template="outfmt")
|
||||
}
|
||||
'
|
||||
startup
|
||||
. $srcdir/diag.sh injectmsg 0 8000
|
||||
echo doing shutdown
|
||||
shutdown_when_empty
|
||||
|
||||
@ -4,7 +4,65 @@
|
||||
echo ===============================================================================
|
||||
echo \[rscript_eq.sh\]: testing rainerscript EQ statement comparing two variables
|
||||
. $srcdir/diag.sh init
|
||||
startup rscript_eq_var.conf
|
||||
generate_conf
|
||||
add_conf '
|
||||
template(name="outfmt" type="list") {
|
||||
property(name="$!usr!msgnum")
|
||||
constant(value="\n")
|
||||
}
|
||||
|
||||
set $!var1 = "value";
|
||||
set $!var2 = "value";
|
||||
if $!var1 == $!var2 then {
|
||||
set $!var2 = "bad";
|
||||
if $!var1 == $!var2 then {
|
||||
# Failure
|
||||
stop
|
||||
} else {
|
||||
unset $!var1;
|
||||
unset $!var2;
|
||||
}
|
||||
} else {
|
||||
# Failure
|
||||
stop
|
||||
}
|
||||
set $.var1 = "value";
|
||||
set $.var2 = "value";
|
||||
if $.var1 == $.var2 then {
|
||||
set $.var2 = "bad";
|
||||
if $.var1 == $.var2 then {
|
||||
# Failure
|
||||
stop
|
||||
} else {
|
||||
unset $.var1;
|
||||
unset $.var2;
|
||||
}
|
||||
} else {
|
||||
# Failure
|
||||
stop
|
||||
}
|
||||
set $/var1 = "value";
|
||||
set $/var2 = "value";
|
||||
if $/var1 == $/var2 then {
|
||||
set $/var2 = "bad";
|
||||
if $/var1 == $/var2 then {
|
||||
# Failure
|
||||
stop
|
||||
} else {
|
||||
unset $/var1;
|
||||
unset $/var2;
|
||||
}
|
||||
} else {
|
||||
# Failure
|
||||
stop
|
||||
}
|
||||
|
||||
if $msg contains 'msgnum' then {
|
||||
set $!usr!msgnum = field($msg, 58, 2);
|
||||
action(type="omfile" file="./rsyslog.out.log" template="outfmt")
|
||||
}
|
||||
'
|
||||
startup
|
||||
. $srcdir/diag.sh injectmsg 0 1
|
||||
echo doing shutdown
|
||||
shutdown_when_empty
|
||||
|
||||
@ -11,7 +11,19 @@ fi
|
||||
echo ===============================================================================
|
||||
echo \[rscript_field-vg.sh\]: testing rainerscript field\(\) function
|
||||
. $srcdir/diag.sh init
|
||||
startup_vg rscript_field.conf
|
||||
generate_conf
|
||||
add_conf '
|
||||
template(name="outfmt" type="list") {
|
||||
property(name="$!usr!msgnum")
|
||||
constant(value="\n")
|
||||
}
|
||||
|
||||
if $msg contains 'msgnum' then {
|
||||
set $!usr!msgnum = field($msg, 58, 2);
|
||||
action(type="omfile" file="./rsyslog.out.log" template="outfmt")
|
||||
}
|
||||
'
|
||||
startup_vg
|
||||
. $srcdir/diag.sh injectmsg 0 5000
|
||||
echo doing shutdown
|
||||
shutdown_when_empty
|
||||
|
||||
@ -4,7 +4,19 @@
|
||||
echo ===============================================================================
|
||||
echo \[rscript_field.sh\]: testing rainerscript field\(\) function
|
||||
. $srcdir/diag.sh init
|
||||
startup rscript_field.conf
|
||||
generate_conf
|
||||
add_conf '
|
||||
template(name="outfmt" type="list") {
|
||||
property(name="$!usr!msgnum")
|
||||
constant(value="\n")
|
||||
}
|
||||
|
||||
if $msg contains 'msgnum' then {
|
||||
set $!usr!msgnum = field($msg, 58, 2);
|
||||
action(type="omfile" file="./rsyslog.out.log" template="outfmt")
|
||||
}
|
||||
'
|
||||
startup
|
||||
. $srcdir/diag.sh injectmsg 0 5000
|
||||
echo doing shutdown
|
||||
shutdown_when_empty
|
||||
|
||||
@ -4,7 +4,21 @@
|
||||
echo ===============================================================================
|
||||
echo \[rscript_ge.sh\]: testing rainerscript GE statement
|
||||
. $srcdir/diag.sh init
|
||||
startup rscript_ge.conf
|
||||
generate_conf
|
||||
add_conf '
|
||||
template(name="outfmt" type="list") {
|
||||
property(name="$!usr!msgnum")
|
||||
constant(value="\n")
|
||||
}
|
||||
|
||||
if $msg contains 'msgnum' then {
|
||||
set $!usr!msgnum = field($msg, 58, 2);
|
||||
if $!usr!msgnum >= "00005000" then
|
||||
stop
|
||||
action(type="omfile" file="./rsyslog.out.log" template="outfmt")
|
||||
}
|
||||
'
|
||||
startup
|
||||
. $srcdir/diag.sh injectmsg 0 8000
|
||||
echo doing shutdown
|
||||
shutdown_when_empty
|
||||
|
||||
@ -4,7 +4,68 @@
|
||||
echo ===============================================================================
|
||||
echo \[rscript_ge.sh\]: testing rainerscript GE statement for two JSON variables
|
||||
. $srcdir/diag.sh init
|
||||
startup rscript_ge_var.conf
|
||||
generate_conf
|
||||
add_conf '
|
||||
template(name="outfmt" type="list") {
|
||||
property(name="$!usr!msgnum")
|
||||
constant(value="\n")
|
||||
}
|
||||
|
||||
set $!var1 = "42";
|
||||
set $!var2 = "42";
|
||||
set $!var3 = "41";
|
||||
if $!var1 >= $!var2 and $!var1 >= $!var3 then {
|
||||
if $!var3 >= $!var1 then {
|
||||
# Failure
|
||||
stop
|
||||
} else {
|
||||
unset $!var1;
|
||||
unset $!var2;
|
||||
unset $!var3;
|
||||
}
|
||||
} else {
|
||||
# Failure
|
||||
stop
|
||||
}
|
||||
set $.var1 = "42";
|
||||
set $.var2 = "42";
|
||||
set $.var3 = "41";
|
||||
if $.var1 >= $.var2 and $.var1 >= $.var3 then {
|
||||
if $.var3 >= $.var1 then {
|
||||
# Failure
|
||||
stop
|
||||
} else {
|
||||
unset $.var1;
|
||||
unset $.var2;
|
||||
unset $.var3;
|
||||
}
|
||||
} else {
|
||||
# Failure
|
||||
stop
|
||||
}
|
||||
set $/var1 = "42";
|
||||
set $/var2 = "42";
|
||||
set $/var3 = "41";
|
||||
if $/var1 >= $/var2 and $/var1 >= $/var3 then {
|
||||
if $/var3 >= $/var1 then {
|
||||
# Failure
|
||||
stop
|
||||
} else {
|
||||
unset $/var1;
|
||||
unset $/var2;
|
||||
unset $/var3;
|
||||
}
|
||||
} else {
|
||||
# Failure
|
||||
stop
|
||||
}
|
||||
|
||||
if $msg contains 'msgnum' then {
|
||||
set $!usr!msgnum = field($msg, 58, 2);
|
||||
action(type="omfile" file="./rsyslog.out.log" template="outfmt")
|
||||
}
|
||||
'
|
||||
startup
|
||||
. $srcdir/diag.sh injectmsg 0 1
|
||||
echo doing shutdown
|
||||
shutdown_when_empty
|
||||
|
||||
@ -4,7 +4,20 @@
|
||||
echo ===============================================================================
|
||||
echo \[rscript_gt.sh\]: testing rainerscript GT statement
|
||||
. $srcdir/diag.sh init
|
||||
startup rscript_gt.conf
|
||||
generate_conf
|
||||
add_conf '
|
||||
template(name="outfmt" type="list") {
|
||||
property(name="$!usr!msgnum")
|
||||
constant(value="\n")
|
||||
}
|
||||
|
||||
if $msg contains 'msgnum' then {
|
||||
set $!usr!msgnum = field($msg, 58, 2);
|
||||
if $!usr!msgnum > "00004999" then
|
||||
action(type="omfile" file="./rsyslog.out.log" template="outfmt")
|
||||
}
|
||||
'
|
||||
startup
|
||||
. $srcdir/diag.sh injectmsg 0 8000
|
||||
echo doing shutdown
|
||||
shutdown_when_empty
|
||||
|
||||
@ -4,7 +4,62 @@
|
||||
echo ===============================================================================
|
||||
echo \[rscript_gt.sh\]: testing rainerscript GT statement for two JSON variables
|
||||
. $srcdir/diag.sh init
|
||||
startup rscript_gt_var.conf
|
||||
generate_conf
|
||||
add_conf '
|
||||
template(name="outfmt" type="list") {
|
||||
property(name="$!usr!msgnum")
|
||||
constant(value="\n")
|
||||
}
|
||||
|
||||
set $!var1 = "43";
|
||||
set $!var2 = "42";
|
||||
if $!var1 > $!var2 then {
|
||||
if $!var2 > $!var1 then {
|
||||
# Failure
|
||||
stop
|
||||
} else {
|
||||
unset $!var1;
|
||||
unset $!var2;
|
||||
}
|
||||
} else {
|
||||
# Failure
|
||||
stop
|
||||
}
|
||||
set $.var1 = "43";
|
||||
set $.var2 = "42";
|
||||
if $.var1 > $.var2 then {
|
||||
if $.var2 > $.var1 then {
|
||||
# Failure
|
||||
stop
|
||||
} else {
|
||||
unset $.var1;
|
||||
unset $.var2;
|
||||
}
|
||||
} else {
|
||||
# Failure
|
||||
stop
|
||||
}
|
||||
set $/var1 = "43";
|
||||
set $/var2 = "42";
|
||||
if $/var1 > $/var2 then {
|
||||
if $/var2 > $/var1 then {
|
||||
# Failure
|
||||
stop
|
||||
} else {
|
||||
unset $/var1;
|
||||
unset $/var2;
|
||||
}
|
||||
} else {
|
||||
# Failure
|
||||
stop
|
||||
}
|
||||
|
||||
if $msg contains 'msgnum' then {
|
||||
set $!usr!msgnum = field($msg, 58, 2);
|
||||
action(type="omfile" file="./rsyslog.out.log" template="outfmt")
|
||||
}
|
||||
'
|
||||
startup
|
||||
. $srcdir/diag.sh injectmsg 0 1
|
||||
echo doing shutdown
|
||||
shutdown_when_empty
|
||||
|
||||
@ -4,7 +4,20 @@
|
||||
echo ===============================================================================
|
||||
echo \rscript_hash32.sh\]: test for hash32 and hash64mod script-function
|
||||
. $srcdir/diag.sh init
|
||||
startup_vg rscript_hash32.conf
|
||||
generate_conf
|
||||
add_conf '
|
||||
template(name="outfmt" type="string" string="%$.hash_no_1% - %$.hash_no_2%\n")
|
||||
|
||||
module(load="../plugins/imtcp/.libs/imtcp")
|
||||
module(load="../contrib/fmhash/.libs/fmhash")
|
||||
input(type="imtcp" port="13514")
|
||||
|
||||
set $.hash_no_1 = hash32("0f9a1d07-a8c9-43a7-a6f7-198dca3d932e");
|
||||
set $.hash_no_2 = hash32mod("0f9a1d07-a8c9-43a7-a6f7-198dca3d932e", 100);
|
||||
|
||||
action(type="omfile" file="./rsyslog.out.log" template="outfmt")
|
||||
'
|
||||
startup_vg
|
||||
. $srcdir/diag.sh tcpflood -m 20
|
||||
echo doing shutdown
|
||||
shutdown_when_empty
|
||||
|
||||
@ -4,7 +4,20 @@
|
||||
echo ===============================================================================
|
||||
echo \rscript_hash32.sh\]: test for hash32 and hash64mod script-function
|
||||
. $srcdir/diag.sh init
|
||||
startup rscript_hash32.conf
|
||||
generate_conf
|
||||
add_conf '
|
||||
template(name="outfmt" type="string" string="%$.hash_no_1% - %$.hash_no_2%\n")
|
||||
|
||||
module(load="../plugins/imtcp/.libs/imtcp")
|
||||
module(load="../contrib/fmhash/.libs/fmhash")
|
||||
input(type="imtcp" port="13514")
|
||||
|
||||
set $.hash_no_1 = hash32("0f9a1d07-a8c9-43a7-a6f7-198dca3d932e");
|
||||
set $.hash_no_2 = hash32mod("0f9a1d07-a8c9-43a7-a6f7-198dca3d932e", 100);
|
||||
|
||||
action(type="omfile" file="./rsyslog.out.log" template="outfmt")
|
||||
'
|
||||
startup
|
||||
. $srcdir/diag.sh tcpflood -m 20
|
||||
echo doing shutdown
|
||||
shutdown_when_empty
|
||||
|
||||
@ -4,7 +4,20 @@
|
||||
echo ===============================================================================
|
||||
echo \rscript_hash64.sh\]: test for hash64 and hash64mod script-function
|
||||
. $srcdir/diag.sh init
|
||||
startup_vg rscript_hash64.conf
|
||||
generate_conf
|
||||
add_conf '
|
||||
template(name="outfmt" type="string" string="%$.hash_no_1% - %$.hash_no_2%\n")
|
||||
|
||||
module(load="../plugins/imtcp/.libs/imtcp")
|
||||
module(load="../contrib/fmhash/.libs/fmhash")
|
||||
input(type="imtcp" port="13514")
|
||||
|
||||
set $.hash_no_1 = hash64("0f9a1d07-a8c9-43a7-a6f7-198dca3d932e");
|
||||
set $.hash_no_2 = hash64mod("0f9a1d07-a8c9-43a7-a6f7-198dca3d932e", 100);
|
||||
|
||||
action(type="omfile" file="./rsyslog.out.log" template="outfmt")
|
||||
'
|
||||
startup_vg
|
||||
. $srcdir/diag.sh tcpflood -m 20
|
||||
echo doing shutdown
|
||||
shutdown_when_empty
|
||||
|
||||
@ -4,7 +4,20 @@
|
||||
echo ===============================================================================
|
||||
echo \rscript_hash64.sh\]: test for hash64 and hash64mod script-function
|
||||
. $srcdir/diag.sh init
|
||||
startup rscript_hash64.conf
|
||||
generate_conf
|
||||
add_conf '
|
||||
template(name="outfmt" type="string" string="%$.hash_no_1% - %$.hash_no_2%\n")
|
||||
|
||||
module(load="../plugins/imtcp/.libs/imtcp")
|
||||
module(load="../contrib/fmhash/.libs/fmhash")
|
||||
input(type="imtcp" port="13514")
|
||||
|
||||
set $.hash_no_1 = hash64("0f9a1d07-a8c9-43a7-a6f7-198dca3d932e");
|
||||
set $.hash_no_2 = hash64mod("0f9a1d07-a8c9-43a7-a6f7-198dca3d932e", 100);
|
||||
|
||||
action(type="omfile" file="./rsyslog.out.log" template="outfmt")
|
||||
'
|
||||
startup
|
||||
. $srcdir/diag.sh tcpflood -m 20
|
||||
echo doing shutdown
|
||||
shutdown_when_empty
|
||||
|
||||
@ -4,7 +4,20 @@
|
||||
echo ===============================================================================
|
||||
echo \[rscript_le.sh\]: testing rainerscript LE statement
|
||||
. $srcdir/diag.sh init
|
||||
startup rscript_le.conf
|
||||
generate_conf
|
||||
add_conf '
|
||||
template(name="outfmt" type="list") {
|
||||
property(name="$!usr!msgnum")
|
||||
constant(value="\n")
|
||||
}
|
||||
|
||||
if $msg contains 'msgnum' then {
|
||||
set $!usr!msgnum = field($msg, 58, 2);
|
||||
if $!usr!msgnum <= "00005000" then
|
||||
action(type="omfile" file="./rsyslog.out.log" template="outfmt")
|
||||
}
|
||||
'
|
||||
startup
|
||||
. $srcdir/diag.sh injectmsg 0 8000
|
||||
echo doing shutdown
|
||||
shutdown_when_empty
|
||||
|
||||
@ -4,7 +4,68 @@
|
||||
echo ===============================================================================
|
||||
echo \[rscript_le.sh\]: testing rainerscript LE statement for two JSON variables
|
||||
. $srcdir/diag.sh init
|
||||
startup rscript_le_var.conf
|
||||
generate_conf
|
||||
add_conf '
|
||||
template(name="outfmt" type="list") {
|
||||
property(name="$!usr!msgnum")
|
||||
constant(value="\n")
|
||||
}
|
||||
|
||||
set $!var1 = "42";
|
||||
set $!var2 = "42";
|
||||
set $!var3 = "43";
|
||||
if $!var1 <= $!var2 and $!var1 <= $!var3 then {
|
||||
if $!var3 <= $!var1 then {
|
||||
# Failure
|
||||
stop
|
||||
} else {
|
||||
unset $!var1;
|
||||
unset $!var2;
|
||||
unset $!var3;
|
||||
}
|
||||
} else {
|
||||
# Failure
|
||||
stop
|
||||
}
|
||||
set $.var1 = "42";
|
||||
set $.var2 = "42";
|
||||
set $.var3 = "43";
|
||||
if $.var1 <= $.var2 and $.var1 <= $.var3 then {
|
||||
if $.var3 <= $.var1 then {
|
||||
# Failure
|
||||
stop
|
||||
} else {
|
||||
unset $.var1;
|
||||
unset $.var2;
|
||||
unset $.var3;
|
||||
}
|
||||
} else {
|
||||
# Failure
|
||||
stop
|
||||
}
|
||||
set $/var1 = "42";
|
||||
set $/var2 = "42";
|
||||
set $/var3 = "43";
|
||||
if $/var1 <= $/var2 and $/var1 <= $/var3 then {
|
||||
if $/var3 <= $/var1 then {
|
||||
# Failure
|
||||
stop
|
||||
} else {
|
||||
unset $/var1;
|
||||
unset $/var2;
|
||||
unset $/var3;
|
||||
}
|
||||
} else {
|
||||
# Failure
|
||||
stop
|
||||
}
|
||||
|
||||
if $msg contains 'msgnum' then {
|
||||
set $!usr!msgnum = field($msg, 58, 2);
|
||||
action(type="omfile" file="./rsyslog.out.log" template="outfmt")
|
||||
}
|
||||
'
|
||||
startup
|
||||
. $srcdir/diag.sh injectmsg 0 1
|
||||
echo doing shutdown
|
||||
shutdown_when_empty
|
||||
|
||||
@ -4,7 +4,20 @@
|
||||
echo ===============================================================================
|
||||
echo \[rscript_lt.sh\]: testing rainerscript LT statement
|
||||
. $srcdir/diag.sh init
|
||||
startup rscript_lt.conf
|
||||
generate_conf
|
||||
add_conf '
|
||||
template(name="outfmt" type="list") {
|
||||
property(name="$!usr!msgnum")
|
||||
constant(value="\n")
|
||||
}
|
||||
|
||||
if $msg contains 'msgnum' then {
|
||||
set $!usr!msgnum = field($msg, 58, 2);
|
||||
if $!usr!msgnum < "00005000" then
|
||||
action(type="omfile" file="./rsyslog.out.log" template="outfmt")
|
||||
}
|
||||
'
|
||||
startup
|
||||
. $srcdir/diag.sh injectmsg 0 8000
|
||||
echo doing shutdown
|
||||
shutdown_when_empty
|
||||
|
||||
@ -4,7 +4,62 @@
|
||||
echo ===============================================================================
|
||||
echo \[rscript_lt.sh\]: testing rainerscript LT statement for two JSON variables
|
||||
. $srcdir/diag.sh init
|
||||
startup rscript_lt_var.conf
|
||||
generate_conf
|
||||
add_conf '
|
||||
template(name="outfmt" type="list") {
|
||||
property(name="$!usr!msgnum")
|
||||
constant(value="\n")
|
||||
}
|
||||
|
||||
set $!var1 = "41";
|
||||
set $!var2 = "42";
|
||||
if $!var1 < $!var2 then {
|
||||
if $!var2 < $!var1 then {
|
||||
# Failure
|
||||
stop
|
||||
} else {
|
||||
unset $!var1;
|
||||
unset $!var2;
|
||||
}
|
||||
} else {
|
||||
# Failure
|
||||
stop
|
||||
}
|
||||
set $.var1 = "41";
|
||||
set $.var2 = "42";
|
||||
if $.var1 < $.var2 then {
|
||||
if $.var2 < $.var1 then {
|
||||
# Failure
|
||||
stop
|
||||
} else {
|
||||
unset $.var1;
|
||||
unset $.var2;
|
||||
}
|
||||
} else {
|
||||
# Failure
|
||||
stop
|
||||
}
|
||||
set $/var1 = "41";
|
||||
set $/var2 = "42";
|
||||
if $/var1 < $/var2 then {
|
||||
if $/var2 < $/var1 then {
|
||||
# Failure
|
||||
stop
|
||||
} else {
|
||||
unset $/var1;
|
||||
unset $/var2;
|
||||
}
|
||||
} else {
|
||||
# Failure
|
||||
stop
|
||||
}
|
||||
|
||||
if $msg contains 'msgnum' then {
|
||||
set $!usr!msgnum = field($msg, 58, 2);
|
||||
action(type="omfile" file="./rsyslog.out.log" template="outfmt")
|
||||
}
|
||||
'
|
||||
startup
|
||||
. $srcdir/diag.sh injectmsg 0 1
|
||||
echo doing shutdown
|
||||
shutdown_when_empty
|
||||
|
||||
@ -4,7 +4,26 @@
|
||||
echo ===============================================================================
|
||||
echo \[rscript_ne.sh\]: testing rainerscript NE statement
|
||||
. $srcdir/diag.sh init
|
||||
startup rscript_ne.conf
|
||||
generate_conf
|
||||
add_conf '
|
||||
template(name="outfmt" type="list") {
|
||||
property(name="$!usr!msgnum")
|
||||
constant(value="\n")
|
||||
}
|
||||
|
||||
if $msg contains 'msgnum' then {
|
||||
set $!usr!msgnum = field($msg, 58, 2);
|
||||
if $!usr!msgnum != "00005000" and
|
||||
$!usr!msgnum != "00005001" and
|
||||
$!usr!msgnum != "00005002" then
|
||||
set $!usr!write = 0;
|
||||
else
|
||||
set $!usr!write = 1;
|
||||
if $!usr!write == 1 then
|
||||
action(type="omfile" file="./rsyslog.out.log" template="outfmt")
|
||||
}
|
||||
'
|
||||
startup
|
||||
. $srcdir/diag.sh injectmsg 0 8000
|
||||
echo doing shutdown
|
||||
shutdown_when_empty
|
||||
|
||||
@ -4,7 +4,68 @@
|
||||
echo ===============================================================================
|
||||
echo \[rscript_ne.sh\]: testing rainerscript NE statement for two JSON variables
|
||||
. $srcdir/diag.sh init
|
||||
startup rscript_ne_var.conf
|
||||
generate_conf
|
||||
add_conf '
|
||||
template(name="outfmt" type="list") {
|
||||
property(name="$!usr!msgnum")
|
||||
constant(value="\n")
|
||||
}
|
||||
|
||||
set $!var1 = "value1";
|
||||
set $!var2 = "value2";
|
||||
if $!var1 != $!var2 then {
|
||||
set $!var1 = "value";
|
||||
set $!var2 = "value";
|
||||
if $!var1 != $!var2 then {
|
||||
# Failure
|
||||
stop
|
||||
} else {
|
||||
unset $!var1;
|
||||
unset $!var2;
|
||||
}
|
||||
} else {
|
||||
# Failure
|
||||
stop
|
||||
}
|
||||
set $.var1 = "value1";
|
||||
set $.var2 = "value2";
|
||||
if $.var1 != $.var2 then {
|
||||
set $.var1 = "value";
|
||||
set $.var2 = "value";
|
||||
if $.var1 != $.var2 then {
|
||||
# Failure
|
||||
stop
|
||||
} else {
|
||||
unset $.var1;
|
||||
unset $.var2;
|
||||
}
|
||||
} else {
|
||||
# Failure
|
||||
stop
|
||||
}
|
||||
set $/var1 = "value1";
|
||||
set $/var2 = "value2";
|
||||
if $/var1 != $/var2 then {
|
||||
set $/var1 = "value";
|
||||
set $/var2 = "value";
|
||||
if $/var1 != $/var2 then {
|
||||
# Failure
|
||||
stop
|
||||
} else {
|
||||
unset $/var1;
|
||||
unset $/var2;
|
||||
}
|
||||
} else {
|
||||
# Failure
|
||||
stop
|
||||
}
|
||||
|
||||
if $msg contains 'msgnum' then {
|
||||
set $!usr!msgnum = field($msg, 58, 2);
|
||||
action(type="omfile" file="./rsyslog.out.log" template="outfmt")
|
||||
}
|
||||
'
|
||||
startup
|
||||
. $srcdir/diag.sh injectmsg 0 1
|
||||
echo doing shutdown
|
||||
shutdown_when_empty
|
||||
|
||||
@ -4,7 +4,20 @@
|
||||
echo ===============================================================================
|
||||
echo \[rscript_optimizer1.sh\]: testing rainerscript optimizer
|
||||
. $srcdir/diag.sh init
|
||||
startup rscript_optimizer1.conf
|
||||
generate_conf
|
||||
add_conf '
|
||||
template(name="outfmt" type="list") {
|
||||
property(name="msg" field.delimiter="58" field.number="2")
|
||||
constant(value="\n")
|
||||
}
|
||||
|
||||
/* tcpflood uses local4.=debug */
|
||||
if prifilt("syslog.*") then
|
||||
stop # it actually doesn't matter what we do here
|
||||
else
|
||||
action(type="omfile" file="./rsyslog.out.log" template="outfmt")
|
||||
'
|
||||
startup
|
||||
. $srcdir/diag.sh injectmsg 0 5000
|
||||
echo doing shutdown
|
||||
shutdown_when_empty
|
||||
|
||||
@ -4,7 +4,18 @@
|
||||
echo ===============================================================================
|
||||
echo \[rscript_prifilt.sh\]: testing rainerscript prifield\(\) function
|
||||
. $srcdir/diag.sh init
|
||||
startup rscript_prifilt.conf
|
||||
generate_conf
|
||||
add_conf '
|
||||
template(name="outfmt" type="list") {
|
||||
property(name="msg" field.delimiter="58" field.number="2")
|
||||
constant(value="\n")
|
||||
}
|
||||
|
||||
/* tcpflood uses local4.=debug, we use a bit more generic filter */
|
||||
if prifilt("local4.*") then
|
||||
action(type="omfile" file="./rsyslog.out.log" template="outfmt")
|
||||
'
|
||||
startup
|
||||
. $srcdir/diag.sh injectmsg 0 5000
|
||||
echo doing shutdown
|
||||
shutdown_when_empty
|
||||
|
||||
@ -4,7 +4,18 @@
|
||||
echo ===============================================================================
|
||||
echo \[rscript_random.sh\]: test for random-number-generator script-function
|
||||
. $srcdir/diag.sh init
|
||||
startup rscript_random.conf
|
||||
generate_conf
|
||||
add_conf '
|
||||
template(name="outfmt" type="string" string="%$.random_no%\n")
|
||||
|
||||
module(load="../plugins/imtcp/.libs/imtcp")
|
||||
input(type="imtcp" port="13514")
|
||||
|
||||
set $.random_no = random(10);
|
||||
|
||||
action(type="omfile" file="./rsyslog.out.log" template="outfmt")
|
||||
'
|
||||
startup
|
||||
. $srcdir/diag.sh tcpflood -m 20
|
||||
echo doing shutdown
|
||||
shutdown_when_empty
|
||||
|
||||
@ -4,7 +4,18 @@
|
||||
echo ===============================================================================
|
||||
echo \[rscript_re_extract.sh\]: test re_extract rscript-fn
|
||||
. $srcdir/diag.sh init
|
||||
startup rscript_re_extract.conf
|
||||
generate_conf
|
||||
add_conf '
|
||||
template(name="outfmt" type="string" string="*Number is %$.number%*\n")
|
||||
|
||||
module(load="../plugins/imtcp/.libs/imtcp")
|
||||
input(type="imtcp" port="13514")
|
||||
|
||||
set $.number = re_extract($msg, '.* ([0-9]+)$', 0, 1, 'none');
|
||||
|
||||
action(type="omfile" file="./rsyslog.out.log" template="outfmt")
|
||||
'
|
||||
startup
|
||||
. $srcdir/diag.sh tcpflood -m 1 -I $srcdir/testsuites/date_time_msg
|
||||
echo doing shutdown
|
||||
shutdown_when_empty
|
||||
|
||||
@ -4,7 +4,18 @@
|
||||
echo ===============================================================================
|
||||
echo \[rscript_re_match.sh\]: test re_match rscript-fn
|
||||
. $srcdir/diag.sh init
|
||||
startup rscript_re_match.conf
|
||||
generate_conf
|
||||
add_conf '
|
||||
template(name="outfmt" type="string" string="*Matched*\n")
|
||||
|
||||
module(load="../plugins/imtcp/.libs/imtcp")
|
||||
input(type="imtcp" port="13514")
|
||||
|
||||
if (re_match($msg, '.* ([0-9]+)$')) then {
|
||||
action(type="omfile" file="./rsyslog.out.log" template="outfmt")
|
||||
}
|
||||
'
|
||||
startup
|
||||
. $srcdir/diag.sh tcpflood -m 1 -I $srcdir/testsuites/date_time_msg
|
||||
echo doing shutdown
|
||||
shutdown_when_empty
|
||||
|
||||
@ -4,7 +4,22 @@
|
||||
echo ===============================================================================
|
||||
echo \[rscript_replace.sh\]: test for replace script-function
|
||||
. $srcdir/diag.sh init
|
||||
startup rscript_replace.conf
|
||||
generate_conf
|
||||
add_conf '
|
||||
template(name="outfmt" type="string" string="%$.replaced_msg%\n")
|
||||
|
||||
module(load="../plugins/imptcp/.libs/imptcp")
|
||||
input(type="imptcp" port="13514")
|
||||
|
||||
template(name="date_time" type="list") {
|
||||
property(name="msg" regex.Expression="Thu .+ 2014" regex.Type="ERE" regex.Match="0")
|
||||
}
|
||||
|
||||
set $.replaced_msg = replace("date time: " & exec_template("date_time"), "O" & "ct", replace("october", "o", "0"));
|
||||
|
||||
action(type="omfile" file="./rsyslog.out.log" template="outfmt")
|
||||
'
|
||||
startup
|
||||
. $srcdir/diag.sh tcpflood -m 1 -I $srcdir/testsuites/date_time_msg
|
||||
echo doing shutdown
|
||||
shutdown_when_empty
|
||||
|
||||
@ -4,7 +4,21 @@
|
||||
echo ===============================================================================
|
||||
echo \[rscript_replace_complex.sh\]: a more complex test for replace script-function
|
||||
. $srcdir/diag.sh init
|
||||
startup rscript_replace_complex.conf
|
||||
generate_conf
|
||||
add_conf '
|
||||
template(name="outfmt" type="string" string="%$.replaced_msg%\n")
|
||||
|
||||
module(load="../plugins/imtcp/.libs/imtcp")
|
||||
input(type="imtcp" port="13514")
|
||||
|
||||
set $.replaced_msg = replace($msg, "syslog", "rsyslog");
|
||||
set $.replaced_msg = replace($.replaced_msg, "hello", "hello_world");
|
||||
set $.replaced_msg = replace($.replaced_msg, "foo_bar_baz", "FBB");
|
||||
set $.replaced_msg = replace($.replaced_msg, "as_longer_this_string_as_more_probability_to_catch_the_bug", "ss");
|
||||
|
||||
action(type="omfile" file="./rsyslog.out.log" template="outfmt")
|
||||
'
|
||||
startup
|
||||
. $srcdir/diag.sh tcpflood -m 1 -I $srcdir/testsuites/complex_replace_input
|
||||
echo doing shutdown
|
||||
shutdown_when_empty
|
||||
|
||||
@ -4,7 +4,30 @@
|
||||
echo ===============================================================================
|
||||
echo \[rscript_ruleset_call.sh\]: testing rainerscript ruleset\(\) and call statement
|
||||
. $srcdir/diag.sh init
|
||||
startup rscript_ruleset_call.conf
|
||||
generate_conf
|
||||
add_conf '
|
||||
template(name="outfmt" type="list") {
|
||||
property(name="msg" field.delimiter="58" field.number="2")
|
||||
constant(value="\n")
|
||||
}
|
||||
|
||||
|
||||
# we deliberately include continue/stop to make sure we have more than
|
||||
# one statement. This catches grammar erorrs
|
||||
ruleset(name="rs2") {
|
||||
continue
|
||||
action(type="omfile" file="./rsyslog.out.log" template="outfmt")
|
||||
stop
|
||||
}
|
||||
|
||||
# this time we make sure a single statement is properly supported
|
||||
ruleset(name="rs1") {
|
||||
call rs2
|
||||
}
|
||||
|
||||
if $msg contains 'msgnum' then call rs1
|
||||
'
|
||||
startup
|
||||
. $srcdir/diag.sh injectmsg 0 5000
|
||||
echo doing shutdown
|
||||
shutdown_when_empty
|
||||
|
||||
@ -5,7 +5,20 @@
|
||||
echo ===============================================================================
|
||||
echo \[rscript_set_modify.sh\]: testing set twice
|
||||
. $srcdir/diag.sh init
|
||||
startup rscript_set_modify.conf
|
||||
generate_conf
|
||||
add_conf '
|
||||
template(name="outfmt" type="list") {
|
||||
property(name="$!usr!msgnum")
|
||||
constant(value="\n")
|
||||
}
|
||||
|
||||
if $msg contains 'msgnum' then {
|
||||
set $!usr!msgnum = field($msg, 58, 1);
|
||||
set $!usr!msgnum = field($msg, 58, 2);
|
||||
action(type="omfile" file="./rsyslog.out.log" template="outfmt")
|
||||
}
|
||||
'
|
||||
startup
|
||||
. $srcdir/diag.sh injectmsg 0 100
|
||||
shutdown_when_empty
|
||||
wait_shutdown
|
||||
|
||||
@ -4,7 +4,21 @@
|
||||
echo ===============================================================================
|
||||
echo \[rscript_stop.sh\]: testing rainerscript STOP statement
|
||||
. $srcdir/diag.sh init
|
||||
startup rscript_stop.conf
|
||||
generate_conf
|
||||
add_conf '
|
||||
template(name="outfmt" type="list") {
|
||||
property(name="$!usr!msgnum")
|
||||
constant(value="\n")
|
||||
}
|
||||
|
||||
if $msg contains 'msgnum' then {
|
||||
set $!usr!msgnum = field($msg, 58, 2);
|
||||
if cnum($!usr!msgnum) >= 5000 then
|
||||
stop
|
||||
action(type="omfile" file="./rsyslog.out.log" template="outfmt")
|
||||
}
|
||||
'
|
||||
startup
|
||||
. $srcdir/diag.sh injectmsg 0 8000
|
||||
echo doing shutdown
|
||||
shutdown_when_empty
|
||||
|
||||
@ -4,7 +4,26 @@
|
||||
echo ===============================================================================
|
||||
echo \[rscript_stop2.sh\]: testing rainerscript STOP statement, alternate method
|
||||
. $srcdir/diag.sh init
|
||||
startup rscript_stop2.conf
|
||||
generate_conf
|
||||
add_conf '
|
||||
template(name="outfmt" type="list") {
|
||||
property(name="$!usr!msgnum")
|
||||
constant(value="\n")
|
||||
}
|
||||
|
||||
if not ($msg contains 'msgnum') then
|
||||
stop
|
||||
|
||||
set $!usr!msgnum = field($msg, 58, 2);
|
||||
if cnum($!usr!msgnum) >= 5000 then
|
||||
stop
|
||||
/* We could use yet another method, but we like to have the action statement
|
||||
* without a filter in rsyslog.conf top level hierarchy - so this test, as
|
||||
* a side-effect, also tests this ability.
|
||||
*/
|
||||
action(type="omfile" file="./rsyslog.out.log" template="outfmt")
|
||||
'
|
||||
startup
|
||||
. $srcdir/diag.sh injectmsg 0 8000
|
||||
echo doing shutdown
|
||||
shutdown_when_empty
|
||||
|
||||
@ -6,7 +6,20 @@
|
||||
echo ===============================================================================
|
||||
echo \[rscript_unaffected_reset.sh\]: testing set/reset
|
||||
. $srcdir/diag.sh init
|
||||
startup rscript_unaffected_reset.conf
|
||||
generate_conf
|
||||
add_conf '
|
||||
template(name="outfmt" type="list") {
|
||||
property(name="$!usr!msgnum")
|
||||
constant(value="\n")
|
||||
}
|
||||
|
||||
if $msg contains 'msgnum' then {
|
||||
set $!usr!msgnum = field($msg, 58, 2);
|
||||
set $!usr!msgnum_reset = "dummy";
|
||||
action(type="omfile" file="./rsyslog.out.log" template="outfmt")
|
||||
}
|
||||
'
|
||||
startup
|
||||
. $srcdir/diag.sh injectmsg 0 100
|
||||
shutdown_when_empty
|
||||
wait_shutdown
|
||||
|
||||
@ -4,7 +4,18 @@
|
||||
echo ===============================================================================
|
||||
echo \[rscript_wrap2.sh\]: a test for wrap\(2\) script-function
|
||||
. $srcdir/diag.sh init
|
||||
startup rscript_wrap2.conf
|
||||
generate_conf
|
||||
add_conf '
|
||||
template(name="outfmt" type="string" string="%$.replaced_msg%\n")
|
||||
|
||||
module(load="../plugins/imtcp/.libs/imtcp")
|
||||
input(type="imtcp" port="13514")
|
||||
|
||||
set $.replaced_msg = wrap("foo says" & $msg, "*" & "*");
|
||||
|
||||
action(type="omfile" file="./rsyslog.out.log" template="outfmt")
|
||||
'
|
||||
startup
|
||||
. $srcdir/diag.sh tcpflood -m 1 -I $srcdir/testsuites/date_time_msg
|
||||
echo doing shutdown
|
||||
shutdown_when_empty
|
||||
|
||||
@ -4,7 +4,18 @@
|
||||
echo ===============================================================================
|
||||
echo \[rscript_wrap3.sh\]: a test for wrap\(3\) script-function
|
||||
. $srcdir/diag.sh init
|
||||
startup rscript_wrap3.conf
|
||||
generate_conf
|
||||
add_conf '
|
||||
template(name="outfmt" type="string" string="%$.replaced_msg%\n")
|
||||
|
||||
module(load="../plugins/imtcp/.libs/imtcp")
|
||||
input(type="imtcp" port="13514")
|
||||
|
||||
set $.replaced_msg = wrap("foo says" & $msg, "bc" & "def" & "bc", "ES" & "C");
|
||||
|
||||
action(type="omfile" file="./rsyslog.out.log" template="outfmt")
|
||||
'
|
||||
startup
|
||||
. $srcdir/diag.sh tcpflood -m 1 -I $srcdir/testsuites/wrap3_input
|
||||
echo doing shutdown
|
||||
shutdown_when_empty
|
||||
|
||||
@ -9,7 +9,22 @@ echo ===========================================================================
|
||||
echo \[rsf_getenv.sh\]: testing RainerScript getenv\(\) function
|
||||
export MSGNUM="msgnum:"
|
||||
. $srcdir/diag.sh init
|
||||
startup rsf_getenv.conf
|
||||
generate_conf
|
||||
add_conf '
|
||||
$ModLoad ../plugins/imtcp/.libs/imtcp
|
||||
$MainMsgQueueTimeoutShutdown 10000
|
||||
$InputTCPServerRun 13514
|
||||
|
||||
# set spool locations and switch queue to disk-only mode
|
||||
$WorkDirectory test-spool
|
||||
$MainMsgQueueFilename mainq
|
||||
$MainMsgQueueType disk
|
||||
|
||||
$template outfmt,"%msg:F,58:2%\n"
|
||||
$template dynfile,"rsyslog.out.log" # trick to use relative path names!
|
||||
if $msg contains getenv('MSGNUM') then ?dynfile;outfmt
|
||||
'
|
||||
startup
|
||||
. $srcdir/diag.sh tcpflood -m10000
|
||||
shutdown_when_empty # shut down rsyslogd when done processing messages
|
||||
wait_shutdown
|
||||
|
||||
@ -16,8 +16,42 @@ if [ `uname` = "SunOS" ] ; then
|
||||
fi
|
||||
|
||||
. $srcdir/diag.sh init
|
||||
generate_conf
|
||||
add_conf '
|
||||
$ModLoad ../plugins/imtcp/.libs/imtcp
|
||||
$MainMsgQueueTimeoutShutdown 10000
|
||||
|
||||
# general definition
|
||||
$template outfmt,"%msg:F,58:2%\n"
|
||||
|
||||
# create the individual rulesets
|
||||
$template dynfile1,"rsyslog.out1.log" # trick to use relative path names!
|
||||
ruleset(name="file1" queue.type="linkedList") {
|
||||
:msg, contains, "msgnum:" ?dynfile1;outfmt
|
||||
}
|
||||
|
||||
$template dynfile2,"rsyslog.out2.log" # trick to use relative path names!
|
||||
ruleset(name="file2" queue.type="linkedList") {
|
||||
:msg, contains, "msgnum:" ?dynfile2;outfmt
|
||||
}
|
||||
|
||||
$template dynfile3,"rsyslog.out3.log" # trick to use relative path names!
|
||||
ruleset(name="file3" queue.type="linkedList") {
|
||||
:msg, contains, "msgnum:" ?dynfile3;outfmt
|
||||
}
|
||||
|
||||
# start listeners and bind them to rulesets
|
||||
$InputTCPServerBindRuleset file1
|
||||
$InputTCPServerRun 13514
|
||||
|
||||
$InputTCPServerBindRuleset file2
|
||||
$InputTCPServerRun 13515
|
||||
|
||||
$InputTCPServerBindRuleset file3
|
||||
$InputTCPServerRun 13516
|
||||
'
|
||||
rm -f rsyslog.out1.log rsyslog.out2.log rsyslog.out3.log
|
||||
startup rulesetmultiqueue-v6.conf
|
||||
startup
|
||||
. $srcdir/diag.sh wait-startup
|
||||
# now fill the three files (a bit sequentially, but they should
|
||||
# still get their share of concurrency - to increase the chance
|
||||
|
||||
@ -16,8 +16,42 @@ if [ `uname` = "SunOS" ] ; then
|
||||
fi
|
||||
|
||||
. $srcdir/diag.sh init
|
||||
generate_conf
|
||||
add_conf '
|
||||
$ModLoad ../plugins/imtcp/.libs/imtcp
|
||||
$MainMsgQueueTimeoutShutdown 10000
|
||||
|
||||
# general definition
|
||||
$template outfmt,"%msg:F,58:2%\n"
|
||||
|
||||
# create the individual rulesets
|
||||
$ruleset file1
|
||||
$RulesetCreateMainQueue on
|
||||
$template dynfile1,"rsyslog.out1.log" # trick to use relative path names!
|
||||
:msg, contains, "msgnum:" ?dynfile1;outfmt
|
||||
|
||||
$ruleset file2
|
||||
$RulesetCreateMainQueue on
|
||||
$template dynfile2,"rsyslog.out2.log" # trick to use relative path names!
|
||||
:msg, contains, "msgnum:" ?dynfile2;outfmt
|
||||
|
||||
$ruleset file3
|
||||
$RulesetCreateMainQueue on
|
||||
$template dynfile3,"rsyslog.out3.log" # trick to use relative path names!
|
||||
:msg, contains, "msgnum:" ?dynfile3;outfmt
|
||||
|
||||
# start listeners and bind them to rulesets
|
||||
$InputTCPServerBindRuleset file1
|
||||
$InputTCPServerRun 13514
|
||||
|
||||
$InputTCPServerBindRuleset file2
|
||||
$InputTCPServerRun 13515
|
||||
|
||||
$InputTCPServerBindRuleset file3
|
||||
$InputTCPServerRun 13516
|
||||
'
|
||||
rm -f rsyslog.out1.log rsyslog.out2.log rsyslog.out3.log
|
||||
startup rulesetmultiqueue.conf
|
||||
startup
|
||||
. $srcdir/diag.sh wait-startup
|
||||
# now fill the three files (a bit sequentially, but they should
|
||||
# still get their share of concurrency - to increase the chance
|
||||
|
||||
@ -11,8 +11,20 @@ fi
|
||||
echo ===============================================================================
|
||||
echo \[sparse_array_lookup_table.sh\]: test for sparse-array lookup-table and HUP based reloading of it
|
||||
. $srcdir/diag.sh init
|
||||
generate_conf
|
||||
add_conf '
|
||||
lookup_table(name="xlate" file="xlate_array.lkp_tbl")
|
||||
|
||||
template(name="outfmt" type="string" string="%msg% %$.lkp%\n")
|
||||
|
||||
set $.num = field($msg, 58, 2);
|
||||
|
||||
set $.lkp = lookup("xlate", $.num);
|
||||
|
||||
action(type="omfile" file="./rsyslog.out.log" template="outfmt")
|
||||
'
|
||||
cp -f $srcdir/testsuites/xlate_sparse_array.lkp_tbl xlate_array.lkp_tbl
|
||||
startup_vg array_lookup_table.conf
|
||||
startup_vg
|
||||
. $srcdir/diag.sh injectmsg 0 1
|
||||
. $srcdir/diag.sh wait-queueempty
|
||||
. $srcdir/diag.sh assert-content-missing "foo"
|
||||
|
||||
@ -11,8 +11,20 @@ fi
|
||||
echo ===============================================================================
|
||||
echo \[sparse_array_lookup_table.sh\]: test for sparse-array lookup-table and HUP based reloading of it
|
||||
. $srcdir/diag.sh init
|
||||
generate_conf
|
||||
add_conf '
|
||||
lookup_table(name="xlate" file="xlate_array.lkp_tbl")
|
||||
|
||||
template(name="outfmt" type="string" string="%msg% %$.lkp%\n")
|
||||
|
||||
set $.num = field($msg, 58, 2);
|
||||
|
||||
set $.lkp = lookup("xlate", $.num);
|
||||
|
||||
action(type="omfile" file="./rsyslog.out.log" template="outfmt")
|
||||
'
|
||||
cp -f $srcdir/testsuites/xlate_sparse_array.lkp_tbl xlate_array.lkp_tbl
|
||||
startup array_lookup_table.conf
|
||||
startup
|
||||
. $srcdir/diag.sh injectmsg 0 1
|
||||
. $srcdir/diag.sh wait-queueempty
|
||||
. $srcdir/diag.sh assert-content-missing "foo"
|
||||
|
||||
@ -11,7 +11,19 @@ fi
|
||||
echo ===============================================================================
|
||||
echo \[stats-cee-vg.sh\]: test for verifying stats are reported correctly cee format with valgrind
|
||||
. $srcdir/diag.sh init
|
||||
startup_vg stats-cee.conf
|
||||
generate_conf
|
||||
add_conf '
|
||||
ruleset(name="stats") {
|
||||
action(type="omfile" file="./rsyslog.out.stats.log")
|
||||
}
|
||||
|
||||
module(load="../plugins/impstats/.libs/impstats" interval="1" severity="7" resetCounters="on" Ruleset="stats" bracketing="on" format="cee")
|
||||
|
||||
if ($msg == "this condition will never match") then {
|
||||
action(name="an_action_that_is_never_called" type="omfile" file="./rsyslog.out.log")
|
||||
}
|
||||
'
|
||||
startup_vg
|
||||
. $srcdir/diag.sh injectmsg-litteral $srcdir/testsuites/dynstats_input_1
|
||||
. $srcdir/diag.sh wait-queueempty
|
||||
. $srcdir/diag.sh wait-for-stats-flush 'rsyslog.out.stats.log'
|
||||
|
||||
@ -4,7 +4,19 @@
|
||||
echo ===============================================================================
|
||||
echo \[stats-cee.sh\]: test for verifying stats are reported correctly cee format
|
||||
. $srcdir/diag.sh init
|
||||
startup stats-cee.conf
|
||||
generate_conf
|
||||
add_conf '
|
||||
ruleset(name="stats") {
|
||||
action(type="omfile" file="./rsyslog.out.stats.log")
|
||||
}
|
||||
|
||||
module(load="../plugins/impstats/.libs/impstats" interval="1" severity="7" resetCounters="on" Ruleset="stats" bracketing="on" format="cee")
|
||||
|
||||
if ($msg == "this condition will never match") then {
|
||||
action(name="an_action_that_is_never_called" type="omfile" file="./rsyslog.out.log")
|
||||
}
|
||||
'
|
||||
startup
|
||||
. $srcdir/diag.sh injectmsg-litteral $srcdir/testsuites/dynstats_input_1
|
||||
. $srcdir/diag.sh wait-queueempty
|
||||
. $srcdir/diag.sh wait-for-stats-flush 'rsyslog.out.stats.log'
|
||||
|
||||
@ -4,7 +4,19 @@
|
||||
echo ===============================================================================
|
||||
echo \[stats-json-es.sh\]: test for verifying stats are reported correctly json-elasticsearch format
|
||||
. $srcdir/diag.sh init
|
||||
startup stats-json-es.conf
|
||||
generate_conf
|
||||
add_conf '
|
||||
ruleset(name="stats") {
|
||||
action(type="omfile" file="./rsyslog.out.stats.log")
|
||||
}
|
||||
|
||||
module(load="../plugins/impstats/.libs/impstats" interval="1" severity="7" resetCounters="on" Ruleset="stats" bracketing="on" format="json-elasticsearch")
|
||||
|
||||
if ($msg == "this condition will never match") then {
|
||||
action(name="an_action_that_is_never_called" type="omfile" file="./rsyslog.out.log")
|
||||
}
|
||||
'
|
||||
startup
|
||||
. $srcdir/diag.sh injectmsg-litteral $srcdir/testsuites/dynstats_input_1
|
||||
. $srcdir/diag.sh wait-queueempty
|
||||
. $srcdir/diag.sh wait-for-stats-flush 'rsyslog.out.stats.log'
|
||||
|
||||
@ -11,7 +11,19 @@ fi
|
||||
echo ===============================================================================
|
||||
echo \[stats-json-vg.sh\]: test for verifying stats are reported correctly json format with valgrind
|
||||
. $srcdir/diag.sh init
|
||||
startup_vg stats-json.conf
|
||||
generate_conf
|
||||
add_conf '
|
||||
ruleset(name="stats") {
|
||||
action(type="omfile" file="./rsyslog.out.stats.log")
|
||||
}
|
||||
|
||||
module(load="../plugins/impstats/.libs/impstats" interval="1" severity="7" resetCounters="on" Ruleset="stats" bracketing="on" format="json")
|
||||
|
||||
if ($msg == "this condition will never match") then {
|
||||
action(name="an_action_that_is_never_called" type="omfile" file="./rsyslog.out.log")
|
||||
}
|
||||
'
|
||||
startup_vg
|
||||
. $srcdir/diag.sh injectmsg-litteral $srcdir/testsuites/dynstats_input_1
|
||||
. $srcdir/diag.sh wait-queueempty
|
||||
. $srcdir/diag.sh wait-for-stats-flush 'rsyslog.out.stats.log'
|
||||
|
||||
@ -4,7 +4,19 @@
|
||||
echo ===============================================================================
|
||||
echo \[stats-json.sh\]: test for verifying stats are reported correctly json format
|
||||
. $srcdir/diag.sh init
|
||||
startup stats-json.conf
|
||||
generate_conf
|
||||
add_conf '
|
||||
ruleset(name="stats") {
|
||||
action(type="omfile" file="./rsyslog.out.stats.log")
|
||||
}
|
||||
|
||||
module(load="../plugins/impstats/.libs/impstats" interval="1" severity="7" resetCounters="on" Ruleset="stats" bracketing="on" format="json")
|
||||
|
||||
if ($msg == "this condition will never match") then {
|
||||
action(name="an_action_that_is_never_called" type="omfile" file="./rsyslog.out.log")
|
||||
}
|
||||
'
|
||||
startup
|
||||
. $srcdir/diag.sh injectmsg-litteral $srcdir/testsuites/dynstats_input_1
|
||||
. $srcdir/diag.sh wait-queueempty
|
||||
. $srcdir/diag.sh wait-for-stats-flush 'rsyslog.out.stats.log'
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user