quickjs-tart

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

test2304 (1215B)


      1 <testcase>
      2 <info>
      3 <keywords>
      4 WebSockets
      5 </keywords>
      6 </info>
      7 
      8 #
      9 # Close connection during websocket upgrade
     10 <reply>
     11 <data nocheck="yes" nonewline="yes">
     12 HTTP/1.1 101 Switching to WebSockets swsclose
     13 Server: test-server/fake
     14 Upgrade: websocket
     15 Connection: Upgrade
     16 Something: else
     17 Sec-WebSocket-Accept: HkPsVga7+8LuxM4RGQ5p9tZHeYs=
     18 
     19 </data>
     20 # allow upgrade
     21 <servercmd>
     22 upgrade
     23 </servercmd>
     24 </reply>
     25 
     26 #
     27 # Client-side
     28 <client>
     29 # require debug for the forced CURL_ENTROPY
     30 <features>
     31 Debug
     32 ws
     33 </features>
     34 <server>
     35 http
     36 </server>
     37 <name>
     38 WebSockets curl_ws_recv() with closed connection
     39 </name>
     40 <tool>
     41 lib%TESTNUMBER
     42 </tool>
     43 <command>
     44 ws://%HOSTIP:%HTTPPORT/%TESTNUMBER
     45 </command>
     46 </client>
     47 
     48 #
     49 # PONG with no data and the 32 bit mask
     50 #
     51 <verify>
     52 <protocol nocheck="yes" crlf="yes">
     53 GET /%TESTNUMBER HTTP/1.1
     54 Host: %HOSTIP:%HTTPPORT
     55 User-Agent: websocket/%TESTNUMBER
     56 Accept: */*
     57 Upgrade: websocket
     58 Connection: Upgrade
     59 Sec-WebSocket-Version: 13
     60 Sec-WebSocket-Key: NDMyMTUzMjE2MzIxNzMyMQ==
     61 
     62 </protocol>
     63 
     64 # This test used to check that "connection closed" was output, but
     65 # that is flaky since the outgoing PING just before might fail already
     66 # and then the test exists before the output gets to be written
     67 </verify>
     68 </testcase>