test1405 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. <testcase>
  2. # Derived from test227
  3. <info>
  4. <keywords>
  5. FTP
  6. post-quote
  7. pre-quote
  8. quote
  9. --libcurl
  10. </keywords>
  11. </info>
  12. # Server-side
  13. <reply>
  14. <data>
  15. data
  16. to
  17. see
  18. that FTP
  19. works
  20. so does it?
  21. </data>
  22. <servercmd>
  23. REPLY EPSV 500 no such command
  24. REPLY FAIL 500 this might not be a failure!
  25. </servercmd>
  26. </reply>
  27. # Client-side
  28. <client>
  29. <server>
  30. ftp
  31. </server>
  32. <name>
  33. FTP with quote ops
  34. </name>
  35. <command>
  36. ftp://%HOSTIP:%FTPPORT/1405 -Q "NOOP 1" -Q "+NOOP 2" -Q "-NOOP 3" -Q "*FAIL" -Q "+*FAIL HARD" --libcurl log/test1405.c
  37. </command>
  38. </client>
  39. # Verify data after the test has been "shot"
  40. <verify>
  41. <protocol>
  42. USER anonymous
  43. PASS ftp@example.com
  44. PWD
  45. NOOP 1
  46. FAIL
  47. EPSV
  48. PASV
  49. TYPE I
  50. NOOP 2
  51. FAIL HARD
  52. SIZE 1405
  53. RETR 1405
  54. NOOP 3
  55. QUIT
  56. </protocol>
  57. <file name="log/test1405.c" mode="text">
  58. /********* Sample code generated by the curl command line tool **********
  59. * All curl_easy_setopt() options are documented at:
  60. * http://curl.haxx.se/libcurl/c/curl_easy_setopt.html
  61. ************************************************************************/
  62. #include <curl/curl.h>
  63. int main(int argc, char *argv[])
  64. {
  65. CURLcode ret;
  66. CURL *hnd;
  67. struct curl_slist *slist1;
  68. struct curl_slist *slist2;
  69. struct curl_slist *slist3;
  70. slist1 = NULL;
  71. slist1 = curl_slist_append(slist1, "NOOP 1");
  72. slist1 = curl_slist_append(slist1, "*FAIL");
  73. slist2 = NULL;
  74. slist2 = curl_slist_append(slist2, "NOOP 3");
  75. slist3 = NULL;
  76. slist3 = curl_slist_append(slist3, "NOOP 2");
  77. slist3 = curl_slist_append(slist3, "*FAIL HARD");
  78. hnd = curl_easy_init();
  79. curl_easy_setopt(hnd, CURLOPT_URL, "ftp://%HOSTIP:%FTPPORT/1405");
  80. curl_easy_setopt(hnd, CURLOPT_HEADER, 1L);
  81. curl_easy_setopt(hnd, CURLOPT_QUOTE, slist1);
  82. curl_easy_setopt(hnd, CURLOPT_POSTQUOTE, slist2);
  83. curl_easy_setopt(hnd, CURLOPT_PREQUOTE, slist3);
  84. curl_easy_setopt(hnd, CURLOPT_VERBOSE, 1L);
  85. curl_easy_setopt(hnd, CURLOPT_TCP_KEEPALIVE, 1L);
  86. /* Here is a list of options the curl code used that cannot get generated
  87. as source easily. You may select to either not use them or implement
  88. them yourself.
  89. CURLOPT_WRITEDATA set to a objectpointer
  90. CURLOPT_WRITEFUNCTION set to a functionpointer
  91. CURLOPT_READDATA set to a objectpointer
  92. CURLOPT_READFUNCTION set to a functionpointer
  93. CURLOPT_SEEKDATA set to a objectpointer
  94. CURLOPT_SEEKFUNCTION set to a functionpointer
  95. CURLOPT_ERRORBUFFER set to a objectpointer
  96. CURLOPT_STDERR set to a objectpointer
  97. CURLOPT_DEBUGFUNCTION set to a functionpointer
  98. CURLOPT_DEBUGDATA set to a objectpointer
  99. CURLOPT_HEADERFUNCTION set to a functionpointer
  100. CURLOPT_HEADERDATA set to a objectpointer
  101. */
  102. ret = curl_easy_perform(hnd);
  103. curl_easy_cleanup(hnd);
  104. hnd = NULL;
  105. curl_slist_free_all(slist1);
  106. slist1 = NULL;
  107. curl_slist_free_all(slist2);
  108. slist2 = NULL;
  109. curl_slist_free_all(slist3);
  110. slist3 = NULL;
  111. return (int)ret;
  112. }
  113. /**** End of sample code ****/
  114. </file>
  115. <stripfile>
  116. # CURLOPT_USERAGENT and CURLOPT_MAXREDIRS requires HTTP protocol
  117. # support, IOW depends on configuration - just ignore these.
  118. $_ = '' if /CURLOPT_USERAGENT/
  119. $_ = '' if /CURLOPT_MAXREDIRS/
  120. # CURLOPT_SSL_VERIFYPEER and SSH_KNOWNHOSTS vary with configurations - just
  121. # ignore them
  122. $_ = '' if /CURLOPT_SSL_VERIFYPEER/
  123. $_ = '' if /CURLOPT_SSH_KNOWNHOSTS/
  124. </stripfile>
  125. </verify>
  126. </testcase>