12 our $child_pid = undef;
15 if (defined $child_pid) {
24 die "Unable to fork child" if not defined $pid;
27 # Wait for two seconds to let the child start
32 package SillyWebServer;
33 use HTTP::Server::Simple;
34 use base qw(HTTP::Server::Simple::CGI::Environment HTTP::Server::Simple);
37 open($fh,'-|',-e './cgi/version.cgi'? './cgi/version.cgi' : '../cgi/version.cgi');
41 if (/^\s*$/ and $status) {
42 print "HTTP/1.1 $status OK\n";
48 if (/^Status:\s*(\d+)/i) {
57 my $server = SillyWebServer->new($port);
64 my $ua = LWP::UserAgent->new;
65 $ua->agent("DebbugsTesting/0.1 ");
68 my $req = HTTP::Request->new(GET => "http://localhost:$port/");
70 my $res = $ua->request($req);
71 ok($res->is_success(),'cgi/version.cgi returns success');
72 my $etag = $res->header('Etag');
74 $req = HTTP::Request->new(GET => "http://localhost:$port/",['If-None-Match',$etag]);
75 $res = $ua->request($req);
76 ok($res->code() eq '304','If-None-Match set gives us 304 not modified');