test1420 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. <testcase>
  2. # Based on test800
  3. <info>
  4. <keywords>
  5. IMAP
  6. Clear Text
  7. FETCH
  8. --libcurl
  9. </keywords>
  10. </info>
  11. #
  12. # Server-side
  13. <reply>
  14. <data>
  15. From: me@somewhere
  16. To: fake@nowhere
  17. body
  18. --
  19. yours sincerely
  20. </data>
  21. </reply>
  22. #
  23. # Client-side
  24. <client>
  25. <server>
  26. imap
  27. </server>
  28. <name>
  29. --libcurl for IMAP FETCH message
  30. </name>
  31. <setenv>
  32. SSL_CERT_FILE=
  33. </setenv>
  34. <command>
  35. 'imap://%HOSTIP:%IMAPPORT/%TESTNUMBER/;MAILINDEX=1' -u user:secret --libcurl %LOGDIR/test%TESTNUMBER.c
  36. </command>
  37. # Need ftp so the FTP options are written in the --libcurl template
  38. <features>
  39. ftp
  40. </features>
  41. </client>
  42. #
  43. # Verify data after the test has been "shot"
  44. <verify>
  45. <protocol>
  46. A001 CAPABILITY
  47. A002 LOGIN user secret
  48. A003 SELECT %TESTNUMBER
  49. A004 FETCH 1 BODY[]
  50. A005 LOGOUT
  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. int main(int argc, char *argv[])
  59. {
  60. CURLcode ret;
  61. CURL *hnd;
  62. hnd = curl_easy_init();
  63. curl_easy_setopt(hnd, CURLOPT_BUFFERSIZE, 102400L);
  64. curl_easy_setopt(hnd, CURLOPT_URL, "imap://%HOSTIP:%IMAPPORT/%TESTNUMBER/;MAILINDEX=1");
  65. curl_easy_setopt(hnd, CURLOPT_USERPWD, "user:secret");
  66. curl_easy_setopt(hnd, CURLOPT_VERBOSE, 1L);
  67. curl_easy_setopt(hnd, CURLOPT_FTP_SKIP_PASV_IP, 1L);
  68. curl_easy_setopt(hnd, CURLOPT_TCP_KEEPALIVE, 1L);
  69. /* Here is a list of options the curl code used that cannot get generated
  70. as source easily. You may choose to either not use them or implement
  71. them yourself.
  72. CURLOPT_WRITEDATA was set to an object pointer
  73. CURLOPT_WRITEFUNCTION was set to a function pointer
  74. CURLOPT_READDATA was set to an object pointer
  75. CURLOPT_READFUNCTION was set to a function pointer
  76. CURLOPT_SEEKDATA was set to an object pointer
  77. CURLOPT_SEEKFUNCTION was set to a function pointer
  78. CURLOPT_ERRORBUFFER was set to an object pointer
  79. CURLOPT_STDERR was set to an object pointer
  80. CURLOPT_DEBUGFUNCTION was set to a function pointer
  81. CURLOPT_DEBUGDATA was set to an object pointer
  82. CURLOPT_HEADERFUNCTION was set to a function pointer
  83. CURLOPT_HEADERDATA was set to an object pointer
  84. */
  85. ret = curl_easy_perform(hnd);
  86. curl_easy_cleanup(hnd);
  87. hnd = NULL;
  88. return (int)ret;
  89. }
  90. /**** End of sample code ****/
  91. </file>
  92. <stripfile>
  93. # These options vary with configurations - just ignore them
  94. # CURLOPT_INTERLEAVEDATA requires RTSP (HTTP) protocol
  95. $_ = '' if /CURLOPT_USERAGENT/
  96. $_ = '' if /CURLOPT_MAXREDIRS/
  97. $_ = '' if /CURLOPT_SSL_VERIFYPEER/
  98. $_ = '' if /CURLOPT_SSH_KNOWNHOSTS/
  99. $_ = '' if /CURLOPT_HTTP_VERSION/
  100. $_ = '' if /CURLOPT_INTERLEAVEDATA/
  101. </stripfile>
  102. </verify>
  103. </testcase>