2012-02-23 17:48:46 +08:00
|
|
|
<testcase>
|
2014-03-23 20:30:02 +08:00
|
|
|
# Based on test851
|
2012-02-23 17:48:46 +08:00
|
|
|
<info>
|
|
|
|
<keywords>
|
|
|
|
POP3
|
2014-03-30 22:09:55 +08:00
|
|
|
Clear Text
|
2012-02-23 17:48:46 +08:00
|
|
|
LIST
|
|
|
|
--libcurl
|
|
|
|
</keywords>
|
|
|
|
</info>
|
|
|
|
|
|
|
|
#
|
|
|
|
# Server-side
|
|
|
|
<reply>
|
|
|
|
<servercmd>
|
2021-03-13 00:38:26 +08:00
|
|
|
REPLY LIST +OK %TESTNUMBER 100\r\n.
|
2012-02-23 17:48:46 +08:00
|
|
|
</servercmd>
|
|
|
|
</reply>
|
|
|
|
|
|
|
|
#
|
|
|
|
# Client-side
|
|
|
|
<client>
|
|
|
|
<server>
|
|
|
|
pop3
|
|
|
|
</server>
|
|
|
|
<name>
|
2014-03-23 20:16:40 +08:00
|
|
|
--libcurl for POP3 LIST one message
|
2012-02-23 17:48:46 +08:00
|
|
|
</name>
|
2017-03-13 05:33:56 +08:00
|
|
|
<setenv>
|
|
|
|
SSL_CERT_FILE=
|
|
|
|
</setenv>
|
|
|
|
<command>
|
2021-03-13 00:38:26 +08:00
|
|
|
pop3://%HOSTIP:%POP3PORT/%TESTNUMBER -l -u user:secret --libcurl log/test%TESTNUMBER.c
|
2012-02-23 17:48:46 +08:00
|
|
|
</command>
|
|
|
|
</client>
|
|
|
|
|
|
|
|
#
|
|
|
|
# Verify data after the test has been "shot"
|
|
|
|
<verify>
|
|
|
|
<protocol>
|
2012-06-05 04:34:06 +08:00
|
|
|
CAPA
|
2012-02-24 06:13:42 +08:00
|
|
|
USER user
|
|
|
|
PASS secret
|
2021-03-13 00:38:26 +08:00
|
|
|
LIST %TESTNUMBER
|
2012-02-24 06:13:42 +08:00
|
|
|
QUIT
|
2012-02-23 17:48:46 +08:00
|
|
|
</protocol>
|
2021-03-13 00:38:26 +08:00
|
|
|
<file name="log/test%TESTNUMBER.c" mode="text">
|
2012-02-23 17:48:46 +08:00
|
|
|
/********* Sample code generated by the curl command line tool **********
|
|
|
|
* All curl_easy_setopt() options are documented at:
|
2020-11-04 21:02:01 +08:00
|
|
|
* https://curl.se/libcurl/c/curl_easy_setopt.html
|
2012-02-23 17:48:46 +08:00
|
|
|
************************************************************************/
|
|
|
|
#include <curl/curl.h>
|
|
|
|
|
|
|
|
int main(int argc, char *argv[])
|
|
|
|
{
|
|
|
|
CURLcode ret;
|
|
|
|
CURL *hnd;
|
|
|
|
|
|
|
|
hnd = curl_easy_init();
|
2017-04-24 18:03:08 +08:00
|
|
|
curl_easy_setopt(hnd, CURLOPT_BUFFERSIZE, 102400L);
|
2021-03-13 00:38:26 +08:00
|
|
|
curl_easy_setopt(hnd, CURLOPT_URL, "pop3://%HOSTIP:%POP3PORT/%TESTNUMBER");
|
2012-02-23 17:48:46 +08:00
|
|
|
curl_easy_setopt(hnd, CURLOPT_DIRLISTONLY, 1L);
|
|
|
|
curl_easy_setopt(hnd, CURLOPT_USERPWD, "user:secret");
|
|
|
|
curl_easy_setopt(hnd, CURLOPT_VERBOSE, 1L);
|
2020-11-24 21:56:57 +08:00
|
|
|
curl_easy_setopt(hnd, CURLOPT_FTP_SKIP_PASV_IP, 1L);
|
2012-02-23 17:48:46 +08:00
|
|
|
curl_easy_setopt(hnd, CURLOPT_TCP_KEEPALIVE, 1L);
|
|
|
|
|
|
|
|
/* Here is a list of options the curl code used that cannot get generated
|
2021-10-01 22:57:00 +08:00
|
|
|
as source easily. You may choose to either not use them or implement
|
2012-02-23 17:48:46 +08:00
|
|
|
them yourself.
|
|
|
|
|
|
|
|
CURLOPT_WRITEDATA set to a objectpointer
|
|
|
|
CURLOPT_WRITEFUNCTION set to a functionpointer
|
|
|
|
CURLOPT_READDATA set to a objectpointer
|
|
|
|
CURLOPT_READFUNCTION set to a functionpointer
|
|
|
|
CURLOPT_SEEKDATA set to a objectpointer
|
|
|
|
CURLOPT_SEEKFUNCTION set to a functionpointer
|
|
|
|
CURLOPT_ERRORBUFFER set to a objectpointer
|
|
|
|
CURLOPT_STDERR set to a objectpointer
|
|
|
|
CURLOPT_DEBUGFUNCTION set to a functionpointer
|
|
|
|
CURLOPT_DEBUGDATA set to a objectpointer
|
2012-05-25 16:33:28 +08:00
|
|
|
CURLOPT_HEADERFUNCTION set to a functionpointer
|
|
|
|
CURLOPT_HEADERDATA set to a objectpointer
|
2012-02-23 17:48:46 +08:00
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
ret = curl_easy_perform(hnd);
|
|
|
|
|
|
|
|
curl_easy_cleanup(hnd);
|
|
|
|
hnd = NULL;
|
|
|
|
|
|
|
|
return (int)ret;
|
|
|
|
}
|
|
|
|
/**** End of sample code ****/
|
|
|
|
</file>
|
|
|
|
<stripfile>
|
2017-03-21 04:39:27 +08:00
|
|
|
# These options vary with configurations - just ignore them
|
2019-05-14 16:03:54 +08:00
|
|
|
# CURLOPT_INTERLEAVEDATA requires RTSP (HTTP) protocol
|
2017-03-21 04:39:27 +08:00
|
|
|
$_ = '' if /CURLOPT_USERAGENT/
|
|
|
|
$_ = '' if /CURLOPT_MAXREDIRS/
|
2012-02-23 17:48:46 +08:00
|
|
|
$_ = '' if /CURLOPT_SSL_VERIFYPEER/
|
2012-02-24 06:13:42 +08:00
|
|
|
$_ = '' if /CURLOPT_SSH_KNOWNHOSTS/
|
2015-12-13 16:24:08 +08:00
|
|
|
$_ = '' if /CURLOPT_HTTP_VERSION/
|
2018-12-17 22:46:56 +08:00
|
|
|
$_ = '' if /CURLOPT_HTTP09_ALLOWED/
|
2019-05-14 16:03:54 +08:00
|
|
|
$_ = '' if /CURLOPT_INTERLEAVEDATA/
|
2012-02-23 17:48:46 +08:00
|
|
|
</stripfile>
|
|
|
|
</verify>
|
|
|
|
</testcase>
|