From 2b56e4c1bb31dc69517156a1c70a264a6f6e91e4 Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Tue, 5 Jun 2012 20:19:27 +0200 Subject: [PATCH] tests 1334 to 1363 revisited. Add a postcheck section to verify unintended file creation. Remove needless checks in verify section. Renumbering where appropriate. --- tests/data/test1336 | 3 +++ tests/data/test1337 | 3 +++ tests/data/test1344 | 3 +++ tests/data/test1345 | 3 +++ tests/data/test1347 | 3 +++ tests/data/test1348 | 8 +------- tests/data/test1349 | 3 --- tests/data/test1350 | 14 ++++---------- tests/data/test1351 | 3 --- tests/data/test1352 | 14 ++++---------- tests/data/test1353 | 3 --- tests/data/test1354 | 14 ++++---------- tests/data/test1355 | 14 ++++---------- tests/data/test1356 | 11 ++++------- tests/data/test1357 | 6 +++--- tests/data/test1358 | 17 +++++++---------- tests/data/test1359 | 6 +++--- tests/data/test1360 | 17 +++++++---------- tests/data/test1361 | 6 +++--- tests/data/test1362 | 17 +++++++---------- tests/data/test1363 | 17 +++++++---------- tests/libtest/Makefile.am | 2 +- tests/libtest/notexists.pl | 15 +++++++++++++++ 23 files changed, 89 insertions(+), 113 deletions(-) create mode 100755 tests/libtest/notexists.pl diff --git a/tests/data/test1336 b/tests/data/test1336 index 2b63a63..61721c6 100644 --- a/tests/data/test1336 +++ b/tests/data/test1336 @@ -41,6 +41,9 @@ CURL_TESTDIR=%PWD/log http://%HOSTIP:%HTTPPORT/1336 -O -D log/heads1336 + +perl %SRCDIR/libtest/notexists.pl %PWD/log/name1336 + # diff --git a/tests/data/test1337 b/tests/data/test1337 index d79f7cf..e072da0 100644 --- a/tests/data/test1337 +++ b/tests/data/test1337 @@ -41,6 +41,9 @@ CURL_TESTDIR=%PWD/log http://%HOSTIP:%HTTPPORT/1337 -O -D - + +perl %SRCDIR/libtest/notexists.pl %PWD/log/name1337 + # diff --git a/tests/data/test1344 b/tests/data/test1344 index 1ceccd8..fbc6dad 100644 --- a/tests/data/test1344 +++ b/tests/data/test1344 @@ -41,6 +41,9 @@ CURL_TESTDIR=%PWD/log http://%HOSTIP:%HTTPPORT/1344 -i -O -D log/heads1344 + +perl %SRCDIR/libtest/notexists.pl %PWD/log/name1344 + # diff --git a/tests/data/test1345 b/tests/data/test1345 index 5c6c849..24bd577 100644 --- a/tests/data/test1345 +++ b/tests/data/test1345 @@ -41,6 +41,9 @@ CURL_TESTDIR=%PWD/log http://%HOSTIP:%HTTPPORT/1345 -i -O -D - + +perl %SRCDIR/libtest/notexists.pl %PWD/log/name1345 + # diff --git a/tests/data/test1347 b/tests/data/test1347 index 3b0956f..33fa0e6 100644 --- a/tests/data/test1347 +++ b/tests/data/test1347 @@ -41,6 +41,9 @@ CURL_TESTDIR=%PWD/log http://%HOSTIP:%HTTPPORT/1347 -i -O + +perl %SRCDIR/libtest/notexists.pl %PWD/log/name1347 + # diff --git a/tests/data/test1348 b/tests/data/test1348 index 0c5b5b5..5f374cb 100644 --- a/tests/data/test1348 +++ b/tests/data/test1348 @@ -54,14 +54,8 @@ fooo mooo - + - - - - - - diff --git a/tests/data/test1349 b/tests/data/test1349 index 2a794fc..d46c112 100644 --- a/tests/data/test1349 +++ b/tests/data/test1349 @@ -77,8 +77,5 @@ s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/ - - - diff --git a/tests/data/test1350 b/tests/data/test1350 index c82edd2..7602350 100644 --- a/tests/data/test1350 +++ b/tests/data/test1350 @@ -54,10 +54,7 @@ fooo mooo - - - - + 220- _ _ ____ _ 220- ___| | | | _ \| | 220- / __| | | | |_) | | @@ -72,13 +69,10 @@ mooo 213 10 150 Binary data connection for 1350 () (10 bytes). 226 File transfer complete - - + + s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/ - - - - + diff --git a/tests/data/test1351 b/tests/data/test1351 index e591b98..b14dfa5 100644 --- a/tests/data/test1351 +++ b/tests/data/test1351 @@ -79,8 +79,5 @@ s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/ curl: Saved to filename '%PWD/log/file1351' - - - diff --git a/tests/data/test1352 b/tests/data/test1352 index d46af7f..86727d3 100644 --- a/tests/data/test1352 +++ b/tests/data/test1352 @@ -55,10 +55,7 @@ fooo mooo - - - - + 220- _ _ ____ _ 220- ___| | | | _ \| | 220- / __| | | | |_) | | @@ -74,13 +71,10 @@ mooo 150 Binary data connection for 1352 () (10 bytes). 226 File transfer complete curl: Saved to filename '%PWD/log/file1352' - - + + s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/ - - - - + diff --git a/tests/data/test1353 b/tests/data/test1353 index d7317b2..5bedfcc 100644 --- a/tests/data/test1353 +++ b/tests/data/test1353 @@ -77,8 +77,5 @@ s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/ - - - diff --git a/tests/data/test1354 b/tests/data/test1354 index 1071a0e..aa54f2d 100644 --- a/tests/data/test1354 +++ b/tests/data/test1354 @@ -54,10 +54,7 @@ fooo mooo - - - - + 220- _ _ ____ _ 220- ___| | | | _ \| | 220- / __| | | | |_) | | @@ -72,13 +69,10 @@ mooo 213 10 150 Binary data connection for 1354 () (10 bytes). 226 File transfer complete - - + + s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/ - - - - + diff --git a/tests/data/test1355 b/tests/data/test1355 index e782c9b..8d3c6bb 100644 --- a/tests/data/test1355 +++ b/tests/data/test1355 @@ -54,10 +54,7 @@ fooo mooo - - - - + 220- _ _ ____ _ 220- ___| | | | _ \| | 220- / __| | | | |_) | | @@ -72,13 +69,10 @@ mooo 213 10 150 Binary data connection for 1355 () (10 bytes). 226 File transfer complete - - + + s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/ - - - - + diff --git a/tests/data/test1356 b/tests/data/test1356 index 9ac193b..55cbbea 100644 --- a/tests/data/test1356 +++ b/tests/data/test1356 @@ -41,6 +41,9 @@ CURL_TESTDIR=%PWD/log ftp://%HOSTIP:%FTPPORT/path/file1356 -O + +perl %SRCDIR/libtest/notexists.pl %PWD/log/name1356 + # Verify data after the test has been "shot" @@ -69,14 +72,8 @@ Content-Disposition: filename=name1356; charset=funny; option=strange MOOOO - + - - - - - - diff --git a/tests/data/test1357 b/tests/data/test1357 index a84cfd3..5f44458 100644 --- a/tests/data/test1357 +++ b/tests/data/test1357 @@ -41,6 +41,9 @@ CURL_TESTDIR=%PWD/log ftp://%HOSTIP:%FTPPORT/path/file1357 -O -D log/heads1357 + +perl %SRCDIR/libtest/notexists.pl %PWD/log/name1357 + # Verify data after the test has been "shot" @@ -92,8 +95,5 @@ s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/ - - - diff --git a/tests/data/test1358 b/tests/data/test1358 index 0e2d045..e01047c 100644 --- a/tests/data/test1358 +++ b/tests/data/test1358 @@ -41,6 +41,9 @@ CURL_TESTDIR=%PWD/log ftp://%HOSTIP:%FTPPORT/path/file1358 -O -D - + +perl %SRCDIR/libtest/notexists.pl %PWD/log/name1358 + # Verify data after the test has been "shot" @@ -69,10 +72,7 @@ Content-Disposition: filename=name1358; charset=funny; option=strange MOOOO - - - - + 220- _ _ ____ _ 220- ___| | | | _ \| | 220- / __| | | | |_) | | @@ -87,13 +87,10 @@ MOOOO 213 214 150 Binary data connection for 1358 () (214 bytes). 226 File transfer complete - - + + s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/ - - - - + diff --git a/tests/data/test1359 b/tests/data/test1359 index a355131..a273725 100644 --- a/tests/data/test1359 +++ b/tests/data/test1359 @@ -42,6 +42,9 @@ CURL_TESTDIR=%PWD/log ftp://%HOSTIP:%FTPPORT/path/file1359 -O -J -D log/heads1359 + +perl %SRCDIR/libtest/notexists.pl %PWD/log/name1359 + # Verify data after the test has been "shot" @@ -94,8 +97,5 @@ s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/ curl: Saved to filename '%PWD/log/file1359' - - - diff --git a/tests/data/test1360 b/tests/data/test1360 index 01c4bdb..f7c54cf 100644 --- a/tests/data/test1360 +++ b/tests/data/test1360 @@ -42,6 +42,9 @@ CURL_TESTDIR=%PWD/log ftp://%HOSTIP:%FTPPORT/path/file1360 -O -J -D - + +perl %SRCDIR/libtest/notexists.pl %PWD/log/name1360 + # Verify data after the test has been "shot" @@ -70,10 +73,7 @@ Content-Disposition: filename=name1360; charset=funny; option=strange MOOOO - - - - + 220- _ _ ____ _ 220- ___| | | | _ \| | 220- / __| | | | |_) | | @@ -89,13 +89,10 @@ MOOOO 150 Binary data connection for 1360 () (214 bytes). 226 File transfer complete curl: Saved to filename '%PWD/log/file1360' - - + + s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/ - - - - + diff --git a/tests/data/test1361 b/tests/data/test1361 index a940764..8634c24 100644 --- a/tests/data/test1361 +++ b/tests/data/test1361 @@ -41,6 +41,9 @@ CURL_TESTDIR=%PWD/log ftp://%HOSTIP:%FTPPORT/path/file1361 -O -i -D log/heads1361 + +perl %SRCDIR/libtest/notexists.pl %PWD/log/name1361 + # Verify data after the test has been "shot" @@ -92,8 +95,5 @@ s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/ - - - diff --git a/tests/data/test1362 b/tests/data/test1362 index 6988768..71ed9d5 100644 --- a/tests/data/test1362 +++ b/tests/data/test1362 @@ -41,6 +41,9 @@ CURL_TESTDIR=%PWD/log ftp://%HOSTIP:%FTPPORT/path/file1362 -O -i -D - + +perl %SRCDIR/libtest/notexists.pl %PWD/log/name1362 + # Verify data after the test has been "shot" @@ -69,10 +72,7 @@ Content-Disposition: filename=name1362; charset=funny; option=strange MOOOO - - - - + 220- _ _ ____ _ 220- ___| | | | _ \| | 220- / __| | | | |_) | | @@ -87,13 +87,10 @@ MOOOO 213 214 150 Binary data connection for 1362 () (214 bytes). 226 File transfer complete - - + + s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/ - - - - + diff --git a/tests/data/test1363 b/tests/data/test1363 index 3053227..d62783e 100644 --- a/tests/data/test1363 +++ b/tests/data/test1363 @@ -41,6 +41,9 @@ CURL_TESTDIR=%PWD/log ftp://%HOSTIP:%FTPPORT/path/file1363 -O -i + +perl %SRCDIR/libtest/notexists.pl %PWD/log/name1363 + # Verify data after the test has been "shot" @@ -69,10 +72,7 @@ Content-Disposition: filename=name1363; charset=funny; option=strange MOOOO - - - - + 220- _ _ ____ _ 220- ___| | | | _ \| | 220- / __| | | | |_) | | @@ -87,13 +87,10 @@ MOOOO 213 214 150 Binary data connection for 1363 () (214 bytes). 226 File transfer complete - - + + s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/ - - - - + diff --git a/tests/libtest/Makefile.am b/tests/libtest/Makefile.am index 6170453..7b8d8fc 100644 --- a/tests/libtest/Makefile.am +++ b/tests/libtest/Makefile.am @@ -51,7 +51,7 @@ INCLUDES = -I$(top_builddir)/include/curl \ endif EXTRA_DIST = test75.pl test307.pl test610.pl test613.pl test1013.pl \ -test1022.pl Makefile.inc +test1022.pl Makefile.inc notexists.pl CFLAG_CURL_SYMBOL_HIDING = @CFLAG_CURL_SYMBOL_HIDING@ diff --git a/tests/libtest/notexists.pl b/tests/libtest/notexists.pl new file mode 100755 index 0000000..31b9851 --- /dev/null +++ b/tests/libtest/notexists.pl @@ -0,0 +1,15 @@ +#!/usr/bin/env perl +# Check that given arguments do not exist on filesystem. +my $code = 0; +if ($#ARGV < 0) { + print "Usage: $0 file1 [fileN]\n"; + exit 2; +} +while (@ARGV) { + my $fname = shift @ARGV; + if (-e $fname) { + print "Found '$fname' when not supposed to exist.\n"; + $code = 1; + } +} +exit $code; -- 2.7.4