]> granicus.if.org Git - curl/commitdiff
sftp-multi: test 582 added
authorHenry Ludemann <henry@hl.id.au>
Mon, 7 Mar 2011 23:19:49 +0000 (00:19 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 7 Mar 2011 23:20:48 +0000 (00:20 +0100)
Add test 582 for uploading a file using sftp and the multi interface.

(Patch and test slightly tweaked by Daniel Stenberg)

Initially marked as disabled until it is fixed in the source.

tests/data/DISABLED
tests/data/Makefile.am
tests/data/test582 [new file with mode: 0644]
tests/libtest/Makefile.inc
tests/libtest/test.h

index b6071cbd91b1ff847c1ec9a420057b233ed43246..2485e89b9c906b43671b6d84504eff876201bcc8 100644 (file)
@@ -3,3 +3,7 @@
 # per line.
 # Lines starting with '#' letters are treated as comments.
 564
+# Disabled due to a bug with uploading to an SFTP server using the multi
+# interface. Easy work around; always pass 0 as the evBitmask to force CURL
+# to re-evaluate the socket status.
+582
index aa060ed1a70375f630e7b77395b2822777f58f51..3a76a288d801664836cd9e52750eb393eaf1d934 100644 (file)
@@ -70,7 +70,7 @@ EXTRA_DIST = test1 test108 test117 test127 test20 test27 test34 test46           \
  test313 test1115 test578 test579 test1116 test1200 test1201 test1202     \
  test1203 test1117 test1118 test1119 test1120 test1300 test1301 test1302 \
  test1303 test320 test321 test322 test323 test324 test1121 test581 test580 \
- test1304 test1305 test1306 test1307
+ test1304 test1305 test1306 test1307 test582
 
 filecheck:
        @mkdir test-place; \
diff --git a/tests/data/test582 b/tests/data/test582
new file mode 100644 (file)
index 0000000..8881a87
--- /dev/null
@@ -0,0 +1,46 @@
+<testcase>
+<info>
+<keywords>
+SFTP
+multi
+</keywords>
+</info>
+
+# Server-side
+<reply>
+<data>
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+sftp
+</server>
+<tool>
+lib582
+</tool>
+ <name>
+SFTP upload using multi interface
+ </name>
+ <command>
+Sftp://%HOSTIP:%SSHPORT%PWD/log/upload582.txt %PWD/log/file582.txt %USER:
+</command>
+<file name="log/file582.txt">
+Moooooooooooo
+ upload this
+</file>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<strip>
+</strip>
+<protocol>
+</protocol>
+<file name="log/file582.txt">
+Moooooooooooo
+ upload this
+</file>
+</verify>
+</testcase>
index 5fb9fad6fc8b0fce5d054cb8e20843761550aa2f..c68f5af525fbfc2edef2e12717687ad1a422bb7f 100644 (file)
@@ -12,7 +12,7 @@ noinst_PROGRAMS = lib500 lib501 lib502 lib503 lib504 lib505 lib506    \
   lib529 lib530 lib532 lib533 lib536 lib537 lib540 lib541 lib542 lib543 \
   lib544 lib545 lib547 lib548 lib549 lib552 lib553 lib554 lib555 lib556 \
   lib539 lib557 lib560 lib562 lib564 lib565 lib566 lib567 \
-  lib568 lib569 lib570 lib571 lib572 lib573 chkhostname
+  lib568 lib569 lib570 lib571 lib572 lib573 lib582 chkhostname
 
 chkhostname_SOURCES = chkhostname.c $(top_srcdir)/lib/curl_gethostname.c
 chkhostname_LDADD = @CURL_NETWORK_LIBS@
@@ -157,3 +157,5 @@ lib578_SOURCES = lib578.c $(SUPPORTFILES)
 
 lib579_SOURCES = lib579.c $(SUPPORTFILES)
 
+lib582_SOURCES = lib582.c $(SUPPORTFILES) $(TESTUTIL)
+
index 2a3671181f9cf1cedb983bc32afa581ea442e14b..d5a099e2515a7834fb89a65e2edd1f07c3ebdc79 100644 (file)
@@ -44,6 +44,9 @@
 #define test_setopt(A,B,C) \
   if((res = curl_easy_setopt((A),(B),(C))) != CURLE_OK) goto test_cleanup
 
+#define test_multi_setopt(A,B,C) \
+  if((res = curl_multi_setopt((A),(B),(C))) != CURLE_OK) goto test_cleanup
+
 extern char *libtest_arg2; /* set by first.c to the argv[2] or NULL */
 extern char *libtest_arg3; /* set by first.c to the argv[3] or NULL */