]> sjero.net Git - wget/commitdiff
Add new test.
authorGiuseppe Scrivano <gscrivano@gnu.org>
Sat, 29 May 2010 21:10:59 +0000 (23:10 +0200)
committerGiuseppe Scrivano <gscrivano@gnu.org>
Sat, 29 May 2010 21:10:59 +0000 (23:10 +0200)
tests/ChangeLog
tests/Makefile.am
tests/Test-auth-retcode.px [new file with mode: 0644]
tests/run-px

index 84e62c96f9b44d525e33a3d2966b290427ae1894..d9d4d909e98b81462aade93e0b74e44340ae1a84 100644 (file)
@@ -1,3 +1,11 @@
+2010-05-29  Giuseppe Scrivano  <gscrivano@gnu.org>
+
+       * Makefile.am (EXTRA_DIST): Add Test-auth-retcode.px.
+
+       * run-px (tests): Likewise.
+
+       * Test-auth-retcode.px: New file.
+
 2010-05-16  Giuseppe Scrivano  <gscrivano@gnu.org>
 
        * Makefile.am (../md5/libmd5.a): Remove rule.
index e2deb980f68a4344911eb9b60daaddc6ada23c1e..8dafe0739d2330e20f9ff14ac5d43a236d978553 100644 (file)
@@ -65,6 +65,7 @@ EXTRA_DIST = FTPServer.pm FTPTest.pm HTTPServer.pm HTTPTest.pm \
              Test-auth-no-challenge.px \
              Test-auth-no-challenge-url.px \
              Test-auth-with-content-disposition.px \
+             Test-auth-retcode.px \
              Test-c-full.px \
              Test-c-partial.px \
              Test-c.px \
diff --git a/tests/Test-auth-retcode.px b/tests/Test-auth-retcode.px
new file mode 100644 (file)
index 0000000..5e16fa6
--- /dev/null
@@ -0,0 +1,38 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use HTTPTest;
+
+
+###############################################################################
+
+# code, msg, headers, content
+my %urls = (
+    '/dummy.txt' => {
+        code => "403",
+        msg => "Dontcare",
+        headers => {
+            "Content-type" => "text/plain",
+            "Last-Modified" => "Sat, 09 Oct 2004 08:30:00 GMT",
+        },
+    },
+);
+
+my $cmdline = $WgetTest::WGETPATH . " -N http://localhost:{{port}}/dummy.txt";
+
+my $expected_error_code = 8;
+
+my %expected_downloaded_files = ();
+
+###############################################################################
+
+my $the_test = HTTPTest->new (name => "Test-auth-retcode",
+                              input => \%urls,
+                              cmdline => $cmdline,
+                              errcode => $expected_error_code,
+                              output => \%expected_downloaded_files);
+exit $the_test->run();
+
+# vim: et ts=4 sw=4
index 64dca1a2d391608a4b56dede9a6e3682b7f59987..cce44e459927296d6f89bf44a3b854fcfbcc0c25 100755 (executable)
@@ -14,6 +14,7 @@ my @tests = (
     'Test-auth-no-challenge.px',
     'Test-auth-no-challenge-url.px',
     'Test-auth-with-content-disposition.px',
+    'Test-auth-retcode.px',
     'Test-cookies.px',
     'Test-cookies-401.px',
     'Test-proxy-auth-basic.px',