-
Notifications
You must be signed in to change notification settings - Fork 638
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5208 from rgerhards/i4813
lookup tables bugfix: reload on HUP did not work when backgrounded
- Loading branch information
Showing
7 changed files
with
137 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#!/bin/bash | ||
# test for lookup-table and HUP based reloading of it | ||
# added 2015-09-30 by singh.janmejay | ||
# This file is part of the rsyslog project, released under ASL 2.0 | ||
. ${srcdir:=.}/diag.sh init | ||
skip_TSAN | ||
generate_conf | ||
add_conf ' | ||
lookup_table(name="xlate" file="'$RSYSLOG_DYNNAME'.xlate.lkp_tbl" reloadOnHUP="on") | ||
template(name="outfmt" type="string" string="- %msg% %$.lkp%\n") | ||
set $.lkp = lookup("xlate", $msg); | ||
action(type="omfile" file=`echo $RSYSLOG_OUT_LOG` template="outfmt") | ||
' | ||
cp -f $srcdir/testsuites/xlate.lkp_tbl $RSYSLOG_DYNNAME.xlate.lkp_tbl | ||
export RSTB_DAEMONIZE="YES" | ||
startup | ||
injectmsg 0 3 | ||
wait_queueempty | ||
content_check "msgnum:00000000: foo_old" | ||
content_check "msgnum:00000001: bar_old" | ||
assert_content_missing "baz" | ||
cp -f $srcdir/testsuites/xlate_more.lkp_tbl $RSYSLOG_DYNNAME.xlate.lkp_tbl | ||
issue_HUP | ||
await_lookup_table_reload | ||
injectmsg 0 3 | ||
wait_queueempty | ||
content_check "msgnum:00000000: foo_new" | ||
content_check "msgnum:00000001: bar_new" | ||
content_check "msgnum:00000002: baz" | ||
cp -f $srcdir/testsuites/xlate_more_with_duplicates_and_nomatch.lkp_tbl $RSYSLOG_DYNNAME.xlate.lkp_tbl | ||
issue_HUP | ||
await_lookup_table_reload | ||
injectmsg 0 10 | ||
echo doing shutdown | ||
shutdown_when_empty | ||
echo wait on shutdown | ||
wait_shutdown | ||
content_check "msgnum:00000000: foo_latest" | ||
content_check "msgnum:00000001: quux" | ||
content_check "msgnum:00000002: baz_latest" | ||
content_check "msgnum:00000003: foo_latest" | ||
content_check "msgnum:00000004: foo_latest" | ||
content_check "msgnum:00000005: baz_latest" | ||
content_check "msgnum:00000006: foo_latest" | ||
content_check "msgnum:00000007: baz_latest" | ||
content_check "msgnum:00000008: baz_latest" | ||
content_check "msgnum:00000009: quux" | ||
exit_test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters