summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHeiko Schlittermann (HS12-RIPE) <hs@schlittermann.de>2017-02-02 01:32:21 +0100
committerHeiko Schlittermann (HS12-RIPE) <hs@schlittermann.de>2017-02-02 01:33:46 +0100
commitb402f29499e9790419ff4dc8bb3462552e98e827 (patch)
tree11186049072f04e321ba243d954d98b62c7ac5be
parenta9c5db9e2f9f7e2a99ff8d89fe8d3693009f3831 (diff)
Testsuite: Fix 0207 (message order)
Message ids are not always in ascending order (PIDs may be randomized) Thanks to Kirill Miazine.
-rwxr-xr-xtest/runtest8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/runtest b/test/runtest
index 87ce5bfd3..ac840379c 100755
--- a/test/runtest
+++ b/test/runtest
@@ -2274,6 +2274,14 @@ elsif (/^((?i:[A-Z\d_]+=\S+\s+)+)?(\d+)?\s*(sudo(?:\s+-u\s+(\w+))?\s+)?exim(_\S+
my(@msglist) = ();
while (<QLIST>) { push (@msglist, $1) if /^\s*\d+[smhdw]\s+\S+\s+(\S+)/; }
close(QLIST);
+ # We need the message ids sorted in ascending order.
+ # Message id is: <timestamp>-<pid>-<fractional-time>. On some systems (*BSD) the
+ # PIDs are randomized, so sorting just the whole PID doesn't work.
+ # We do the Schartz' transformation here (sort on
+ # <timestamp><fractional-time>). Thanks to Kirill Miazine
+ @msglist = map { $_->[0] }
+ sort { $a->[1] cmp $b->[1] }
+ map { [$_, join '', (split '-', $_)[0,2]] } @msglist;
# Done backwards just in case there are more than 9