aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Fandrich <dan@coneharvesters.com>2007-04-23 23:00:38 +0000
committerDan Fandrich <dan@coneharvesters.com>2007-04-23 23:00:38 +0000
commit6a35841b2edcbd865e914ec33ea0568199a26a8a (patch)
treeb2bcac094797fa087165fc1007687f2afe83a299
parent28dde78dde21f20ab5ee491455828c3cf338ad5c (diff)
Added tests 610-612 to test more SFTP post-quote commands.
-rw-r--r--CHANGES5
-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
6 files changed, 171 insertions, 1 deletions
diff --git a/CHANGES b/CHANGES
index a22131418..cc224be03 100644
--- a/CHANGES
+++ b/CHANGES
@@ -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.
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;