From: Jeremy Harris Date: Sun, 19 Apr 2015 18:13:58 +0000 (+0100) Subject: Testsuite: fix content-scanner interface tests X-Git-Tag: exim-4_86_RC1~78 X-Git-Url: https://git.exim.org/users/jgh/exim.git/commitdiff_plain/35deab6a4e72f25219fa7989be018f39f46a2276 Testsuite: fix content-scanner interface tests --- diff --git a/src/src/spam.c b/src/src/spam.c index 05a51f636..5bb973b4d 100644 --- a/src/src/spam.c +++ b/src/src/spam.c @@ -340,7 +340,7 @@ start = time(NULL); { uschar * errstr; - debug_printf("trying server %s\n", sd->hostspec); + DEBUG(D_acl) debug_printf("spamd: trying server %s\n", sd->hostspec); for (;;) { @@ -348,7 +348,7 @@ start = time(NULL); || sd->retry <= 0 ) break; - debug_printf("server %s: retry conn\n", sd->hostspec); + DEBUG(D_acl) debug_printf("sspamd: erver %s: retry conn\n", sd->hostspec); while (sd->retry > 0) sd->retry = sleep(sd->retry); } if (spamd_sock >= 0) @@ -384,8 +384,8 @@ if (sd->is_rspamd) const uschar * authid; req_str = string_sprintf("CHECK RSPAMC/1.3\r\nContent-length: %lu\r\n" - "Queue-Id: %s\r\nFrom: <%s>\r\nRecipient-Number: %d\r\n", mbox_size, - message_id, sender_address, recipients_count); + "Queue-Id: %s\r\nFrom: <%s>\r\nRecipient-Number: %d\r\n", + mbox_size, message_id, sender_address, recipients_count); for (i = 0; i < recipients_count; i ++) req_str = string_sprintf("%sRcpt: <%s>\r\n", req_str, recipients_list[i].address); if ((helo = expand_string(US"$sender_helo_name")) != NULL && *helo != '\0') diff --git a/test/runtest b/test/runtest index 4a4427839..84467064e 100755 --- a/test/runtest +++ b/test/runtest @@ -1333,6 +1333,9 @@ $munges = 'loopback' => { 'stdout' => 's/[[](127\.0\.0\.1|::1)]/[IP_LOOPBACK_ADDR]/' }, + 'scanfile_size' => + { 'stdout' => 's/(Content-length:) \d\d\d/$1 ddd/' }, + }; diff --git a/test/scripts/4000-scanning/4008 b/test/scripts/4000-scanning/4008 index c44b93854..703a7c2aa 100644 --- a/test/scripts/4000-scanning/4008 +++ b/test/scripts/4000-scanning/4008 @@ -1,4 +1,9 @@ # content scan interface: rspamd +# +# The spooled file for scanning includes the test-runner's user name +# hence size varies. Munge that. +munge scanfile_size +# server 11333 rcpt to: data +From: MAILER_DAEMON <> Content-type: text/plain test diff --git a/test/scripts/4000-scanning/4009 b/test/scripts/4000-scanning/4009 index 9c72a8222..0fb96ac16 100644 --- a/test/scripts/4000-scanning/4009 +++ b/test/scripts/4000-scanning/4009 @@ -1,5 +1,10 @@ # content scan interface: spamassassin # +# The spooled file for scanning includes the test-runner's user name +# hence size varies. Munge that. +munge scanfile_size +# +# # A good-comms test, returning not-spam. # (we could use a second one that returns is-spam...) server 7833 diff --git a/test/stdout/4008 b/test/stdout/4008 index e41af881d..afff4e4df 100644 --- a/test/stdout/4008 +++ b/test/stdout/4008 @@ -14,7 +14,7 @@ Listening on port 11333 ... Connection request from [127.0.0.1] ) < id 10HmaX-0005vi-00 < for userx@test.ex; Tue, 2 Mar 1999 09:44:33 +0000 + - + @@ -92,7 +92,7 @@ Listening on port 7833 ... Connection request from [127.0.0.1] @@ -137,7 +137,7 @@ Listening on port 7833 ... Connection request from [127.0.0.1] @@ -181,7 +181,7 @@ Listening on port 7833 ... Connection request from [127.0.0.1]