| 1 | #! /bin/bashscip-shell filesystem . . `/bin/bash`. |
| 2 | # Don't read a file with old timestamp |
| 3 | # touch the file, then read it |
| 4 | echoscip-shell system . . echo. [imfile-ignore-old-file-2.sh] |
| 5 | . $srcdir/diag.sh check-inotify |
| 6 | . ${srcdir:=.}/diag.sh init |
| 7 | generate_conf |
| 8 | add_conf ' |
| 9 | module(load="../plugins/imfile/.libs/imfile") |
| 10 | input(type="imfile" |
| 11 | File="./'$RSYSLOG_DYNNAME'.input" |
| 12 | ignoreolderthan="604800" |
| 13 | Tag="file:" |
| 14 | ruleset="ruleset") |
| 15 | template(name="outfmt" type="string" string="%msg:F,58:2%\n") |
| 16 | ruleset(name="ruleset") { |
| 17 | action(type="omfile" file="'$RSYSLOG_OUT_LOG'" template="outfmt") |
| 18 | } |
| 19 | ' |
| 20 | |
| 21 | # create a log for testing |
| 22 | ./inputfilegen -m 1000 > ${RSYSLOG_DYNNAME}.input |
| 23 | touchscip-shell system . . touch. -m -t 201806010000.00 ./${RSYSLOG_DYNNAME}.input |
| 24 | startup |
| 25 | # sleep a little to give rsyslog a chance to begin processing |
| 26 | ./msleep 500 |
| 27 | |
| 28 | if lsscip-shell system . . ls. ${RSYSLOG_OUT_LOG} > /dev/nullscip-shell filesystem . . `/dev/null`.; then |
| 29 | echoscip-shell system . . echo. "FAIL: rsyslog.out.log isn't expected to be generated!" |
| 30 | exit 1 |
| 31 | fi |
| 32 | |
| 33 | # change timestamp |
| 34 | ./inputfilegen -m 1000 -i 1000 >> ${RSYSLOG_DYNNAME}.input |
| 35 | lsscip-shell system . . ls. -l ./${RSYSLOG_DYNNAME}.input |
| 36 | ./msleep 500 |
| 37 | # shut down rsyslogd when done processing messages |
| 38 | shutdown_when_empty |
| 39 | # we need to wait until rsyslogd is finished! |
| 40 | wait_shutdown |
| 41 | # check log file |
| 42 | seq_check 0 1999 |
| 43 | exit_test |