Add test to ensure correct return code on --post-file failure
authorDarshit Shah <darnir@gmail.com>
Tue, 12 Mar 2013 06:51:07 +0000 (12:21 +0530)
committerGiuseppe Scrivano <gscrivano@gnu.org>
Thu, 14 Mar 2013 20:38:40 +0000 (21:38 +0100)
Signed-off-by: Darshit Shah <darnir@gmail.com>
tests/ChangeLog
tests/Makefile.am
tests/Test--post-file.px [new file with mode: 0755]
tests/run-px

index 3650f829ee0459f55fb7f50488071ce44a4bc4b2..8cd48648973a359230d79c8db372548972c71425 100644 (file)
@@ -1,3 +1,9 @@
+2013-03-12  Darshit Shah <darnir@gmail.com>
+
+       * Makefile.am (EXTRA_DIST): Add Test--post-file.px.
+       * run-px (tests): Likewise.
+       * Test--post-file.px: New file.
+
 2012-11-09  Tim Ruehsen  <tim.ruehsen@gmx.de>
 
        * HTTPServer.pm: added check for must-not-match request-header
index 9ff302cdcbb9c6ae89ca331a165ec5f771d4b340..ac6a663fc0c930e4991903368d75aa4d2e998dc1 100644 (file)
@@ -119,6 +119,7 @@ EXTRA_DIST = FTPServer.pm FTPTest.pm HTTPServer.pm HTTPTest.pm \
              Test-O--no-content-disposition-trivial.px \
              Test-O-nonexisting.px \
              Test-O.px \
+             Test--post-file.px \
              Test-proxied-https-auth.px \
              Test-proxy-auth-basic.px \
              Test-restrict-ascii.px \
diff --git a/tests/Test--post-file.px b/tests/Test--post-file.px
new file mode 100755 (executable)
index 0000000..1c017b7
--- /dev/null
@@ -0,0 +1,23 @@
+#!/usr/bin/env perl
+
+use strict;
+use warnings;
+
+use HTTPTest;
+
+
+###############################################################################
+
+my $cmdline = $WgetTest::WGETPATH . " -d --post-file=nofile http://localhost:{{port}}/";
+
+my $expected_error_code = 3;
+
+
+###############################################################################
+
+my $the_test = HTTPTest->new (name => "Test-missing-file",
+                              cmdline => $cmdline,
+                              errcode => $expected_error_code);
+exit $the_test->run();
+
+# vim: et ts=4 sw=4
index 657194fc2d3558b933744297128a71d846020669..3c35d6f08dfcde3a2611916e0f71a550392398c6 100755 (executable)
@@ -70,6 +70,7 @@ my @tests = (
     'Test-O--no-content-disposition-trivial.px',
     'Test-O-nonexisting.px',
     'Test-O.px',
+    'Test--post-file.px',
     'Test-O-nc.px',
     'Test-restrict-ascii.px',
     'Test-Restrict-Lowercase.px',