[exim-cvs] Testsuite: fix content-scanner interface tests

Top Page
Delete this message
Reply to this message
Author: Exim Git Commits Mailing List
Date:  
To: exim-cvs
Subject: [exim-cvs] Testsuite: fix content-scanner interface tests
Gitweb: http://git.exim.org/exim.git/commitdiff/35deab6a4e72f25219fa7989be018f39f46a2276
Commit:     35deab6a4e72f25219fa7989be018f39f46a2276
Parent:     b8fc75b3728d523ae83d02de92e1cfb002d25c9d
Author:     Jeremy Harris <jgh146exb@???>
AuthorDate: Sun Apr 19 19:13:58 2015 +0100
Committer:  Jeremy Harris <jgh146exb@???>
CommitDate: Sun Apr 19 19:13:58 2015 +0100


    Testsuite: fix content-scanner interface tests
---
 src/src/spam.c                  |    8 ++++----
 test/runtest                    |    3 +++
 test/scripts/4000-scanning/4008 |    9 ++++++++-
 test/scripts/4000-scanning/4009 |    5 +++++
 test/stdout/4008                |    5 +++--
 test/stdout/4009                |    8 ++++----
 6 files changed, 27 insertions(+), 11 deletions(-)


diff --git a/src/src/spam.c b/src/src/spam.c
index 05a51f6..5bb973b 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 4a44278..8446706 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 c44b938..703a7c2 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
 <CHECK RSPAMC/1.3
 <Content-length: 
@@ -17,9 +22,10 @@ server 11333
 <    (envelope
 <    id 
 <    for 
+<From:
 <Content-type: text/plain
 <Message-Id:
-<From:
+<Sender:
 <Date:
 <
 <test
@@ -36,6 +42,7 @@ ehlo test.ex
 mail from:<>
 rcpt to:<userx@???>
 data
+From: MAILER_DAEMON <>
 Content-type: text/plain


 test
diff --git a/test/scripts/4000-scanning/4009 b/test/scripts/4000-scanning/4009
index 9c72a82..0fb96ac 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 e41af88..afff4e4 100644
--- a/test/stdout/4008
+++ b/test/stdout/4008
@@ -14,7 +14,7 @@
 Listening on port 11333 ... 
 Connection request from [127.0.0.1]
 <CHECK RSPAMC/1.3
-<Content-length: 479
+<Content-length: ddd
 <Queue-Id: 10HmaX-0005vi-00
 <From: <CALLER@???>
 <Recipient-Number: 1
@@ -30,9 +30,10 @@ Connection request from [127.0.0.1]
 <    (envelope-from <CALLER@???>)
 <    id 10HmaX-0005vi-00
 <    for userx@???; Tue, 2 Mar 1999 09:44:33 +0000
+<From: MAILER_DAEMON <>
 <Content-type: text/plain
 <Message-Id: <E10HmaX-0005vi-00@???>
-<From: CALLER_NAME <CALLER@???>
+<Sender: CALLER_NAME <CALLER@???>
 <Date: Tue, 2 Mar 1999 09:44:33 +0000
 <
 <test
diff --git a/test/stdout/4009 b/test/stdout/4009
index cdc7677..93fec0c 100644
--- a/test/stdout/4009
+++ b/test/stdout/4009
@@ -48,7 +48,7 @@ Listening on port 7833 ...
 Connection request from [127.0.0.1]
 <REPORT SPAMC/1.2
 <User: nobody
-<Content-length: 479
+<Content-length: ddd
 <
 <From MAILER-DAEMON Tue Mar 02 09:44:33 1999
 <X-Envelope-From: <CALLER@???>
@@ -92,7 +92,7 @@ Listening on port 7833 ...
 Connection request from [127.0.0.1]
 <REPORT SPAMC/1.2
 <User: nobody
-<Content-length: 479
+<Content-length: ddd
 <
 <From MAILER-DAEMON Tue Mar 02 09:44:33 1999
 <X-Envelope-From: <CALLER@???>
@@ -137,7 +137,7 @@ Listening on port 7833 ...
 Connection request from [127.0.0.1]
 <REPORT SPAMC/1.2
 <User: nobody
-<Content-length: 479
+<Content-length: ddd
 <
 <From MAILER-DAEMON Tue Mar 02 09:44:33 1999
 <X-Envelope-From: <CALLER@???>
@@ -181,7 +181,7 @@ Listening on port 7833 ...
 Connection request from [127.0.0.1]
 <REPORT SPAMC/1.2
 <User: nobody
-<Content-length: 479
+<Content-length: ddd
 <
 <From MAILER-DAEMON Tue Mar 02 09:44:33 1999
 <X-Envelope-From: <CALLER@???>