quickjs-tart

quickjs-based runtime for wallet-core logic
Log | Files | Refs | README | LICENSE

test1420 (2781B)


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