Added tests 622-625 to test SFTP/SCP uploads. Test 625 was an attempt to
reproduce the --ftp-create-dirs problem reported by Brian Ulm, but that seems to need a call curl_easy_reset() which this test case doesn't do.
This commit is contained in:
5
CHANGES
5
CHANGES
@@ -6,6 +6,11 @@
|
|||||||
|
|
||||||
Changelog
|
Changelog
|
||||||
|
|
||||||
|
Daniel Fandrich (13 Mar 2008)
|
||||||
|
- Added tests 622-625 to test SFTP/SCP uploads. Test 625 was an attempt to
|
||||||
|
reproduce the --ftp-create-dirs problem reported by Brian Ulm, but that
|
||||||
|
seems to need a call curl_easy_reset() which this test case doesn't do.
|
||||||
|
|
||||||
Daniel Stenberg (13 Mar 2008)
|
Daniel Stenberg (13 Mar 2008)
|
||||||
- Brian Ulm figured out that if you did an SFTP upload with
|
- Brian Ulm figured out that if you did an SFTP upload with
|
||||||
CURLOPT_FTP_CREATE_MISSING_DIRS to create a directory, and then re-used the
|
CURLOPT_FTP_CREATE_MISSING_DIRS to create a directory, and then re-used the
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ EXTRA_DIST = test1 test108 test117 test127 test20 test27 test34 test46 \
|
|||||||
test546 test1013 test1014 test1015 test547 test548 test549 test550 \
|
test546 test1013 test1014 test1015 test547 test548 test549 test550 \
|
||||||
test551 test552 test1016 test1017 test1018 test1019 test1020 test553 \
|
test551 test552 test1016 test1017 test1018 test1019 test1020 test553 \
|
||||||
test1021 test1022 test1023 test309 test616 test617 test618 test619 \
|
test1021 test1022 test1023 test309 test616 test617 test618 test619 \
|
||||||
test620 test621
|
test620 test621 test622 test623 test624 test625
|
||||||
|
|
||||||
filecheck:
|
filecheck:
|
||||||
@mkdir test-place; \
|
@mkdir test-place; \
|
||||||
|
|||||||
43
tests/data/test622
Normal file
43
tests/data/test622
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
<testcase>
|
||||||
|
<info>
|
||||||
|
<keywords>
|
||||||
|
SFTP
|
||||||
|
SFTP put
|
||||||
|
FAILURE
|
||||||
|
</keywords>
|
||||||
|
</info>
|
||||||
|
|
||||||
|
#
|
||||||
|
# Server-side
|
||||||
|
<reply>
|
||||||
|
</reply>
|
||||||
|
|
||||||
|
#
|
||||||
|
# Client-side
|
||||||
|
<client>
|
||||||
|
<server>
|
||||||
|
sftp
|
||||||
|
</server>
|
||||||
|
<name>
|
||||||
|
SFTP put failure
|
||||||
|
</name>
|
||||||
|
<command>
|
||||||
|
--key curl_client_key --pubkey curl_client_key.pub -u %USER: -T log/file622.txt sftp://%HOSTIP:%SSHPORT%PWD/log/nonexistent-directory/nonexistent-file
|
||||||
|
</command>
|
||||||
|
<file name="log/file622.txt">
|
||||||
|
Test data
|
||||||
|
for ssh upload test
|
||||||
|
</file>
|
||||||
|
</client>
|
||||||
|
|
||||||
|
#
|
||||||
|
# Verify data after the test has been "shot"
|
||||||
|
<verify>
|
||||||
|
<errorcode>
|
||||||
|
78
|
||||||
|
</errorcode>
|
||||||
|
<valgrind>
|
||||||
|
disable
|
||||||
|
</valgrind>
|
||||||
|
</verify>
|
||||||
|
</testcase>
|
||||||
43
tests/data/test623
Normal file
43
tests/data/test623
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
<testcase>
|
||||||
|
<info>
|
||||||
|
<keywords>
|
||||||
|
SCP
|
||||||
|
SCP upload
|
||||||
|
FAILURE
|
||||||
|
</keywords>
|
||||||
|
</info>
|
||||||
|
|
||||||
|
#
|
||||||
|
# Server-side
|
||||||
|
<reply>
|
||||||
|
</reply>
|
||||||
|
|
||||||
|
#
|
||||||
|
# Client-side
|
||||||
|
<client>
|
||||||
|
<server>
|
||||||
|
scp
|
||||||
|
</server>
|
||||||
|
<name>
|
||||||
|
SCP upload failure
|
||||||
|
</name>
|
||||||
|
<command>
|
||||||
|
--key curl_client_key --pubkey curl_client_key.pub -u %USER: -T log/file623.txt scp://%HOSTIP:%SSHPORT%PWD/log/nonexistent-directory/nonexistent-file
|
||||||
|
</command>
|
||||||
|
<file name="log/file623.txt">
|
||||||
|
Test data
|
||||||
|
for ssh upload test
|
||||||
|
</file>
|
||||||
|
</client>
|
||||||
|
|
||||||
|
#
|
||||||
|
# Verify data after the test has been "shot"
|
||||||
|
<verify>
|
||||||
|
<errorcode>
|
||||||
|
79
|
||||||
|
</errorcode>
|
||||||
|
<valgrind>
|
||||||
|
disable
|
||||||
|
</valgrind>
|
||||||
|
</verify>
|
||||||
|
</testcase>
|
||||||
47
tests/data/test624
Normal file
47
tests/data/test624
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
<testcase>
|
||||||
|
<info>
|
||||||
|
<keywords>
|
||||||
|
SFTP
|
||||||
|
SFTP put
|
||||||
|
--ftp-create-dirs
|
||||||
|
</keywords>
|
||||||
|
</info>
|
||||||
|
|
||||||
|
#
|
||||||
|
# Server-side
|
||||||
|
<reply>
|
||||||
|
</reply>
|
||||||
|
|
||||||
|
#
|
||||||
|
# Client-side
|
||||||
|
<client>
|
||||||
|
<server>
|
||||||
|
sftp
|
||||||
|
</server>
|
||||||
|
<name>
|
||||||
|
SFTP put with --ftp-create-dirs
|
||||||
|
</name>
|
||||||
|
<command>
|
||||||
|
--ftp-create-dirs --key curl_client_key --pubkey curl_client_key.pub -u %USER: -T log/file624.txt sftp://%HOSTIP:%SSHPORT%PWD/log/test624.dir/upload.624
|
||||||
|
</command>
|
||||||
|
<postcheck>
|
||||||
|
perl %SRCDIR/libtest/test610.pl move %PWD/log/test624.dir/upload.624 %PWD/log/upload.624 rmdir %PWD/log/test624.dir
|
||||||
|
</postcheck>
|
||||||
|
<file name="log/file624.txt">
|
||||||
|
Test data
|
||||||
|
for ssh upload test
|
||||||
|
</file>
|
||||||
|
</client>
|
||||||
|
|
||||||
|
#
|
||||||
|
# Verify data after the test has been "shot"
|
||||||
|
<verify>
|
||||||
|
<upload>
|
||||||
|
Test data
|
||||||
|
for ssh upload test
|
||||||
|
</upload>
|
||||||
|
<valgrind>
|
||||||
|
disable
|
||||||
|
</valgrind>
|
||||||
|
</verify>
|
||||||
|
</testcase>
|
||||||
47
tests/data/test625
Normal file
47
tests/data/test625
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
<testcase>
|
||||||
|
<info>
|
||||||
|
<keywords>
|
||||||
|
SFTP
|
||||||
|
SFTP put
|
||||||
|
--ftp-create-dirs
|
||||||
|
</keywords>
|
||||||
|
</info>
|
||||||
|
|
||||||
|
#
|
||||||
|
# Server-side
|
||||||
|
<reply>
|
||||||
|
</reply>
|
||||||
|
|
||||||
|
#
|
||||||
|
# Client-side
|
||||||
|
<client>
|
||||||
|
<server>
|
||||||
|
sftp
|
||||||
|
</server>
|
||||||
|
<name>
|
||||||
|
SFTP put with --ftp-create-dirs twice
|
||||||
|
</name>
|
||||||
|
<command>
|
||||||
|
--ftp-create-dirs --key curl_client_key --pubkey curl_client_key.pub -u %USER: -T log/file625.txt sftp://%HOSTIP:%SSHPORT%PWD/log/test625.a/upload.625 -T log/file625.txt sftp://%HOSTIP:%SSHPORT%PWD/log/test625.b/upload.625
|
||||||
|
</command>
|
||||||
|
<postcheck>
|
||||||
|
perl %SRCDIR/libtest/test610.pl move %PWD/log/test625.a/upload.625 %PWD/log/upload.625 rmdir %PWD/log/test625.a rm %PWD/log/test625.b/upload.625 rmdir %PWD/log/test625.b
|
||||||
|
</postcheck>
|
||||||
|
<file name="log/file625.txt">
|
||||||
|
Test data
|
||||||
|
for ssh upload test
|
||||||
|
</file>
|
||||||
|
</client>
|
||||||
|
|
||||||
|
#
|
||||||
|
# Verify data after the test has been "shot"
|
||||||
|
<verify>
|
||||||
|
<upload>
|
||||||
|
Test data
|
||||||
|
for ssh upload test
|
||||||
|
</upload>
|
||||||
|
<valgrind>
|
||||||
|
disable
|
||||||
|
</valgrind>
|
||||||
|
</verify>
|
||||||
|
</testcase>
|
||||||
@@ -1,24 +1,33 @@
|
|||||||
#!/usr/bin/env perl
|
#!/usr/bin/env perl
|
||||||
# Create and remove directories and check their existence
|
# Perform simple file and directory manipulation in a portable way
|
||||||
if ( $#ARGV != 1 )
|
if ( $#ARGV <= 0 )
|
||||||
{
|
{
|
||||||
print "Usage: $0 mkdir|rmdir|gone path\n";
|
print "Usage: $0 mkdir|rmdir|unlink|move|gone path1 [path2] [more commands...]\n";
|
||||||
exit 1;
|
exit 1;
|
||||||
}
|
}
|
||||||
if ($ARGV[0] eq "mkdir")
|
|
||||||
{
|
use File::Copy;
|
||||||
mkdir $ARGV[1] || die "$!";
|
while(@ARGV) {
|
||||||
exit 0;
|
my $cmd = shift @ARGV;
|
||||||
|
my $arg = shift @ARGV;
|
||||||
|
if ($cmd eq "mkdir") {
|
||||||
|
mkdir $arg || die "$!";
|
||||||
|
}
|
||||||
|
elsif ($cmd eq "rmdir") {
|
||||||
|
rmdir $arg || die "$!";
|
||||||
|
}
|
||||||
|
elsif ($cmd eq "rm") {
|
||||||
|
unlink $arg || die "$!";
|
||||||
|
}
|
||||||
|
elsif ($cmd eq "move") {
|
||||||
|
my $arg2 = shift @ARGV;
|
||||||
|
move($arg,$arg2) || die "$!";
|
||||||
|
}
|
||||||
|
elsif ($cmd eq "gone") {
|
||||||
|
! -e $arg || die "Path $arg exists";
|
||||||
|
} else {
|
||||||
|
print "Unsupported command $cmd\n";
|
||||||
|
exit 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
elsif ($ARGV[0] eq "rmdir")
|
exit 0;
|
||||||
{
|
|
||||||
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;
|
|
||||||
|
|||||||
Reference in New Issue
Block a user