perl-test-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Guillaume Rousse <Guillaume.Rou...@inria.fr>
Subject Using Apache::Test for testing web clients instead of servers
Date Thu, 29 Jul 2010 20:27:23 GMT
Hello list.

I'm trying to use Apache::Test for testing a web client
(fusioninventory-agent, if that matters), not a server component.
Basically, I have to test the agent can contact a web server with http
or https, directly or through a proxy, check ssl cert, etc...

So far, I figured out to launch a standard http server to run my tests as:

my $config = Apache::TestConfig->new(
    httpd => '/usr/sbin/httpd',
);
$config->httpd_config();
$config->prepare_t_conf();
$config->generate_httpd_conf;
my $server = $config->server();

$server->start();

# do some tests

$server->stop();

This is enough to automatically generate everything needed, and work
perfectly. However, I can't figure out how to run another server with
ssl support, using a static certificate/key. My understanding of the
code tells me I have to pass additional args to the creator, such as:

Apache::TestConfig->new(
    httpd => '/usr/sbin/httpd',
    scheme => 'https',
    ssl_module_name => 'mod_ssl'
);

It seems I also have to pass additional vhost configuration, with a
manually crafted extra.conf.in configuration file, such as:
<IfModule mod_ssl.c>
    <VirtualHost localhost:@port@>
	ServerName localhost

	SSLEngine on
	SSLCertificateFile @t_conf@/ssl/crt/good.pem
	SSLCertificateKeyFile @t_conf@/ssl/key/good.pem
    </VirtualHost>
</IfModule>

However, it doesn't work as expected:

waiting 60 seconds for server to start: ..
waiting 60 seconds for server to start: ok (waited 1 secs)
server localhost.localdomain:8529 started
server localhost.localdomain:8530 listening (8529)

still waiting for server to warm up:
...................................................
...........
the server is down, giving up after 61 secs

The error log doesn't tell much:
[Thu Jul 29 22:23:14 2010] [notice] Apache/2.2.16 (Mandriva
Linux/PREFORK-1mdv2011.0) mod_ssl/2.2.16 OpenSSL/1.0.0a PHP/5.3.3RC2
with Suhosin-Patch mod_perl/2.0.4 Perl/v5.12.1 configured -- resuming
normal operations
[Thu Jul 29 22:23:14 2010] [info] Server built: Jul 26 2010 09:50:10
[Thu Jul 29 22:23:14 2010] [debug] prefork.c(1012): AcceptMutex: fcntl
(default: fcntl)
[Thu Jul 29 22:24:16 2010] [info] removed PID file
/home/guillaume/work/fusioninventory/fusioninventory-agent/t/httpd/logs/httpd.pid
(pid=13059)
[Thu Jul 29 22:24:16 2010] [notice] caught SIGTERM, shutting down

What am I doing wrong here ?
-- 
BOFH excuse #266:

All of the packets are empty.


Mime
View raw message