test1420 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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/1420/;UID=1' -u user:secret --libcurl log/test1420.c
  36. </command>
  37. </client>
  38. #
  39. # Verify data after the test has been "shot"
  40. <verify>
  41. <protocol>
  42. A001 CAPABILITY
  43. A002 LOGIN user secret
  44. A003 SELECT 1420
  45. A004 FETCH 1 BODY[]
  46. A005 LOGOUT
  47. </protocol>
  48. <file name="log/test1420.c" mode="text">
  49. /********* Sample code generated by the curl command line tool **********
  50. * All curl_easy_setopt() options are documented at:
  51. * https://curl.haxx.se/libcurl/c/curl_easy_setopt.html
  52. ************************************************************************/
  53. #include <curl/curl.h>
  54. int main(int argc, char *argv[])
  55. {
  56. CURLcode ret;
  57. CURL *hnd;
  58. hnd = curl_easy_init();
  59. curl_easy_setopt(hnd, CURLOPT_BUFFERSIZE, 102400L);
  60. curl_easy_setopt(hnd, CURLOPT_URL, "imap://%HOSTIP:%IMAPPORT/1420/;UID=1");
  61. curl_easy_setopt(hnd, CURLOPT_USERPWD, "user:secret");
  62. curl_easy_setopt(hnd, CURLOPT_VERBOSE, 1L);
  63. curl_easy_setopt(hnd, CURLOPT_TCP_KEEPALIVE, 1L);
  64. /* Here is a list of options the curl code used that cannot get generated
  65. as source easily. You may select to either not use them or implement
  66. them yourself.
  67. CURLOPT_WRITEDATA set to a objectpointer
  68. CURLOPT_INTERLEAVEDATA set to a objectpointer
  69. CURLOPT_WRITEFUNCTION set to a functionpointer
  70. CURLOPT_READDATA set to a objectpointer
  71. CURLOPT_READFUNCTION set to a functionpointer
  72. CURLOPT_SEEKDATA set to a objectpointer
  73. CURLOPT_SEEKFUNCTION set to a functionpointer
  74. CURLOPT_ERRORBUFFER set to a objectpointer
  75. CURLOPT_STDERR set to a objectpointer
  76. CURLOPT_DEBUGFUNCTION set to a functionpointer
  77. CURLOPT_DEBUGDATA set to a objectpointer
  78. CURLOPT_HEADERFUNCTION set to a functionpointer
  79. CURLOPT_HEADERDATA set to a objectpointer
  80. */
  81. ret = curl_easy_perform(hnd);
  82. curl_easy_cleanup(hnd);
  83. hnd = NULL;
  84. return (int)ret;
  85. }
  86. /**** End of sample code ****/
  87. </file>
  88. <stripfile>
  89. # These options vary with configurations - just ignore them
  90. $_ = '' if /CURLOPT_USERAGENT/
  91. $_ = '' if /CURLOPT_MAXREDIRS/
  92. $_ = '' if /CURLOPT_SSL_VERIFYPEER/
  93. $_ = '' if /CURLOPT_SSH_KNOWNHOSTS/
  94. $_ = '' if /CURLOPT_HTTP_VERSION/
  95. </stripfile>
  96. </verify>
  97. </testcase>