quickjs-tart

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

test2719 (1675B)


      1 <testcase>
      2 <info>
      3 <keywords>
      4 WebSockets
      5 </keywords>
      6 </info>
      7 
      8 <client>
      9 <name>
     10 ws: Fragmented messages
     11 </name>
     12 <features>
     13 Debug
     14 ws
     15 </features>
     16 <server>
     17 http
     18 </server>
     19 <tool>
     20 lib2700
     21 </tool>
     22 <command>
     23 ws://%HOSTIP:%HTTPPORT/%TESTNUMBER
     24 </command>
     25 <setenv>
     26 CURL_WS_FORCE_ZERO_MASK=1
     27 </setenv>
     28 </client>
     29 
     30 <reply>
     31 <servercmd>
     32 upgrade
     33 </servercmd>
     34 
     35 # Full list of frames: see <verify.stdout> below
     36 #   Fragmented TEXT/BINARY messages, each with 2/3 fragments
     37 <data nocheck="yes" nonewline="yes">
     38 HTTP/1.1 101 Switching to WebSockets
     39 Server: server/%TESTNUMBER
     40 Upgrade: Websocket
     41 Connection: Upgrade
     42 Sec-WebSocket-Accept: HkPsVga7+8LuxM4RGQ5p9tZHeYs=
     43 
     44 %hex[%01%02t1]hex%%hex[%80%02t2]hex%%hex[%01%02t1]hex%%hex[%00%02t2]hex%%hex[%80%02t3]hex%%hex[%02%02b1]hex%%hex[%80%02b2]hex%%hex[%02%02b1]hex%%hex[%00%02b2]hex%%hex[%80%02b3]hex%%hex[%88%00]hex%
     45 </data>
     46 </reply>
     47 
     48 <verify>
     49 
     50 # Exact echo of reply data with additional masking
     51 <protocol nonewline="yes">
     52 %hex[%01%82%00%00%00%00t1]hex%%hex[%80%82%00%00%00%00t2]hex%%hex[%01%82%00%00%00%00t1]hex%%hex[%00%82%00%00%00%00t2]hex%%hex[%80%82%00%00%00%00t3]hex%%hex[%02%82%00%00%00%00b1]hex%%hex[%80%82%00%00%00%00b2]hex%%hex[%02%82%00%00%00%00b1]hex%%hex[%00%82%00%00%00%00b2]hex%%hex[%80%82%00%00%00%00b3]hex%%hex[%88%80%00%00%00%00]hex%
     53 </protocol>
     54 
     55 <stdout>
     56 txt --- [2] t1
     57 txt fin [2] t2
     58 txt --- [2] t1
     59 txt --- [2] t2
     60 txt fin [2] t3
     61 bin --- [2] b1
     62 bin fin [2] b2
     63 bin --- [2] b1
     64 bin --- [2] b2
     65 bin fin [2] b3
     66 close [0]
     67 </stdout>
     68 
     69 # CURLE_OK
     70 <errorcode>
     71 0
     72 </errorcode>
     73 
     74 # Strip HTTP header from <protocol>
     75 <strip>
     76 ^GET /.*
     77 ^(Host|User-Agent|Accept|Upgrade|Connection|Sec-WebSocket-(Version|Key)): .*
     78 ^\s*$
     79 </strip>
     80 </verify>
     81 </testcase>