From e3b3ea51205b5d9852783dfde526a05100144682 Mon Sep 17 00:00:00 2001 From: Darshit Shah Date: Tue, 12 Mar 2013 12:21:07 +0530 Subject: [PATCH] Add test to ensure correct return code on --post-file failure Signed-off-by: Darshit Shah --- tests/ChangeLog | 6 ++++++ tests/Makefile.am | 1 + tests/Test--post-file.px | 23 +++++++++++++++++++++++ tests/run-px | 1 + 4 files changed, 31 insertions(+) create mode 100755 tests/Test--post-file.px diff --git a/tests/ChangeLog b/tests/ChangeLog index 3650f829..8cd48648 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,9 @@ +2013-03-12 Darshit Shah + + * Makefile.am (EXTRA_DIST): Add Test--post-file.px. + * run-px (tests): Likewise. + * Test--post-file.px: New file. + 2012-11-09 Tim Ruehsen * HTTPServer.pm: added check for must-not-match request-header diff --git a/tests/Makefile.am b/tests/Makefile.am index 9ff302cd..ac6a663f 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -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 index 00000000..1c017b72 --- /dev/null +++ b/tests/Test--post-file.px @@ -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 diff --git a/tests/run-px b/tests/run-px index 657194fc..3c35d6f0 100755 --- a/tests/run-px +++ b/tests/run-px @@ -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', -- 2.39.2