mirror of
https://github.com/rsyslog/rsyslog.git
synced 2025-12-17 10:30:43 +01:00
Some old tests are carried out via the nettester tool. This was our initial shot at a testbench a couple of years ago. While it worked back then, the testbench framework has been much enhanced. These old tests are nowadays very hard to handle, as they miss debug support etc. So it is time to refactor them to new style. As a side-activity, the testbench plumbing has been enhanced to support some operations commonly needed by these tests. Contrary to pre-existing plumbing, these new operations are now crafted using bash functions, which we consider superior to the current method. So this is also the start of converting the older-style functionality into bash functions. We just did this now because it was required and we entangled it into the test refactoring because it was really needed. Else we had to write old-style operations and convert them in another commit, which would have been a waste of time. Special thanks to Pascal Withopf for the initial step of taking old tests and putting config as well as test data together into the refactored tests, on which Rainer Gerhards than could build to create the new tests and update testbench plumbing.
28 lines
833 B
Bash
Executable File
28 lines
833 B
Bash
Executable File
#!/bin/bash
|
|
# add 2018-06-25 by Pascal Withopf, released under ASL 2.0
|
|
. $srcdir/diag.sh init
|
|
. $srcdir/diag.sh generate-conf
|
|
. $srcdir/diag.sh add-conf '
|
|
module(load="../plugins/imudp/.libs/imudp")
|
|
input(type="imudp" port="13514")
|
|
|
|
template(name="outfmt" type="string" string="%timestamp:::date-mysql%\n")
|
|
|
|
:syslogtag, contains, "su" action(type="omfile" file="rsyslog.out.log"
|
|
template="outfmt")
|
|
|
|
'
|
|
. $srcdir/diag.sh startup
|
|
. $srcdir/diag.sh tcpflood -m1 -T "udp" -M "\"<34>1 2003-01-23T12:34:56.003Z mymachine.example.com su - ID47 - MSG\""
|
|
. $srcdir/diag.sh shutdown-when-empty
|
|
. $srcdir/diag.sh wait-shutdown
|
|
|
|
echo '20030123123456' | cmp - rsyslog.out.log
|
|
if [ ! $? -eq 0 ]; then
|
|
echo "invalid response generated, rsyslog.out.log is:"
|
|
cat rsyslog.out.log
|
|
. $srcdir/diag.sh error-exit 1
|
|
fi;
|
|
|
|
. $srcdir/diag.sh exit
|