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