test1407 (2773B)
1 <testcase> 2 # Based on test851 3 <info> 4 <keywords> 5 POP3 6 Clear Text 7 LIST 8 --libcurl 9 </keywords> 10 </info> 11 12 # 13 # Server-side 14 <reply> 15 <servercmd> 16 REPLY LIST +OK %TESTNUMBER 100\r\n. 17 </servercmd> 18 </reply> 19 20 # 21 # Client-side 22 <client> 23 <server> 24 pop3 25 </server> 26 <name> 27 --libcurl for POP3 LIST one message 28 </name> 29 <setenv> 30 SSL_CERT_FILE= 31 </setenv> 32 <command> 33 pop3://%HOSTIP:%POP3PORT/%TESTNUMBER -l -u user:secret --libcurl %LOGDIR/test%TESTNUMBER.c 34 </command> 35 # Need ftp so the FTP options are written in the --libcurl template 36 <features> 37 ftp 38 --libcurl 39 </features> 40 </client> 41 42 # 43 # Verify data after the test has been "shot" 44 <verify> 45 <protocol> 46 CAPA 47 USER user 48 PASS secret 49 LIST %TESTNUMBER 50 QUIT 51 </protocol> 52 <file name="%LOGDIR/test%TESTNUMBER.c" mode="text"> 53 /********* Sample code generated by the curl command line tool ********** 54 * All curl_easy_setopt() options are documented at: 55 * https://curl.se/libcurl/c/curl_easy_setopt.html 56 ************************************************************************/ 57 #include <curl/curl.h> 58 59 int main(int argc, char *argv[]) 60 { 61 CURLcode ret; 62 CURL *hnd; 63 64 hnd = curl_easy_init(); 65 curl_easy_setopt(hnd, CURLOPT_VERBOSE, 1L); 66 curl_easy_setopt(hnd, CURLOPT_BUFFERSIZE, 102400L); 67 curl_easy_setopt(hnd, CURLOPT_URL, "pop3://%HOSTIP:%POP3PORT/%TESTNUMBER"); 68 curl_easy_setopt(hnd, CURLOPT_DIRLISTONLY, 1L); 69 curl_easy_setopt(hnd, CURLOPT_USERPWD, "user:secret"); 70 curl_easy_setopt(hnd, CURLOPT_TCP_KEEPALIVE, 1L); 71 72 /* Here is a list of options the curl code used that cannot get generated 73 as source easily. You may choose to either not use them or implement 74 them yourself. 75 76 CURLOPT_DEBUGFUNCTION was set to a function pointer 77 CURLOPT_DEBUGDATA was set to an object pointer 78 CURLOPT_WRITEDATA was set to an object pointer 79 CURLOPT_WRITEFUNCTION was set to a function pointer 80 CURLOPT_READDATA was set to an object pointer 81 CURLOPT_READFUNCTION was set to a function pointer 82 CURLOPT_SEEKDATA was set to an object pointer 83 CURLOPT_SEEKFUNCTION was set to a function pointer 84 CURLOPT_HEADERFUNCTION was set to a function pointer 85 CURLOPT_HEADERDATA was set to an object pointer 86 CURLOPT_ERRORBUFFER was set to an object pointer 87 CURLOPT_STDERR was set to an object pointer 88 89 */ 90 91 ret = curl_easy_perform(hnd); 92 93 curl_easy_cleanup(hnd); 94 hnd = NULL; 95 96 return (int)ret; 97 } 98 /**** End of sample code ****/ 99 </file> 100 <stripfile> 101 # These options vary with configurations - just ignore them 102 # CURLOPT_INTERLEAVEDATA requires RTSP (HTTP) protocol 103 $_ = '' if /CURLOPT_USERAGENT/ 104 $_ = '' if /CURLOPT_MAXREDIRS/ 105 $_ = '' if /CURLOPT_SSL_VERIFYPEER/ 106 $_ = '' if /CURLOPT_SSH_KNOWNHOSTS/ 107 $_ = '' if /CURLOPT_HTTP_VERSION/ 108 $_ = '' if /CURLOPT_HTTP09_ALLOWED/ 109 $_ = '' if /CURLOPT_INTERLEAVEDATA/ 110 </stripfile> 111 </verify> 112 </testcase>