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

Góra strony
Delete this message
Reply to this message
Autor: Daniel Tiefnig
Data:  
Dla: exim-dev
Temat: Re: [exim-dev] Preliminary testing of a new Exim test suite
Philip Hazel wrote:
> Feedback is invited...


So, here we go...

First, I'm not sure whether running via sudo is the best option. (One
has to configure sudo, add its user to the exim-group, and relogin to be
able to run the tests...) Maybe ppl. should be able to run tests as
root? You could set up some suid binaries and drop to exim-user-id after
that. Just a thought, I didn't check the code to see whether this is
possible...

First problem came with first test:
[..]
| Exim user is Debian-exim
| Exim group is Debian-exim
| Program caller is tiefnig ()


You see the epmty space enclosed in brackets? That will cause problems
later on, see below.

[...]
| Basic/0001 Basic configuration setting
| ** Subtest 1 (starting at line 8)
| ** Return code 1 (expected 0)

[...]
| Exim configuration error in line 207 of \
| /home/tiefnig/exim/exim-testsuite-0.00/confs/0001:
| user exim was not found


I'm on Debian and compiled exim with "EXIM_USER=Debian-exim". Duh.

After recompiling with "EXIM_USER=exim" Basic/0001 failed again:

| Basic/0001 Basic configuration setting
| ===============
| From line 1 of "test-stdout-munged" and line 1 of "stdout/0001" the \
| files are different.
| ----------
| CALLER_NAMEaccept_8bitmimeCALLER_NAME
| CALLER_NAMEbounce_message_fileCALLER_NAME =

[...]
| ----------
| accept_8bitmime
| bounce_message_file =


There migth be some substitution problems.. =:o)

Looking at your Perlscript, i see this dangerous assumption:

| ($parm_caller,$pwpw,$pwuid,$pwgid,$pwquota,$pwcomm,$parm_caller_name)
|    = getpwuid($>);


As we're still running with the callers id at this point, it comes clear
why $parm_caller_name is empty (still remember the empty brackets from
above?) later on:

| $ grep ^tiefnig /etc/passwd
| tiefnig:x:1000:1000::/home/tiefnig:/bin/bash


A little farther down the script we find the problem:

| while(<IN>)

[...]
|     s/(?<!CN=)\b$parm_caller_name\b/CALLER_NAME/g;


In practise, this expands to s/(?<!CN=)\b\b/CALLER_NAME/g. Which is,
under most circumstances the same as s/\b/CALLER_NAME/g. Oh no!

I commented out the substituion for the moment, and tried again:

Basic/0001: Success!

Next problem appeared in Basic/0002:

| ** Subtest 8 (starting at line 557)
| ** Return code 1 (expected 0)

[...]
| LOG: 1EB6ZY-0001S8-1K Failed to create spool file \
| /home/tiefnig/exim/exim-testsuite-0.00/spool/\
| input//1EB6ZY-0001S8-1K-D: Permission denied


(bakslash escaped linebreaks added daringly...)

The reason for this is just that:
| $ ls -ld /home/tiefnig/
| drwx------ 50 tiefnig tiefnig 4096 Sep 2 10:00 /home/tiefnig/


Maybe you should swap out ~/input and friends to /tmp, or just mention
that in some README. An explicit test whether we can read/write with an
explanatory error message would also help in that case.

After fixing this, again Basic/0002:
Line 474 of "test-stdout-munged" does not match line 474 of "stdout/0002".
| ----------
| > RC=127
| ----------
| > RC=0


Both 562 lines.

| Line 3 of "stderr/0002" occurs before line 3 of "test-stderr-munged".
| ----------
| admin user
| ===============
| Line 50 of "stderr/0002" occurs before line 49 of \
| "test-stderr-munged".
| ----------
| admin user
| ===============
| 2 differences found.
| "test-stderr-munged" contains 110 lines; "stderr/0002" contains 112 \
| lines


I'm not sure on how to address these at the moment.

Basic/0003 succeeded.
Basic/0004 succeeded.
Basic/0005 failes:
| ** Subtest 4 (starting at line 36)
| ** Return code 1 (expected 0)


Stderr prints two loglines, with message:
| re-exec of exim (/home/tiefnig/exim/exim-testsuite-0.00/eximdir/exim)\
| with -Mc failed: Permission denied


| $ ls -l /home/tiefnig/exim/exim-testsuite-0.00/eximdir/
| total 0


Hmmm.

Basic/0006:
| Lines 1-10 of "log/0006" occur at the end of "test-mainlog-munged".

[...]
| "test-mainlog-munged" contains 0 lines; "log/0006" contains 10 lines.


Hmmm, again.
Finally runtest bails out with:
| no mailbox found for mail/0006.CALLER


I think that's enought for the moment, or isn't it?
If you need any further information, or want me to try something, don't
hestitate to ask. My C is really not good, but my Perl is quite okay, I
think. :o)


lg,
daniel