test1420 2.5 KB

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