quickjs-tart

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

test2700 (1395B)


      1 <testcase>
      2 <info>
      3 <keywords>
      4 WebSockets
      5 </keywords>
      6 </info>
      7 
      8 <client>
      9 <name>
     10 ws: Frame types
     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 #   A TEXT/BINARY/PING/PONG/CLOSE message with payload
     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[%81%03txt]hex%%hex[%82%03bin]hex%%hex[%89%04ping]hex%%hex[%8a%04pong]hex%%hex[%88%07%03%e8close]hex%
     45 </data>
     46 </reply>
     47 
     48 <verify>
     49 
     50 # Exact echo of reply data with additional masking
     51 <protocol nonewline="yes">
     52 %hex[%81%83%00%00%00%00txt]hex%%hex[%82%83%00%00%00%00bin]hex%%hex[%89%84%00%00%00%00ping]hex%%hex[%8a%84%00%00%00%00pong]hex%%hex[%88%87%00%00%00%00%03%e8close]hex%
     53 </protocol>
     54 
     55 # PING is handled by lib and never given to application
     56 <stdout>
     57 txt fin [3] txt
     58 bin fin [3] bin
     59 ping [4] ping
     60 pong [4] pong
     61 close [7] %hex[%03%e8]hex%close
     62 </stdout>
     63 
     64 # CURLE_OK
     65 <errorcode>
     66 0
     67 </errorcode>
     68 
     69 # Strip HTTP header from <protocol>
     70 <strip>
     71 ^GET /.*
     72 ^(Host|User-Agent|Accept|Upgrade|Connection|Sec-WebSocket-(Version|Key)): .*
     73 ^\s*$
     74 </strip>
     75 </verify>
     76 </testcase>