File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 11#! /bin/sh
22# Verify log filtering based on ident/tag.
3+ # DEBUG=true
34. " ${srcdir:- .} /lib.sh"
45
56TG1=pimd
67TG2=mrouted
8+ TG3=in.tftpd
79MSG=" Multicast, a perfect weapon for an imperfect time."
810UNX=" In UNIX we trust"
11+ DOT=" We bring 512 byte block gifts"
912
1013LOGDIR=" $DIR /log"
1114SYSLOG=" ${LOGDIR} /syslog"
1215TG1LOG=" ${LOGDIR} /$TG1 .log"
1316TG2LOG=" ${LOGDIR} /$TG2 .log"
17+ TG3LOG=" ${LOGDIR} /$TG3 .log"
1418
1519setup_syslogd ()
1620{
@@ -22,6 +26,8 @@ setup_syslogd()
2226 *.* $TG1LOG
2327 #!$TG2
2428 *.* $TG2LOG
29+ #!$TG3
30+ *.* $TG3LOG
2531 EOF
2632 setup -m0
2733}
@@ -32,8 +38,8 @@ verify_tag()
3238 log=" $1 " ; shift
3339 msg=" $* "
3440
35- logger -t " $tag " " $msg "
36- grep " $msg " " $log "
41+ logger -ip user.debug - t " $tag " " $msg "
42+ grep " $msg " " $log " | grep " $tag "
3743}
3844
3945verify_log ()
@@ -52,6 +58,7 @@ verify_not()
5258run_step " Set up property based filtering syslogd" setup_syslogd
5359run_step " Verify basic tag based filtering (1)" verify_tag " $TG1 " " $TG1LOG " " $MSG "
5460run_step " Verify basic tag based filtering (2)" verify_tag " $TG2 " " $TG2LOG " " $MSG "
61+ run_step " Verify basic tag based filtering (3)" verify_tag " $TG3 " " $TG3LOG " " $DOT "
5562run_step " Verify not in syslog" verify_not " $SYSLOG " " $MSG "
5663
5764run_step " Verify unfiltered tag logging" verify_tag " foo" " $SYSLOG " " $UNX "
You can’t perform that action at this time.
0 commit comments