quickjs-tart

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

test8 (2911B)


      1 <testcase>
      2 <info>
      3 <keywords>
      4 HTTP
      5 HTTP GET
      6 cookies
      7 </keywords>
      8 </info>
      9 # Server-side
     10 <reply>
     11 <data>
     12 HTTP/1.1 200 OK swsclose
     13 Date: Tue, 09 Nov 2010 14:49:00 GMT
     14 Server: test-server/fake
     15 
     16 </data>
     17 </reply>
     18 
     19 # Client-side
     20 <client>
     21 <server>
     22 http
     23 </server>
     24 <name>
     25 HTTP with cookie parsing from header file
     26 </name>
     27 <command>
     28 http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER -b %LOGDIR/heads%TESTNUMBER.txt
     29 </command>
     30 
     31 # We create this file before the command is invoked!
     32 <file name="%LOGDIR/heads%TESTNUMBER.txt">
     33 HTTP/1.1 200 OK
     34 Date: Tue, 09 Nov 2010 14:49:00 GMT
     35 Server: test-server/fake
     36 Content-Type: text/html
     37 Funny-head: yesyes
     38 Set-Cookie: foobar=name; domain=%HOSTIP; path=/;
     39 Set-Cookie: mismatch=this; domain=%HOSTIP; path="/silly/";
     40 Set-Cookie: partmatch=present; domain=.0.0.1; path=/w;
     41 Set-Cookie: duplicate=test; domain=.0.0.1; domain=.0.0.1; path=/donkey;
     42 Set-Cookie: cookie=yes; path=/we;
     43 Set-Cookie: cookie=perhaps; path=/we/want;
     44 Set-Cookie: name with space=is weird but; path=/we/want;
     45 Set-Cookie: trailingspace    = removed; path=/we/want;
     46 Set-Cookie: nocookie=yes; path=/WE;
     47 Set-Cookie: blexp=yesyes; domain=%HOSTIP; domain=%HOSTIP; expiry=totally bad;
     48 Set-Cookie: partialip=nono; domain=.0.0.1;
     49 Set-Cookie: cookie1=%hex[%01-junk]hex%
     50 Set-Cookie: cookie2=%hex[%02-junk]hex%
     51 Set-Cookie: cookie3=%hex[%03-junk]hex%
     52 Set-Cookie: cookie4=%hex[%04-junk]hex%
     53 Set-Cookie: cookie5=%hex[%05-junk]hex%
     54 Set-Cookie: cookie6=%hex[%06-junk]hex%
     55 Set-Cookie: cookie7=%hex[%07-junk]hex%
     56 Set-Cookie: cookie8=%hex[%08-junk]hex%
     57 Set-Cookie: cookie9=%hex[junk--%09]hex%
     58 Set-Cookie: cookie11=%hex[%0b-junk]hex%
     59 Set-Cookie: cookie12=%hex[%0c-junk]hex%
     60 Set-Cookie: cookie14=%hex[%0e-junk]hex%
     61 Set-Cookie: cookie15=%hex[%0f-junk]hex%
     62 Set-Cookie: cookie16=%hex[%10-junk]hex%
     63 Set-Cookie: cookie17=%hex[%11-junk]hex%
     64 Set-Cookie: cookie18=%hex[%12-junk]hex%
     65 Set-Cookie: cookie19=%hex[%13-junk]hex%
     66 Set-Cookie: cookie20=%hex[%14-junk]hex%
     67 Set-Cookie: cookie21=%hex[%15-junk]hex%
     68 Set-Cookie: cookie22=%hex[%16-junk]hex%
     69 Set-Cookie: cookie23=%hex[%17-junk]hex%
     70 Set-Cookie: cookie24=%hex[%18-junk]hex%
     71 Set-Cookie: cookie25=%hex[%19-junk]hex%
     72 Set-Cookie: cookie26=%hex[%1a-junk]hex%
     73 Set-Cookie: cookie27=%hex[%1b-junk]hex%
     74 Set-Cookie: cookie28=%hex[%1c-junk]hex%
     75 Set-Cookie: cookie29=%hex[%1d-junk]hex%
     76 Set-Cookie: cookie30=%hex[%1e-junk]hex%
     77 Set-Cookie: cookie31=%hex[%1f-junk]hex%
     78 Set-Cookie: cookie31=%hex[%7f-junk]hex%
     79 
     80 </file>
     81 <precheck>
     82 %PERL -e 'if("%HOSTIP" !~ /\.0\.0\.1$/) {print "Test only works for HOSTIPs ending with .0.0.1"; exit(1)}'
     83 </precheck>
     84 <features>
     85 cookies
     86 </features>
     87 </client>
     88 
     89 # Verify data after the test has been "shot"
     90 <verify>
     91 <protocol>
     92 GET /we/want/%TESTNUMBER HTTP/1.1
     93 Host: %HOSTIP:%HTTPPORT
     94 User-Agent: curl/%VERSION
     95 Accept: */*
     96 Cookie: name with space=is weird but; trailingspace=removed; cookie=perhaps; cookie=yes; foobar=name; blexp=yesyes; cookie9=junk--
     97 
     98 </protocol>
     99 </verify>
    100 </testcase>