]> granicus.if.org Git - curl/commitdiff
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 2b63a63b87ac07da187523800b0519952b3e7a2c..61721c61a6ccf4613b04d8ce2e5b03d1a9b54fe1 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 d79f7cf6d2fa539705ffd0590dbe5383a50975f1..e072da07b6a2a66c362d7fa8a728b926439a8a21 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 1ceccd8133e9d5588f2cab0b4571a468d8377492..fbc6dad1f89641c485d60d9bbbd60d1a9627254b 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 5c6c8492b06a6d42421aba888cdb3344defd61eb..24bd577d6cddad78baf44f66cf3fac6719cd7771 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 3b0956f973a3144ed95daa321a1efaeaf8da850c..33fa0e6da36963b8fec7d5f78cb79b5c13ab7c91 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 0c5b5b5c7c05ffa5a7b0df93268508553d0fd283..5f374cb2feca01b0eb8923cfa26ca74b6892b408 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 2a794fc8c09f13cfc523e38295120dbdd89a8099..d46c11287106c51830e1648a2d458c61f59d8354 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 c82edd2cad1b301c7b4db69678072fdd65a8ee50..76023502461ec9fe401664dc8ef0c3100e7f4430 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 e591b98cd6355ad81582ab34f2aa8662eee4ad53..b14dfa542157fcdc9cf87cb923abaf89360589b1 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 d46af7f5d5b42340a28e4ac4246dde2130ef5a5c..86727d3e5e71160f2e162794de1dcb196ce28028 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 d7317b2113e0fb42cc917d96941ac937cb0dbc6b..5bedfcc770c0e81599313f035f3a5bee56828451 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 1071a0ef48933de71e3ec5074383ce0b9d44c3ac..aa54f2d07e700b1419e2fab62114e3b90ed6b1ea 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 e782c9b99e43c71fabbde6038e987cfcf7f97709..8d3c6bb529280bbb6cf47232097866c3f61a6dc0 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 9ac193b8e8e2a76c079ab39d884fe538057f40c3..55cbbea8135af999409b135b48e1bed45376d0ef 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 a84cfd31d37683195a0dc20cb28114e77a553e01..5f4445836257bb3518034fee8d1eb193cfdf3942 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 0e2d045e29887340eec83134885ea3ce8d0b3d33..e01047c58245a5588b6726c34538e1a888ade051 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 a35513147825bb0f5eb95b315d699ed7bc07cd56..a2737258f04dcd766eb398de273703c7b06eff19 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 01c4bdba21a607ba1237f9b80a1904c5262c51bc..f7c54cf3fb2c6db58a93145403f43616421c5fc8 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 a940764974754111bfeb1d034c6899319ccc34ea..8634c2423d58776b1d4ef6d429294ccda9785984 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 6988768051e09a72f5b99113502481b0986d8438..71ed9d5e68b74d324f456863c5b8bbc8f8384a73 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 30532275ec6f81e30ab59dd0e75a1c9305b797b2..d62783e527ea9bc2ab512e5d1f91ecb271939936 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 6170453a07283257442dee79b28129148d13def8..7b8d8fc0417565be8e7fa29be8dda1ad99965451 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;