Re: [exim-dev] Preliminary testing of a new Exim test suite

Página Inicial
Delete this message
Reply to this message
Autor: Philip Hazel
Data:  
Para: Daniel Tiefnig
CC: exim-dev
Assunto: Re: [exim-dev] Preliminary testing of a new Exim test suite
On Thu, 24 Nov 2005, Daniel Tiefnig wrote:

> maildir/5000 exim quota + warn threshold with maildir
> ===============
> Lines 3-6 of "test-mail-munged" do not match lines 3-6 of
> "mail/5000.new/1.myhost.test.ex".
> ----------
>         id 10HmaZ-0005vi-00
>         for userx@???; Tue, 2 Mar 1999 09:44:33 +0000
> maildir:maildir_
> Message-Id: <E10HmaZ-0005vi-00@???>
> ----------
>         id 10HmaY-0005vi-00
>         for userx@???; Tue, 2 Mar 1999 09:44:33 +0000
> maildir:maildir_
> Message-Id: <E10HmaY-0005vi-00@???>


I believe that I have found the bug in the runtest script that causes
this. Please can you try the patch below? The new comment gives a clue
as to how I screwed up... :-)

Philip

-- 
Philip Hazel            University of Cambridge Computing Service,
ph10@???      Cambridge, England. Phone: +44 1223 334714.



*** exim-testsuite-0.00/runtest        Thu Nov 24 09:03:40 2005
--- runtest    Wed Nov 30 10:48:01 2005
***************
*** 195,200 ****
--- 195,215 ----
  }



+ # This is subroutine to sort Exim message ids into time-order. Unfortunately,
+ # for historical reasons, the time field is split into two parts in the
+ # message id. The bit in the middle is a process number, so we have to remove
+ # it before comparing, as otherwise, when the seconds value is the same, we
+ # would be sorting on the process number, which is not right.
+
+ sub eximidsort {
+ my($x) = $a;
+ my($y) = $b;
+ $x =~ s/-[^-]-//;
+ $y =~ s/-[^-]-//;
+ return $x cmp $y;
+ }
+
+

  ##################################################
  #         Munge a file before comparing          #
***************
*** 964,970 ****
        {
        opendir(DIR, "test-mail/$mail") ||
          tests_exit(-1, "Failed to opendir test-mail/$mail: $!");
!       @submails = sort readdir(DIR);
        closedir(DIR);


        my($msgno) = 0;
--- 979,985 ----
        {
        opendir(DIR, "test-mail/$mail") ||
          tests_exit(-1, "Failed to opendir test-mail/$mail: $!");
!       @submails = sort eximidsort readdir(DIR);
        closedir(DIR);


        my($msgno) = 0;