Nicolas Lehuen wrote:
Hi Jim,

2005/11/16, Jim Gallacher <[EMAIL PROTECTED]>:

+1 with patch
Linux gentoo 2.6.12-gentoo-r6
apache 2.0.54 (mpm-prefork)
python 2.4.2
gcc 3.3.6

There are 2 issues with the unit tests in Gentoo that are fixed by the
attached patch. (Just to be clear, I mean the problems are with the unit
test code, not with mod_python).

First, test_global_lock uses ab in the test. In Gentoo, ab is named ab2,
so this test fails. The attached patch just skips the test if ab doesn't
exist. We can improve on this later.


My bad, I'm the one who put back this test... It was commented out
before mentioning a "bug in ab" with AFAIK the test ran perfectly. I
didn't think about ab being renamed ab2...

FYI, on debian ab2 is a symlink to ab.

The second issue is with test_req_headers_out, first reported by Dominic
Wong a couple of weeks ago. The fix is simple, but I want to understand
why it was failing under Gentoo and not other platforms.

The culprit seems to be the use of DirectoryIndex directive in the
test.conf. The existence of "DirectoryIndex /tests.py" causes apache to
segfault. Removing DirectoryIndex and giving the full url in the
putrequest allows the test to complete successfully.

So my questions are:

1. Why would DirectoryIndex cause a segfault on gentoo but not other
platforms?


I don't know why, but isn't it strange to put a slash in front of
tests.py ? Shouldn't the directive be just "DirectoryIndex tests.py" N

I tried using 'tests.py' as well, and it still segfaults. Weird.

2. This test is the only one that uses DirectoryIndex. Is there any
special reason for this?

3. This test is the only one that uses AddHandler instead of SetHandler.
Is there a reason for this?

4. This test is the only one that sets a PythonAccessHandler directive
in test.conf. Is there a reason for this?

Can anyone offer any insights?


It also uses httplib and not vhost_get. It's as if this test was one
of the first that have been written, and that ways to write better
tests have been improved since (using vhost_get etc.).

It makes sense to use httplib directly since it needs access to the headers. I did wonder if this was an early test though, and thus the different pattern used for the config.

To be consistent with the other tests I think I'll remove the PythonAccessHandler from test_req_document_root_conf as well, unless you can see a reason it should stay.

Jim



Reply via email to