quickjs-tart

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

test654 (2194B)


      1 <testcase>
      2 <info>
      3 <keywords>
      4 HTTP
      5 HTTP POST
      6 HTTP MIME POST
      7 </keywords>
      8 </info>
      9 
     10 #
     11 # Server-side
     12 <reply>
     13 <data>
     14 HTTP/1.1 200 OK
     15 Date: Tue, 09 Nov 2010 14:49:00 GMT
     16 Server: test-server/fake swsclose
     17 Connection: close
     18 Content-Type: text/html
     19 
     20 hello
     21 </data>
     22 <datacheck>
     23 HTTP/1.1 200 OK
     24 Date: Tue, 09 Nov 2010 14:49:00 GMT
     25 Server: test-server/fake swsclose
     26 Connection: close
     27 Content-Type: text/html
     28 
     29 hello
     30 HTTP/1.1 200 OK
     31 Date: Tue, 09 Nov 2010 14:49:00 GMT
     32 Server: test-server/fake swsclose
     33 Connection: close
     34 Content-Type: text/html
     35 
     36 hello
     37 </datacheck>
     38 </reply>
     39 
     40 # Client-side
     41 <client>
     42 <features>
     43 Mime
     44 </features>
     45 <server>
     46 http
     47 </server>
     48 # tool is what to use instead of 'curl'
     49 <tool>
     50 lib%TESTNUMBER
     51 </tool>
     52 
     53 <name>
     54 HTTP duplicate easy handle with mime data
     55 </name>
     56 <command>
     57 http://%HOSTIP:%HTTPPORT/%TESTNUMBER %LOGDIR/file%TESTNUMBER.txt
     58 </command>
     59 <file name="%LOGDIR/file%TESTNUMBER.txt">
     60 This is data from a file
     61 </file>
     62 </client>
     63 
     64 #
     65 # Verify data after the test has been "shot"
     66 <verify>
     67 <strippart>
     68 s/^--------------------------[A-Za-z0-9]*/------------------------------/
     69 s/boundary=------------------------[A-Za-z0-9]*/boundary=----------------------------/
     70 </strippart>
     71 # Note that the stripping above removes 12 bytes from every occurrence of the
     72 # boundary string and since 5 of them are in the body contents, we see
     73 # (5*12) == 60 bytes less
     74 <protocol>
     75 POST /%TESTNUMBER HTTP/1.1
     76 Host: %HOSTIP:%HTTPPORT
     77 Accept: */*
     78 Content-Length: 0
     79 
     80 POST /%TESTNUMBER HTTP/1.1
     81 Host: %HOSTIP:%HTTPPORT
     82 Accept: */*
     83 Transfer-Encoding: chunked
     84 Content-Type: multipart/form-data; boundary=----------------------------
     85 Expect: 100-continue
     86 
     87 1c1
     88 ------------------------------
     89 Content-Disposition: form-data; name="greeting"
     90 Content-Type: application/X-Greeting
     91 Content-Transfer-Encoding: base64
     92 X-Test-Number: %TESTNUMBER
     93 
     94 aGVsbG8=
     95 ------------------------------
     96 Content-Disposition: form-data; filename="file%TESTNUMBER.txt"
     97 Content-Type: text/plain
     98 
     99 This is data from a file
    100 
    101 ------------------------------
    102 Content-Disposition: form-data
    103 
    104 
    105 1
    106 d
    107 1
    108 u
    109 1
    110 m
    111 1
    112 m
    113 1
    114 y
    115 1
    116 
    117 
    118 36
    119 
    120 --------------------------------
    121 
    122 0
    123 
    124 </protocol>
    125 </verify>
    126 </testcase>