From: Jeremy Harris Date: Wed, 26 Nov 2014 17:40:00 +0000 (+0000) Subject: Testsuite: sort output of retry DB dumps X-Git-Tag: exim-4_85_RC2~10 X-Git-Url: https://git.exim.org/exim.git/commitdiff_plain/a0ff7619b817834074aadbd45104ba5197008713 Testsuite: sort output of retry DB dumps Different systems will have dump output in different order so to tidy up the Solaris runs, sort pairs of lines by the leading "word". --- diff --git a/test/runtest b/test/runtest index 0eda52d91..9fd818879 100755 --- a/test/runtest +++ b/test/runtest @@ -1666,19 +1666,42 @@ if (/^dump\s+(\S+)/) my(@temp); print ">> ./eximdir/exim_dumpdb $parm_cwd/spool $which\n" if $debug; open(IN, "./eximdir/exim_dumpdb $parm_cwd/spool $which |"); - @temp = ; - close(IN); - if ($which eq "callout") + open(OUT, ">>test-stdout"); + print OUT "+++++++++++++++++++++++++++\n"; + + if ($which eq "retry") { + $/ = "\n "; + @temp = ; + $/ = "\n"; + @temp = sort { - my($aa) = substr $a, 21; - my($bb) = substr $b, 21; - return $aa cmp $bb; + my($aa) = split(' ', $a); + my($bb) = split(' ', $b); + return $aa cmp $bb; } @temp; + + foreach $item (@temp) + { + $item =~ s/^\s*(.*)\n(.*)\n?\s*$/\1\n\2/m; + print OUT " $item\n"; + } } - open(OUT, ">>test-stdout"); - print OUT "+++++++++++++++++++++++++++\n"; - print OUT @temp; + else + { + @temp = ; + if ($which eq "callout") + { + @temp = sort { + my($aa) = substr $a, 21; + my($bb) = substr $b, 21; + return $aa cmp $bb; + } @temp; + } + print OUT @temp; + } + + close(IN); close(OUT); return 1; } diff --git a/test/stdout/0099 b/test/stdout/0099 index e9272baa6..a1b59f986 100644 --- a/test/stdout/0099 +++ b/test/stdout/0099 @@ -15,10 +15,10 @@ first failed = time last try = time2 next try = time2 + 900 T:localhost.test.ex:127.0.0.1:999 dd 65 Connection refused first failed = time last try = time2 next try = time2 + 900 T:localhost.test.ex:::1:999 dd 65 Connection refused -first failed = time last try = time2 next try = time2 + 900 - T:thishost.test.ex:999 dd 65 Connection refused first failed = time last try = time2 next try = time2 + 900 T:thishost.test.ex:127.0.0.1:999 dd 65 Connection refused +first failed = time last try = time2 next try = time2 + 900 + T:thishost.test.ex:999 dd 65 Connection refused first failed = time last try = time2 next try = time2 + 900 Retry rule: *.star.ex * F,3d,10m; Retry rule: lsearch*@;TESTSUITE/aux-fixed/0099.rlist * F,1d,3m; diff --git a/test/stdout/0195 b/test/stdout/0195 index 991c273f3..4059a23a9 100644 --- a/test/stdout/0195 +++ b/test/stdout/0195 @@ -1,23 +1,23 @@ +++++++++++++++++++++++++++ R:userx@myhost.test.ex -1 0 forcibly deferred -first failed = time last try = time2 next try = time2 + 10 - R:userz@myhost.test.ex -1 0 forcibly deferred first failed = time last try = time2 next try = time2 + 10 R:usery@myhost.test.ex -1 0 forcibly deferred +first failed = time last try = time2 next try = time2 + 10 + R:userz@myhost.test.ex -1 0 forcibly deferred first failed = time last try = time2 next try = time2 + 10 +++++++++++++++++++++++++++ R:userx@myhost.test.ex -1 0 forcibly deferred -first failed = time last try = time2 next try = time2 + 10 - R:userz@myhost.test.ex -1 0 forcibly deferred first failed = time last try = time2 next try = time2 + 10 R:usery@myhost.test.ex -1 0 forcibly deferred +first failed = time last try = time2 next try = time2 + 10 + R:userz@myhost.test.ex -1 0 forcibly deferred first failed = time last try = time2 next try = time2 + 10 +++++++++++++++++++++++++++ R:userx@myhost.test.ex -1 0 forcibly deferred -first failed = time last try = time2 next try = time2 + 10 - R:userz@myhost.test.ex -1 0 forcibly deferred first failed = time last try = time2 next try = time2 + 10 R:usery@myhost.test.ex -1 0 forcibly deferred +first failed = time last try = time2 next try = time2 + 10 + R:userz@myhost.test.ex -1 0 forcibly deferred first failed = time last try = time2 next try = time2 + 10 +++++++++++++++++++++++++++ R:userx@myhost.test.ex -1 0 forcibly deferred @@ -26,8 +26,8 @@ first failed = time last try = time2 next try = time2 + 10 first failed = time last try = time2 next try = time2 + 10 +++++++++++++++++++++++++++ R:userx@myhost.test.ex -1 0 forcibly deferred -first failed = time last try = time2 next try = time2 + 10 - R:userz@myhost.test.ex -1 0 forcibly deferred first failed = time last try = time2 next try = time2 + 10 R:usery@myhost.test.ex -1 0 forcibly deferred +first failed = time last try = time2 next try = time2 + 10 + R:userz@myhost.test.ex -1 0 forcibly deferred first failed = time last try = time2 next try = time2 + 10 diff --git a/test/stdout/0264 b/test/stdout/0264 index a6c9f3961..48b789e6a 100644 --- a/test/stdout/0264 +++ b/test/stdout/0264 @@ -2,10 +2,10 @@ T:userx@test.ex -22 xxxx mailbox is full (MTA-imposed quota exceeded while writing to TESTSUITE/test-mail/userx) first failed = time last try = time2 next try = time2 + 600 +++++++++++++++++++++++++++ - T:userx@test.ex -22 xxxx mailbox is full (MTA-imposed quota exceeded while writing to TESTSUITE/test-mail/userx) -first failed = time last try = time2 next try = time2 + 600 T:test.ex -22 xxxx mailbox is full (MTA-imposed quota exceeded while writing to TESTSUITE/test-mail/notuser) first failed = time last try = time2 next try = time2 + 1200 + T:userx@test.ex -22 xxxx mailbox is full (MTA-imposed quota exceeded while writing to TESTSUITE/test-mail/userx) +first failed = time last try = time2 next try = time2 + 600 Message 10HmaX-0005vi-00 has been removed Message 10HmbA-0005vi-00 has been removed Message 10HmbB-0005vi-00 has been removed