| 1 | #!/bin/bashscip-shell filesystem . . `/bin/bash`. |
| 2 | # test $NOW family of system properties |
| 3 | # addd 2016-01-12 by RGerhards, released under ASL 2.0 |
| 4 | # requires faketime |
| 5 | . ${srcdir:=.}/diag.sh init |
| 6 | export NUMMESSAGES=1 |
| 7 | export QUEUE_EMPTY_CHECK_FUNC=wait_file_lines |
| 8 | generate_conf |
| 9 | add_conf ' |
| 10 | module(load="../plugins/imtcp/.libs/imtcp") |
| 11 | input(type="imtcp" port="0" listenPortFileName="'$RSYSLOG_DYNNAME'.tcpflood_port") |
| 12 | |
| 13 | template(name="outfmt" type="string" |
| 14 | string="%$hour%:%$minute%,%$hour-utc%:%$minute-utc%\n") |
| 15 | :msg, contains, "msgnum:" action(type="omfile" template="outfmt" |
| 16 | file=`echo $RSYSLOG_OUT_LOG`) |
| 17 | ' |
| 18 | |
| 19 | . $srcdir/faketime_common.sh |
| 20 | |
| 21 | export TZ=TEST+06:30 |
| 22 | |
| 23 | FAKETIME='2016-01-01 01:00:00' startup |
| 24 | # what we send actually is irrelevant, as we just use system properties. |
| 25 | # but we need to send one message in order to gain output! |
| 26 | tcpflood -m1 |
| 27 | shutdown_when_empty |
| 28 | wait_shutdown |
| 29 | export EXPECTED="01:00,07:30" |
| 30 | cmp_exact |
| 31 | |
| 32 | exit_test |