From 6a35841b2edcbd865e914ec33ea0568199a26a8a Mon Sep 17 00:00:00 2001 From: Dan Fandrich Date: Mon, 23 Apr 2007 23:00:38 +0000 Subject: Added tests 610-612 to test more SFTP post-quote commands. --- tests/data/Makefile.am | 2 +- tests/data/test610 | 47 +++++++++++++++++++++++++++++++++++++++++++++++ tests/data/test611 | 47 +++++++++++++++++++++++++++++++++++++++++++++++ tests/data/test612 | 47 +++++++++++++++++++++++++++++++++++++++++++++++ tests/libtest/test610.pl | 24 ++++++++++++++++++++++++ 5 files changed, 166 insertions(+), 1 deletion(-) create mode 100644 tests/data/test610 create mode 100644 tests/data/test611 create mode 100644 tests/data/test612 create mode 100755 tests/libtest/test610.pl (limited to 'tests') diff --git a/tests/data/Makefile.am b/tests/data/Makefile.am index c877d5782..e28f38afb 100644 --- a/tests/data/Makefile.am +++ b/tests/data/Makefile.am @@ -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 diff --git a/tests/data/test610 b/tests/data/test610 new file mode 100644 index 000000000..b81acaeb4 --- /dev/null +++ b/tests/data/test610 @@ -0,0 +1,47 @@ + + + +SFTP +post-quote + + + +# +# Server-side + + +Dummy test file for rmdir test + + + +# +# Client-side + + +sftp + + +perl %SRCDIR/libtest/test610.pl mkdir %PWD/log/test610.dir + + +SFTP post-quote rmdir + + +--key curl_client_key --pubkey curl_client_key.pub -u %USER: -Q "-rmdir %PWD/log/test610.dir" sftp://%HOSTIP:%SSHPORT%PWD/log/file610.txt + + +perl %SRCDIR/libtest/test610.pl gone %PWD/log/test610.dir + + +Dummy test file for rmdir test + + + +# +# Verify data after the test has been "shot" + + +disable + + + diff --git a/tests/data/test611 b/tests/data/test611 new file mode 100644 index 000000000..0016edc32 --- /dev/null +++ b/tests/data/test611 @@ -0,0 +1,47 @@ + + + +SFTP +post-quote + + + +# +# Server-side + + +Dummy test file for rename test + + + +# +# Client-side + + +sftp + + +perl %SRCDIR/libtest/test610.pl mkdir %PWD/log/test611.dir + + +SFTP post-quote rename + + +--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 + + +perl %SRCDIR/libtest/test610.pl rmdir %PWD/log/test611.new + + +Dummy test file for rename test + + + +# +# Verify data after the test has been "shot" + + +disable + + + diff --git a/tests/data/test612 b/tests/data/test612 new file mode 100644 index 000000000..972656a23 --- /dev/null +++ b/tests/data/test612 @@ -0,0 +1,47 @@ + + + +SFTP +post-quote + + + +# +# Server-side + + +Dummy test file for remove test + + + +# +# Client-side + + +sftp + + +SFTP post-quote remove file + + +--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 + + +perl %SRCDIR/libtest/test610.pl gone %PWD/log/test612.txt + + +Dummy test file for remove test + + + +# +# Verify data after the test has been "shot" + + +Dummy test file for remove test + + +disable + + + diff --git a/tests/libtest/test610.pl b/tests/libtest/test610.pl new file mode 100755 index 000000000..5d7c1f6aa --- /dev/null +++ b/tests/libtest/test610.pl @@ -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; -- cgit v1.2.3