Added tests 610-612 to test more SFTP post-quote commands.

This commit is contained in:
Dan Fandrich 2007-04-23 23:00:38 +00:00
parent 28dde78dde
commit 6a35841b2e
6 changed files with 171 additions and 1 deletions

View File

@ -6,6 +6,11 @@
Changelog
Dan F (23 April 2007)
- Added <postcheck> support to the test harness.
- Added tests 610-612 to test more SFTP post-quote commands.
Daniel S (22 April 2007)
- Song Ma's warning if -r/--range is given with a "bad" range, also noted in
the man page now.

View File

@ -40,4 +40,4 @@ EXTRA_DIST = test1 test108 test117 test127 test20 test27 test34 test46 \
test286 test307 test308 test287 test400 test288 test600 test601 test602 \
test603 test401 test402 test290 test291 test292 test293 test403 test404 \
test405 test604 test605 test606 test607 test608 test609 test294 test295 \
test296 test297 test298
test296 test297 test298 test610 test611 test612

47
tests/data/test610 Normal file
View File

@ -0,0 +1,47 @@
<testcase>
<info>
<keywords>
SFTP
post-quote
</keywords>
</info>
#
# Server-side
<reply>
<data>
Dummy test file for rmdir test
</data>
</reply>
#
# Client-side
<client>
<server>
sftp
</server>
<precheck>
perl %SRCDIR/libtest/test610.pl mkdir %PWD/log/test610.dir
</precheck>
<name>
SFTP post-quote rmdir
</name>
<command>
--key curl_client_key --pubkey curl_client_key.pub -u %USER: -Q "-rmdir %PWD/log/test610.dir" sftp://%HOSTIP:%SSHPORT%PWD/log/file610.txt
</command>
<postcheck>
perl %SRCDIR/libtest/test610.pl gone %PWD/log/test610.dir
</postcheck>
<file name="log/file610.txt">
Dummy test file for rmdir test
</file>
</client>
#
# Verify data after the test has been "shot"
<verify>
<valgrind>
disable
</valgrind>
</verify>
</testcase>

47
tests/data/test611 Normal file
View File

@ -0,0 +1,47 @@
<testcase>
<info>
<keywords>
SFTP
post-quote
</keywords>
</info>
#
# Server-side
<reply>
<data>
Dummy test file for rename test
</data>
</reply>
#
# Client-side
<client>
<server>
sftp
</server>
<precheck>
perl %SRCDIR/libtest/test610.pl mkdir %PWD/log/test611.dir
</precheck>
<name>
SFTP post-quote rename
</name>
<command>
--key curl_client_key --pubkey curl_client_key.pub -u %USER: -Q "-rename %PWD/log/test611.dir %PWD/log/test611.new" sftp://%HOSTIP:%SSHPORT%PWD/log/file611.txt
</command>
<postcheck>
perl %SRCDIR/libtest/test610.pl rmdir %PWD/log/test611.new
</postcheck>
<file name="log/file611.txt">
Dummy test file for rename test
</file>
</client>
#
# Verify data after the test has been "shot"
<verify>
<valgrind>
disable
</valgrind>
</verify>
</testcase>

47
tests/data/test612 Normal file
View File

@ -0,0 +1,47 @@
<testcase>
<info>
<keywords>
SFTP
post-quote
</keywords>
</info>
#
# Server-side
<reply>
<data nocheck="1">
Dummy test file for remove test
</data>
</reply>
#
# Client-side
<client>
<server>
sftp
</server>
<name>
SFTP post-quote remove file
</name>
<command>
--key curl_client_key --pubkey curl_client_key.pub -u %USER: -T log/file612.txt -Q "-rm %PWD/log/file612.txt" sftp://%HOSTIP:%SSHPORT%PWD/log/upload.612
</command>
<postcheck>
perl %SRCDIR/libtest/test610.pl gone %PWD/log/test612.txt
</postcheck>
<file name="log/file612.txt">
Dummy test file for remove test
</file>
</client>
#
# Verify data after the test has been "shot"
<verify>
<upload>
Dummy test file for remove test
</upload>
<valgrind>
disable
</valgrind>
</verify>
</testcase>

24
tests/libtest/test610.pl Executable file
View File

@ -0,0 +1,24 @@
#!/usr/bin/env perl
# Create and remove directories and check their existence
if ( $#ARGV != 1 )
{
print "Usage: $0 mkdir|rmdir|gone path\n";
exit 1;
}
if ($ARGV[0] eq "mkdir")
{
mkdir $ARGV[1] || die "$!";
exit 0;
}
elsif ($ARGV[0] eq "rmdir")
{
rmdir $ARGV[1] || die "$!";
exit 0;
}
elsif ($ARGV[0] eq "gone")
{
! -e $ARGV[1] || die "Path $ARGV[1] exists";
exit 0;
}
print "Unsupported command $ARGV[0]\n";
exit 1;