2005-11-02 09:27:23 -05:00
|
|
|
#!/usr/bin/perl -w
|
|
|
|
|
|
|
|
use strict;
|
|
|
|
|
2005-12-05 08:35:07 -05:00
|
|
|
use HTTPTest;
|
|
|
|
|
|
|
|
|
2005-11-02 09:27:23 -05:00
|
|
|
###############################################################################
|
|
|
|
|
|
|
|
my $dummyfile = <<EOF;
|
|
|
|
Content
|
|
|
|
EOF
|
|
|
|
|
|
|
|
# code, msg, headers, content
|
|
|
|
my %urls = (
|
|
|
|
'/dummy.html' => {
|
|
|
|
code => "200",
|
|
|
|
msg => "Dontcare",
|
|
|
|
headers => {
|
2006-08-22 10:26:36 -04:00
|
|
|
"Content-type" => "text/html",
|
2005-12-05 08:35:07 -05:00
|
|
|
"Last-Modified" => "Sat, 09 Oct 2004 08:30:00 GMT",
|
2005-11-02 09:27:23 -05:00
|
|
|
},
|
|
|
|
content => $dummyfile
|
|
|
|
},
|
|
|
|
);
|
|
|
|
|
2006-05-29 05:15:06 -04:00
|
|
|
my $cmdline = "wget -N http://localhost:8080/dummy.html";
|
2005-11-02 09:27:23 -05:00
|
|
|
|
|
|
|
my $expected_error_code = 0;
|
|
|
|
|
|
|
|
my %expected_downloaded_files = (
|
2005-12-05 08:35:07 -05:00
|
|
|
'dummy.html' => {
|
|
|
|
content => $dummyfile,
|
|
|
|
timestamp => 1097310600, # "Sat, 09 Oct 2004 08:30:00 GMT"
|
|
|
|
}
|
2005-11-02 09:27:23 -05:00
|
|
|
);
|
|
|
|
|
|
|
|
###############################################################################
|
|
|
|
|
2006-01-24 07:15:58 -05:00
|
|
|
my $the_test = HTTPTest->new (name => "Test2",
|
|
|
|
input => \%urls,
|
2005-12-05 08:35:07 -05:00
|
|
|
cmdline => $cmdline,
|
|
|
|
errcode => $expected_error_code,
|
2006-01-24 07:15:58 -05:00
|
|
|
output => \%expected_downloaded_files);
|
2005-12-05 08:35:07 -05:00
|
|
|
$the_test->run();
|
2005-11-02 09:27:23 -05:00
|
|
|
|
|
|
|
# vim: et ts=4 sw=4
|
|
|
|
|