You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by mm...@apache.org on 2012/11/02 19:15:38 UTC
svn commit: r1405084 - /spamassassin/trunk/t/debug.t
Author: mmartinec
Date: Fri Nov 2 18:15:37 2012
New Revision: 1405084
URL: http://svn.apache.org/viewvc?rev=1405084&view=rev
Log:
t/debug.t: avoid "malformed debug message" due to a timestamp in a log, add missing facilities to the list
Modified:
spamassassin/trunk/t/debug.t
Modified: spamassassin/trunk/t/debug.t
URL: http://svn.apache.org/viewvc/spamassassin/trunk/t/debug.t?rev=1405084&r1=1405083&r2=1405084&view=diff
==============================================================================
--- spamassassin/trunk/t/debug.t (original)
+++ spamassassin/trunk/t/debug.t Fri Nov 2 18:15:37 2012
@@ -28,14 +28,13 @@ BEGIN {
exit unless TEST_ENABLED;
# list of known debug facilities
-my %facility = map {; $_ => 1 }
- qw( accessdb async auto-whitelist bayes check config daemon
+my %facility = map( ($_, 1),
+ qw( accessdb archive-iterator async auto-whitelist bayes check config daemon
dcc dkim dns eval generic https_http_mismatch facility FreeMail
hashcash ident ignore info ldap learn locker log logger markup
- message metadata mimeheader plugin prefork progress pyzor razor2
- received-header replacetags reporter rules spamd spf textcat
- timing uri uridnsbl util ),
-;
+ message metadata mimeheader netset plugin prefork progress pyzor razor2
+ received-header replacetags reporter rules rules-all spamd spf textcat
+ timing uri uridnsbl util ));
my $fh = IO::File->new_tmpfile();
open(STDERR, ">&=".fileno($fh)) || die "Cannot reopen STDERR";
@@ -51,6 +50,11 @@ my $error = do {
my $malformed = 0;
my $unlisted = 0;
for (split(/^/m, $error)) {
+
+ # ditch a syslog-like timestamp if present
+ s/^ [a-z]{3} \s+ \d{1,2} \s+
+ \d{1,2} : \d{1,2} : \d{1,2} (?: \. \d* )? \s*//xsi;
+
if (/^(?: \[ \d+ \] \s+)? (dbg|info): \s* ([^:\s]+) : \s* (.*)/x) {
if (!exists $facility{$2}) {
$unlisted++;