tests 1334 to 1363 revisited.
authorYang Tse <yangsita@gmail.com>
Tue, 5 Jun 2012 18:19:27 +0000 (20:19 +0200)
committerYang Tse <yangsita@gmail.com>
Tue, 5 Jun 2012 18:20:40 +0000 (20:20 +0200)
Add a postcheck section to verify unintended file creation.

Remove needless <file> checks in verify section. Renumbering where appropriate.

23 files changed:
tests/data/test1336
tests/data/test1337
tests/data/test1344
tests/data/test1345
tests/data/test1347
tests/data/test1348
tests/data/test1349
tests/data/test1350
tests/data/test1351
tests/data/test1352
tests/data/test1353
tests/data/test1354
tests/data/test1355
tests/data/test1356
tests/data/test1357
tests/data/test1358
tests/data/test1359
tests/data/test1360
tests/data/test1361
tests/data/test1362
tests/data/test1363
tests/libtest/Makefile.am
tests/libtest/notexists.pl [new file with mode: 0755]

index 2b63a63..61721c6 100644 (file)
@@ -41,6 +41,9 @@ CURL_TESTDIR=%PWD/log
 <command option="no-output,no-include">
 http://%HOSTIP:%HTTPPORT/1336 -O -D log/heads1336
 </command>
+<postcheck>
+perl %SRCDIR/libtest/notexists.pl %PWD/log/name1336
+</postcheck>
 </client>
 
 #
index d79f7cf..e072da0 100644 (file)
@@ -41,6 +41,9 @@ CURL_TESTDIR=%PWD/log
 <command option="no-output,no-include">
 http://%HOSTIP:%HTTPPORT/1337 -O -D -
 </command>
+<postcheck>
+perl %SRCDIR/libtest/notexists.pl %PWD/log/name1337
+</postcheck>
 </client>
 
 #
index 1ceccd8..fbc6dad 100644 (file)
@@ -41,6 +41,9 @@ CURL_TESTDIR=%PWD/log
 <command option="no-output,no-include">
 http://%HOSTIP:%HTTPPORT/1344 -i -O -D log/heads1344
 </command>
+<postcheck>
+perl %SRCDIR/libtest/notexists.pl %PWD/log/name1344
+</postcheck>
 </client>
 
 #
index 5c6c849..24bd577 100644 (file)
@@ -41,6 +41,9 @@ CURL_TESTDIR=%PWD/log
 <command option="no-output,no-include">
 http://%HOSTIP:%HTTPPORT/1345 -i -O -D -
 </command>
+<postcheck>
+perl %SRCDIR/libtest/notexists.pl %PWD/log/name1345
+</postcheck>
 </client>
 
 #
index 3b0956f..33fa0e6 100644 (file)
@@ -41,6 +41,9 @@ CURL_TESTDIR=%PWD/log
 <command option="no-output,no-include">
 http://%HOSTIP:%HTTPPORT/1347 -i -O
 </command>
+<postcheck>
+perl %SRCDIR/libtest/notexists.pl %PWD/log/name1347
+</postcheck>
 </client>
 
 #
index 0c5b5b5..5f374cb 100644 (file)
@@ -54,14 +54,8 @@ fooo
 mooo
 </file1>
 
-<file2 name="log/heads1348">
+<file2 name="log/stdout1348">
 </file2>
 
-<file3 name="log/stdout1348">
-</file3>
-
-<file4 name="log/name1348">
-</file4>
-
 </verify>
 </testcase>
index 2a794fc..d46c112 100644 (file)
@@ -77,8 +77,5 @@ s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/
 <file3 name="log/stdout1349">
 </file3>
 
-<file4 name="log/name1349">
-</file4>
-
 </verify>
 </testcase>
index c82edd2..7602350 100644 (file)
@@ -54,10 +54,7 @@ fooo
 mooo
 </file1>
 
-<file2 name="log/heads1350">
-</file2>
-
-<file3 name="log/stdout1350">
+<file2 name="log/stdout1350">
 220-        _   _ ____  _     \r
 220-    ___| | | |  _ \| |    \r
 220-   / __| | | | |_) | |    \r
@@ -72,13 +69,10 @@ mooo
 213 10\r
 150 Binary data connection for 1350 () (10 bytes).\r
 226 File transfer complete\r
-</file3>
-<stripfile3>
+</file2>
+<stripfile2>
 s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/
-</stripfile3>
-
-<file4 name="log/name1350">
-</file4>
+</stripfile2>
 
 </verify>
 </testcase>
index e591b98..b14dfa5 100644 (file)
@@ -79,8 +79,5 @@ s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/
 curl: Saved to filename '%PWD/log/file1351'
 </file3>
 
-<file4 name="log/name1351">
-</file4>
-
 </verify>
 </testcase>
index d46af7f..86727d3 100644 (file)
@@ -55,10 +55,7 @@ fooo
 mooo
 </file1>
 
-<file2 name="log/heads1352">
-</file2>
-
-<file3 name="log/stdout1352">
+<file2 name="log/stdout1352">
 220-        _   _ ____  _     \r
 220-    ___| | | |  _ \| |    \r
 220-   / __| | | | |_) | |    \r
@@ -74,13 +71,10 @@ mooo
 150 Binary data connection for 1352 () (10 bytes).\r
 226 File transfer complete\r
 curl: Saved to filename '%PWD/log/file1352'
-</file3>
-<stripfile3>
+</file2>
+<stripfile2>
 s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/
-</stripfile3>
-
-<file4 name="log/name1352">
-</file4>
+</stripfile2>
 
 </verify>
 </testcase>
index d7317b2..5bedfcc 100644 (file)
@@ -77,8 +77,5 @@ s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/
 <file3 name="log/stdout1353">
 </file3>
 
-<file4 name="log/name1353">
-</file4>
-
 </verify>
 </testcase>
index 1071a0e..aa54f2d 100644 (file)
@@ -54,10 +54,7 @@ fooo
 mooo
 </file1>
 
-<file2 name="log/heads1354">
-</file2>
-
-<file3 name="log/stdout1354">
+<file2 name="log/stdout1354">
 220-        _   _ ____  _     \r
 220-    ___| | | |  _ \| |    \r
 220-   / __| | | | |_) | |    \r
@@ -72,13 +69,10 @@ mooo
 213 10\r
 150 Binary data connection for 1354 () (10 bytes).\r
 226 File transfer complete\r
-</file3>
-<stripfile3>
+</file2>
+<stripfile2>
 s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/
-</stripfile3>
-
-<file4 name="log/name1354">
-</file4>
+</stripfile2>
 
 </verify>
 </testcase>
index e782c9b..8d3c6bb 100644 (file)
@@ -54,10 +54,7 @@ fooo
 mooo
 </file1>
 
-<file2 name="log/heads1355">
-</file2>
-
-<file3 name="log/stdout1355">
+<file2 name="log/stdout1355">
 220-        _   _ ____  _     \r
 220-    ___| | | |  _ \| |    \r
 220-   / __| | | | |_) | |    \r
@@ -72,13 +69,10 @@ mooo
 213 10\r
 150 Binary data connection for 1355 () (10 bytes).\r
 226 File transfer complete\r
-</file3>
-<stripfile3>
+</file2>
+<stripfile2>
 s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/
-</stripfile3>
-
-<file4 name="log/name1355">
-</file4>
+</stripfile2>
 
 </verify>
 </testcase>
index 9ac193b..55cbbea 100644 (file)
@@ -41,6 +41,9 @@ CURL_TESTDIR=%PWD/log
 <command option="no-output,no-include">
 ftp://%HOSTIP:%FTPPORT/path/file1356 -O
 </command>
+<postcheck>
+perl %SRCDIR/libtest/notexists.pl %PWD/log/name1356
+</postcheck>
 </client>
 
 # Verify data after the test has been "shot"
@@ -69,14 +72,8 @@ Content-Disposition: filename=name1356; charset=funny; option=strange
 MOOOO
 </file1>
 
-<file2 name="log/heads1356">
+<file2 name="log/stdout1356">
 </file2>
 
-<file3 name="log/stdout1356">
-</file3>
-
-<file4 name="log/name1356">
-</file4>
-
 </verify>
 </testcase>
index a84cfd3..5f44458 100644 (file)
@@ -41,6 +41,9 @@ CURL_TESTDIR=%PWD/log
 <command option="no-output,no-include">
 ftp://%HOSTIP:%FTPPORT/path/file1357 -O -D log/heads1357
 </command>
+<postcheck>
+perl %SRCDIR/libtest/notexists.pl %PWD/log/name1357
+</postcheck>
 </client>
 
 # Verify data after the test has been "shot"
@@ -92,8 +95,5 @@ s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/
 <file3 name="log/stdout1357">
 </file3>
 
-<file4 name="log/name1357">
-</file4>
-
 </verify>
 </testcase>
index 0e2d045..e01047c 100644 (file)
@@ -41,6 +41,9 @@ CURL_TESTDIR=%PWD/log
 <command option="no-output,no-include">
 ftp://%HOSTIP:%FTPPORT/path/file1358 -O -D -
 </command>
+<postcheck>
+perl %SRCDIR/libtest/notexists.pl %PWD/log/name1358
+</postcheck>
 </client>
 
 # Verify data after the test has been "shot"
@@ -69,10 +72,7 @@ Content-Disposition: filename=name1358; charset=funny; option=strange
 MOOOO
 </file1>
 
-<file2 name="log/heads1358">
-</file2>
-
-<file3 name="log/stdout1358">
+<file2 name="log/stdout1358">
 220-        _   _ ____  _     \r
 220-    ___| | | |  _ \| |    \r
 220-   / __| | | | |_) | |    \r
@@ -87,13 +87,10 @@ MOOOO
 213 214\r
 150 Binary data connection for 1358 () (214 bytes).\r
 226 File transfer complete\r
-</file3>
-<stripfile3>
+</file2>
+<stripfile2>
 s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/
-</stripfile3>
-
-<file4 name="log/name1358">
-</file4>
+</stripfile2>
 
 </verify>
 </testcase>
index a355131..a273725 100644 (file)
@@ -42,6 +42,9 @@ CURL_TESTDIR=%PWD/log
 <command option="no-output,no-include">
 ftp://%HOSTIP:%FTPPORT/path/file1359 -O -J -D log/heads1359
 </command>
+<postcheck>
+perl %SRCDIR/libtest/notexists.pl %PWD/log/name1359
+</postcheck>
 </client>
 
 # 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'
 </file3>
 
-<file4 name="log/name1359">
-</file4>
-
 </verify>
 </testcase>
index 01c4bdb..f7c54cf 100644 (file)
@@ -42,6 +42,9 @@ CURL_TESTDIR=%PWD/log
 <command option="no-output,no-include">
 ftp://%HOSTIP:%FTPPORT/path/file1360 -O -J -D -
 </command>
+<postcheck>
+perl %SRCDIR/libtest/notexists.pl %PWD/log/name1360
+</postcheck>
 </client>
 
 # Verify data after the test has been "shot"
@@ -70,10 +73,7 @@ Content-Disposition: filename=name1360; charset=funny; option=strange
 MOOOO
 </file1>
 
-<file2 name="log/heads1360">
-</file2>
-
-<file3 name="log/stdout1360">
+<file2 name="log/stdout1360">
 220-        _   _ ____  _     \r
 220-    ___| | | |  _ \| |    \r
 220-   / __| | | | |_) | |    \r
@@ -89,13 +89,10 @@ MOOOO
 150 Binary data connection for 1360 () (214 bytes).\r
 226 File transfer complete\r
 curl: Saved to filename '%PWD/log/file1360'
-</file3>
-<stripfile3>
+</file2>
+<stripfile2>
 s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/
-</stripfile3>
-
-<file4 name="log/name1360">
-</file4>
+</stripfile2>
 
 </verify>
 </testcase>
index a940764..8634c24 100644 (file)
@@ -41,6 +41,9 @@ CURL_TESTDIR=%PWD/log
 <command option="no-output,no-include">
 ftp://%HOSTIP:%FTPPORT/path/file1361 -O -i -D log/heads1361
 </command>
+<postcheck>
+perl %SRCDIR/libtest/notexists.pl %PWD/log/name1361
+</postcheck>
 </client>
 
 # Verify data after the test has been "shot"
@@ -92,8 +95,5 @@ s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/
 <file3 name="log/stdout1361">
 </file3>
 
-<file4 name="log/name1361">
-</file4>
-
 </verify>
 </testcase>
index 6988768..71ed9d5 100644 (file)
@@ -41,6 +41,9 @@ CURL_TESTDIR=%PWD/log
 <command option="no-output,no-include">
 ftp://%HOSTIP:%FTPPORT/path/file1362 -O -i -D -
 </command>
+<postcheck>
+perl %SRCDIR/libtest/notexists.pl %PWD/log/name1362
+</postcheck>
 </client>
 
 # Verify data after the test has been "shot"
@@ -69,10 +72,7 @@ Content-Disposition: filename=name1362; charset=funny; option=strange
 MOOOO
 </file1>
 
-<file2 name="log/heads1362">
-</file2>
-
-<file3 name="log/stdout1362">
+<file2 name="log/stdout1362">
 220-        _   _ ____  _     \r
 220-    ___| | | |  _ \| |    \r
 220-   / __| | | | |_) | |    \r
@@ -87,13 +87,10 @@ MOOOO
 213 214\r
 150 Binary data connection for 1362 () (214 bytes).\r
 226 File transfer complete\r
-</file3>
-<stripfile3>
+</file2>
+<stripfile2>
 s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/
-</stripfile3>
-
-<file4 name="log/name1362">
-</file4>
+</stripfile2>
 
 </verify>
 </testcase>
index 3053227..d62783e 100644 (file)
@@ -41,6 +41,9 @@ CURL_TESTDIR=%PWD/log
 <command option="no-output,no-include">
 ftp://%HOSTIP:%FTPPORT/path/file1363 -O -i
 </command>
+<postcheck>
+perl %SRCDIR/libtest/notexists.pl %PWD/log/name1363
+</postcheck>
 </client>
 
 # Verify data after the test has been "shot"
@@ -69,10 +72,7 @@ Content-Disposition: filename=name1363; charset=funny; option=strange
 MOOOO
 </file1>
 
-<file2 name="log/heads1363">
-</file2>
-
-<file3 name="log/stdout1363">
+<file2 name="log/stdout1363">
 220-        _   _ ____  _     \r
 220-    ___| | | |  _ \| |    \r
 220-   / __| | | | |_) | |    \r
@@ -87,13 +87,10 @@ MOOOO
 213 214\r
 150 Binary data connection for 1363 () (214 bytes).\r
 226 File transfer complete\r
-</file3>
-<stripfile3>
+</file2>
+<stripfile2>
 s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/
-</stripfile3>
-
-<file4 name="log/name1363">
-</file4>
+</stripfile2>
 
 </verify>
 </testcase>
index 6170453..7b8d8fc 100644 (file)
@@ -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 (executable)
index 0000000..31b9851
--- /dev/null
@@ -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;