summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/data/Makefile.am2
-rw-r--r--tests/data/test61047
-rw-r--r--tests/data/test61147
-rw-r--r--tests/data/test61247
-rwxr-xr-xtests/libtest/test610.pl24
5 files changed, 166 insertions, 1 deletions
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 @@
+<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>
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 @@
+<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>
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 @@
+<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>
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;