tests 1334 to 1363 revisited.

Add a postcheck section to verify unintended file creation.

Remove needless <file> checks in verify section. Renumbering where appropriate.
This commit is contained in:
Yang Tse 2012-06-05 20:19:27 +02:00
parent 62f374b19e
commit 2b56e4c1bb
23 changed files with 89 additions and 113 deletions

View 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>
#

View 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>
#

View 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>
#

View 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>
#

View 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>
#

View 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>

View 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>

View File

@ -54,10 +54,7 @@ fooo
mooo
</file1>
<file2 name="log/heads1350">
</file2>
<file3 name="log/stdout1350">
<file2 name="log/stdout1350">
220- _ _ ____ _
220- ___| | | | _ \| |
220- / __| | | | |_) | |
@ -72,13 +69,10 @@ mooo
213 10
150 Binary data connection for 1350 () (10 bytes).
226 File transfer complete
</file3>
<stripfile3>
</file2>
<stripfile2>
s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/
</stripfile3>
<file4 name="log/name1350">
</file4>
</stripfile2>
</verify>
</testcase>

View 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>

View File

@ -55,10 +55,7 @@ fooo
mooo
</file1>
<file2 name="log/heads1352">
</file2>
<file3 name="log/stdout1352">
<file2 name="log/stdout1352">
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'
</file3>
<stripfile3>
</file2>
<stripfile2>
s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/
</stripfile3>
<file4 name="log/name1352">
</file4>
</stripfile2>
</verify>
</testcase>

View 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>

View File

@ -54,10 +54,7 @@ fooo
mooo
</file1>
<file2 name="log/heads1354">
</file2>
<file3 name="log/stdout1354">
<file2 name="log/stdout1354">
220- _ _ ____ _
220- ___| | | | _ \| |
220- / __| | | | |_) | |
@ -72,13 +69,10 @@ mooo
213 10
150 Binary data connection for 1354 () (10 bytes).
226 File transfer complete
</file3>
<stripfile3>
</file2>
<stripfile2>
s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/
</stripfile3>
<file4 name="log/name1354">
</file4>
</stripfile2>
</verify>
</testcase>

View File

@ -54,10 +54,7 @@ fooo
mooo
</file1>
<file2 name="log/heads1355">
</file2>
<file3 name="log/stdout1355">
<file2 name="log/stdout1355">
220- _ _ ____ _
220- ___| | | | _ \| |
220- / __| | | | |_) | |
@ -72,13 +69,10 @@ mooo
213 10
150 Binary data connection for 1355 () (10 bytes).
226 File transfer complete
</file3>
<stripfile3>
</file2>
<stripfile2>
s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/
</stripfile3>
<file4 name="log/name1355">
</file4>
</stripfile2>
</verify>
</testcase>

View 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>

View 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>

View 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- _ _ ____ _
220- ___| | | | _ \| |
220- / __| | | | |_) | |
@ -87,13 +87,10 @@ MOOOO
213 214
150 Binary data connection for 1358 () (214 bytes).
226 File transfer complete
</file3>
<stripfile3>
</file2>
<stripfile2>
s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/
</stripfile3>
<file4 name="log/name1358">
</file4>
</stripfile2>
</verify>
</testcase>

View 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>

View 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- _ _ ____ _
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'
</file3>
<stripfile3>
</file2>
<stripfile2>
s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/
</stripfile3>
<file4 name="log/name1360">
</file4>
</stripfile2>
</verify>
</testcase>

View 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>

View 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- _ _ ____ _
220- ___| | | | _ \| |
220- / __| | | | |_) | |
@ -87,13 +87,10 @@ MOOOO
213 214
150 Binary data connection for 1362 () (214 bytes).
226 File transfer complete
</file3>
<stripfile3>
</file2>
<stripfile2>
s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/
</stripfile3>
<file4 name="log/name1362">
</file4>
</stripfile2>
</verify>
</testcase>

View 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- _ _ ____ _
220- ___| | | | _ \| |
220- / __| | | | |_) | |
@ -87,13 +87,10 @@ MOOOO
213 214
150 Binary data connection for 1363 () (214 bytes).
226 File transfer complete
</file3>
<stripfile3>
</file2>
<stripfile2>
s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/
</stripfile3>
<file4 name="log/name1363">
</file4>
</stripfile2>
</verify>
</testcase>

View 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@

15
tests/libtest/notexists.pl Executable file
View File

@ -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;