quickjs-tart

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

test2100 (2781B)


      1 <testcase>
      2 <info>
      3 <keywords>
      4 HTTP
      5 HTTP GET
      6 DOH
      7 </keywords>
      8 </info>
      9 
     10 #
     11 # Server-side
     12 <reply>
     13 
     14 # This is the DoH response for foo.example.com A 127.0.0.1. This requires that
     15 # the test server is accessible at that address!
     16 
     17 <data1 base64="yes">
     18 SFRUUC8xLjEgMjAwIE9LCkRhdGU6IFRodSwgMDkgTm92IDIwMTAgMTQ6NDk6MDAgR01UClNlcnZl
     19 cjogdGVzdC1zZXJ2ZXIvZmFrZQpDb25uZWN0aW9uOiBjbG9zZQpDb250ZW50LVR5cGU6IGFwcGxp
     20 Y2F0aW9uL2Rucy1tZXNzYWdlCkNvbnRlbnQtTGVuZ3RoOiA0OQoKAAABAAABAAEAAAAAA2Zvbwdl
     21 eGFtcGxlA2NvbQAAAQABwAwAAQABAAAANwAEfwAAAQ==
     22 </data1>
     23 <data>
     24 HTTP/1.1 200 OK
     25 Date: Tue, 09 Nov 2010 14:49:00 GMT
     26 Server: test-server/fake
     27 Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
     28 ETag: "21025-dc7-39462498"
     29 Accept-Ranges: bytes
     30 Content-Length: 6
     31 Connection: close
     32 Content-Type: text/html
     33 Funny-head: yesyes
     34 
     35 -foo-
     36 </data>
     37 </reply>
     38 
     39 #
     40 # Client-side
     41 <client>
     42 <server>
     43 http
     44 </server>
     45 
     46 # requires debug so that it can use the DoH server without https
     47 # requires IPv6 so that we can assume and compare both DoH requests
     48 
     49 <features>
     50 Debug
     51 DoH
     52 IPv6
     53 </features>
     54 <name>
     55 HTTP GET using DoH (with HTTPS RR)
     56 </name>
     57 <command>
     58 http://foo.example.com:%HTTPPORT/%TESTNUMBER --doh-url http://%HOSTIP:%HTTPPORT/%TESTNUMBER0001
     59 </command>
     60 </client>
     61 
     62 #
     63 # Verify data after the test has been "shot"
     64 <verify>
     65 
     66 # To make the test ignore the order of the two outgoing DoH requests, strip
     67 # the family byte
     68 
     69 <strippart>
     70 s/com\x00\x00(\x1c|\x01)/com-00-00!/g;
     71 </strippart>
     72 <protocol>
     73 %if HTTPSRR
     74 POST /%TESTNUMBER0001 HTTP/1.1
     75 Host: %HOSTIP:%HTTPPORT
     76 Accept: */*
     77 Content-Type: application/dns-message
     78 Content-Length: 33
     79 
     80 %hex[%00%00%01%00%00%01%00%00%00%00%00%00%03foo%07example%03com-00-00!%00%01]hex%POST /%TESTNUMBER0001 HTTP/1.1
     81 Host: %HOSTIP:%HTTPPORT
     82 Accept: */*
     83 Content-Type: application/dns-message
     84 Content-Length: 33
     85 
     86 %hex[%00%00%01%00%00%01%00%00%00%00%00%00%03foo%07example%03com-00-00!%00%01]hex%POST /%TESTNUMBER0001 HTTP/1.1
     87 Host: %HOSTIP:%HTTPPORT
     88 Accept: */*
     89 Content-Type: application/dns-message
     90 Content-Length: 47
     91 
     92 %hex[%00%00%01%00%00%01%00%00%00%00%00%00%06_%HTTPPORT%06_https%03foo%07example%03com%00%00A%00%01]hex%GET /%TESTNUMBER HTTP/1.1
     93 Host: foo.example.com:%HTTPPORT
     94 User-Agent: curl/%VERSION
     95 Accept: */*
     96 
     97 %else
     98 POST /%TESTNUMBER0001 HTTP/1.1
     99 Host: %HOSTIP:%HTTPPORT
    100 Accept: */*
    101 Content-Type: application/dns-message
    102 Content-Length: 33
    103 
    104 %hex[%00%00%01%00%00%01%00%00%00%00%00%00%03foo%07example%03com-00-00!%00%01]hex%POST /%TESTNUMBER0001 HTTP/1.1
    105 Host: %HOSTIP:%HTTPPORT
    106 Accept: */*
    107 Content-Type: application/dns-message
    108 Content-Length: 33
    109 
    110 %hex[%00%00%01%00%00%01%00%00%00%00%00%00%03foo%07example%03com-00-00!%00%01]hex%GET /%TESTNUMBER HTTP/1.1
    111 Host: foo.example.com:%HTTPPORT
    112 User-Agent: curl/%VERSION
    113 Accept: */*
    114 
    115 %endif
    116 </protocol>
    117 </verify>
    118 </testcase>