You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by jm...@apache.org on 2007/07/27 19:09:52 UTC
svn commit: r560318 - /spamassassin/trunk/t/root_spamd_u_dcc.t
Author: jm
Date: Fri Jul 27 10:09:51 2007
New Revision: 560318
URL: http://svn.apache.org/viewvc?view=rev&rev=560318
Log:
run multiple scans with the spamd child to ensure the setuid was reversible if needs be
Modified:
spamassassin/trunk/t/root_spamd_u_dcc.t
Modified: spamassassin/trunk/t/root_spamd_u_dcc.t
URL: http://svn.apache.org/viewvc/spamassassin/trunk/t/root_spamd_u_dcc.t?view=diff&rev=560318&r1=560317&r2=560318
==============================================================================
--- spamassassin/trunk/t/root_spamd_u_dcc.t (original)
+++ spamassassin/trunk/t/root_spamd_u_dcc.t Fri Jul 27 10:09:51 2007
@@ -12,7 +12,7 @@
use constant IS_ROOT => eval { ($> == 0); };
use constant RUN_TESTS => (TEST_ENABLED && DCC_TEST_ENABLED && IS_ROOT);
-BEGIN { plan tests => (RUN_TESTS ? 9 : 0) };
+BEGIN { plan tests => (RUN_TESTS ? 23 : 0) };
exit unless RUN_TESTS;
# ---------------------------------------------------------------------------
@@ -35,7 +35,6 @@
q{ X-Spam-Status: Yes, score=}, 'status',
q{ X-Spam-Flag: YES}, 'flag',
q{ X-Spam-Level: **********}, 'stars',
-q{ Listed in DCC }, 'dcc',
);
@@ -44,14 +43,20 @@
$SIG{ALRM} = sub { stop_spamd(); die "timed out"; };
alarm 60;
-ok(start_spamd("-c -H"));
+ok(start_spamd("-c -H -m1"));
alarm 0;
-$SIG{ALRM} = sub { stop_spamd(); die "timed out"; };
-alarm 10;
-ok(spamcrun("< data/spam/gtubedcc.eml", \&patterns_run_cb));
-alarm 0;
+# run a few times to ensure that the child can process more than
+# one message successfully. do not bother looking for the dcc
+# result; we just want to ensure that the check did not cause
+# the spamd kids to get hung
+for my $try (1 .. 5) {
+ $SIG{ALRM} = sub { stop_spamd(); die "timed out"; };
+ alarm 10;
+ ok(spamcrun("< data/spam/gtubedcc.eml", \&patterns_run_cb));
+ alarm 0;
+ ok_all_patterns();
+}
-ok_all_patterns();
ok(stop_spamd());