httpd-test-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From William McKee <will...@knowmad.com>
Subject Re: Perl test framework, TestConfig, and debugging A::T
Date Fri, 16 Jan 2004 22:09:03 GMT
On Thu, Jan 15, 2004 at 05:08:39PM -0800, Stas Bekman wrote:
> strange, I saw it once and could never reproduce it again. What is the 
> sequence of commands when you get it?

That is interesting. Right now, I'm playing with Geoff's
bug-reporting-skeleton-mp1 running my my Apache 1.3.29 server with
modperl 1.29 and am able to replicate this VirtualHost bug
intermittently but regularly. Let me try to explain.

I have an extra.conf.in which contains a plain VirtualHost (let's keep
the SSL out of it for now). I have a testsuite which gets the hostport
of this second server as described in your docs and gets the index page.
I run my tests and everything works.

If I try to run the tests again, the host info is not found thus
hostport does not get set and the script dies. If I go back into
extra.conf.in and make a change to the file (or simply `touch` it), my
tests will work again. However on the next attempt, and any further
attempts, the script fail when trying to get the hostport. This is
differernt from what you are reporting that the test failed first then
ran successfully ever after.

I can do the above and set the -times=100 parameter and get 100 failures
or 100 successes depending on the changes to the extra.conf.in. So what
is A::T doing internally when the extra.conf.in file changes which would
affect the virtual host config? If you would like to review my
configuration or test my module, it is available on my server[1] (at
this point the last test is failing but don't be surprised by that; the
reason is explained below; the virtual host bug will cause the tests to
die prematurely).

For completeness, I added a third server to handle SSL requests. I then
do the following requests after setting the $hostport to the secure
server:

    get https://$hostport/      # get index from secure server
    get /                       # get index from primary server?

The first test passes but the last test fails with a message that I'm
trying to speak HTTP to a HTTPS server. So it seems that the code to get
the hostport (e.g., Apache::TestRequest::module('My::SSL') )is actually
setting the test environment to continue to use that host for all
further requests. Is this correct? If so, it should be noted in the
documentation regarding Virtual Hosts.

At any rate, the tests will all pass when the first run and will
continue to fail until such time as you change or touch the
extra.conf.in. Does anyone else use VirtualHost's in their
configuration? Are you using Apache 1.3.x or Apache 2.x?

Finally, I added a test for getting a page from the primary server after
getting the hostport info using A::TR::module function. It fails. Here
is the line I'm trying to use:

    Apache::TestRequest::module('');

Is there a way to set the test environment back to getting pages from
the primary server after the above has been called to get a virtualhost
configuration? It seems that this code is setting some internal
configuration values rather than just getting the values as I was
expecting.


Thanks,
William

[1] http://www.knowmad.com/~william/bug-reporting-skeleton-mp1.tar.gz

-- 
Knowmad Services Inc.
http://www.knowmad.com

Mime
View raw message