quickjs-tart

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

test506 (7443B)


      1 <testcase>
      2 <info>
      3 <keywords>
      4 HTTP
      5 HTTP GET
      6 cookies
      7 shared cookies
      8 </keywords>
      9 </info>
     10 
     11 # Server-side
     12 <reply>
     13 <data1>
     14 HTTP/1.1 200 OK
     15 Date: Tue, 09 Nov 2010 14:49:00 GMT
     16 Server: test-server/fake
     17 Content-Type: text/html
     18 Set-Cookie: test1=one; domain=foo.com; expires=Sat Feb 2 11:56:27 GMT 2030
     19 Set-Cookie: test2=two; domain=host.foo.com; expires=Sat Feb 2 11:56:27 GMT 2030
     20 Set-Cookie: test3=three; domain=foo.com; expires=Sat Feb 2 11:56:27 GMT 2030
     21 Content-Length: 29
     22 
     23 run 1: set cookie 1, 2 and 3
     24 </data1>
     25 <data2>
     26 HTTP/1.1 200 OK
     27 Date: Tue, 09 Nov 2010 14:49:01 GMT
     28 Server: test-server/fake
     29 Content-Type: text/html
     30 Set-Cookie: test4=four; domain=host.foo.com; expires=Sat Feb 2 11:56:27 GMT 2030
     31 Set-Cookie: test5=five; domain=host.foo.com; expires=Sat Feb 2 11:56:27 GMT 2030
     32 Content-Length: 26
     33 
     34 run 2: set cookie 4 and 5
     35 </data2>
     36 <data3>
     37 HTTP/1.1 200 OK
     38 Date: Tue, 09 Nov 2010 14:49:02 GMT
     39 Server: test-server/fake
     40 Content-Type: text/html
     41 Funny-head: yesyes
     42 Set-Cookie: test4=overwritten4; domain=host.foo.com; expires=Sat May 5 GMT 11:56:27 2035
     43 Set-Cookie: test1=overwritten1; domain=foo.com; expires=Thu Mar 3 GMT 11:56:27 2033
     44 Set-Cookie: test6=six; domain=.www.host.foo.com; expires=Thu Mar 3 GMT 11:56:27 2033
     45 Set-Cookie: test6=six_more; expires=Thu Mar 3 GMT 11:56:27 2033
     46 Content-Type: text/html
     47 Content-Length: 73
     48 
     49 run 3: overwrite cookie 1 and 4, set cookie 6 with and without tailmatch
     50 </data3>
     51 </reply>
     52 
     53 # Client-side
     54 <client>
     55 <server>
     56 http
     57 </server>
     58 # don't run this with the threaded-resolver or c-ares since the events might
     59 # trigger in a different order!
     60 <features>
     61 !threaded-resolver
     62 !c-ares
     63 </features>
     64 <name>
     65 HTTP with shared cookie list (and dns cache)
     66 </name>
     67 # Explicitly set the time zone to a known good one, in case the user is
     68 # using one of the 'right' zones that take into account leap seconds
     69 # which causes the cookie expiry times to be different.
     70 <setenv>
     71 TZ=GMT
     72 </setenv>
     73 <tool>
     74 lib%TESTNUMBER
     75 </tool>
     76 <command>
     77 http://%HOSTIP:%HTTPPORT/%TESTNUMBER %LOGDIR/jar%TESTNUMBER
     78 </command>
     79 </client>
     80 
     81 # Verify data after the test has been "shot"
     82 <verify>
     83 <stdout>
     84 GLOBAL_INIT
     85 SHARE_INIT
     86 CURLSHOPT_LOCKFUNC
     87 CURLSHOPT_UNLOCKFUNC
     88 CURLSHOPT_USERDATA
     89 CURL_LOCK_DATA_COOKIE
     90 CURL_LOCK_DATA_DNS
     91 CURLOPT_SHARE
     92 lock:   share  [Pigs in space]: 0
     93 unlock: share  [Pigs in space]: 1
     94 CURLOPT_COOKIELIST injected_and_clobbered
     95 lock:   cookie [Pigs in space]: 2
     96 unlock: cookie [Pigs in space]: 3
     97 CURLOPT_COOKIELIST ALL
     98 lock:   cookie [Pigs in space]: 4
     99 unlock: cookie [Pigs in space]: 5
    100 CURLOPT_COOKIELIST session
    101 lock:   cookie [Pigs in space]: 6
    102 unlock: cookie [Pigs in space]: 7
    103 CURLOPT_COOKIELIST injected
    104 lock:   cookie [Pigs in space]: 8
    105 unlock: cookie [Pigs in space]: 9
    106 CURLOPT_COOKIELIST SESS
    107 lock:   cookie [Pigs in space]: 10
    108 unlock: cookie [Pigs in space]: 11
    109 CLEANUP
    110 lock:   cookie [Pigs in space]: 12
    111 unlock: cookie [Pigs in space]: 13
    112 lock:   share  [Pigs in space]: 14
    113 unlock: share  [Pigs in space]: 15
    114 *** run 1
    115 CURLOPT_SHARE
    116 lock:   share  [Pigs in space]: 16
    117 unlock: share  [Pigs in space]: 17
    118 PERFORM
    119 lock:   cookie [Pigs in space]: 18
    120 unlock: cookie [Pigs in space]: 19
    121 lock:   dns    [Pigs in space]: 20
    122 unlock: dns    [Pigs in space]: 21
    123 lock:   dns    [Pigs in space]: 22
    124 unlock: dns    [Pigs in space]: 23
    125 lock:   cookie [Pigs in space]: 24
    126 unlock: cookie [Pigs in space]: 25
    127 lock:   cookie [Pigs in space]: 26
    128 unlock: cookie [Pigs in space]: 27
    129 lock:   cookie [Pigs in space]: 28
    130 unlock: cookie [Pigs in space]: 29
    131 lock:   cookie [Pigs in space]: 30
    132 unlock: cookie [Pigs in space]: 31
    133 run 1: set cookie 1, 2 and 3
    134 lock:   dns    [Pigs in space]: 32
    135 unlock: dns    [Pigs in space]: 33
    136 lock:   dns    [Pigs in space]: 34
    137 unlock: dns    [Pigs in space]: 35
    138 CLEANUP
    139 lock:   cookie [Pigs in space]: 36
    140 unlock: cookie [Pigs in space]: 37
    141 lock:   share  [Pigs in space]: 38
    142 unlock: share  [Pigs in space]: 39
    143 *** run 2
    144 CURLOPT_SHARE
    145 lock:   share  [Pigs in space]: 40
    146 unlock: share  [Pigs in space]: 41
    147 PERFORM
    148 lock:   cookie [Pigs in space]: 42
    149 unlock: cookie [Pigs in space]: 43
    150 lock:   dns    [Pigs in space]: 44
    151 unlock: dns    [Pigs in space]: 45
    152 lock:   cookie [Pigs in space]: 46
    153 unlock: cookie [Pigs in space]: 47
    154 lock:   cookie [Pigs in space]: 48
    155 unlock: cookie [Pigs in space]: 49
    156 lock:   cookie [Pigs in space]: 50
    157 unlock: cookie [Pigs in space]: 51
    158 run 2: set cookie 4 and 5
    159 lock:   dns    [Pigs in space]: 52
    160 unlock: dns    [Pigs in space]: 53
    161 lock:   dns    [Pigs in space]: 54
    162 unlock: dns    [Pigs in space]: 55
    163 CLEANUP
    164 lock:   cookie [Pigs in space]: 56
    165 unlock: cookie [Pigs in space]: 57
    166 lock:   share  [Pigs in space]: 58
    167 unlock: share  [Pigs in space]: 59
    168 *** run 3
    169 CURLOPT_SHARE
    170 lock:   share  [Pigs in space]: 60
    171 unlock: share  [Pigs in space]: 61
    172 CURLOPT_COOKIEJAR
    173 CURLOPT_COOKIELIST FLUSH
    174 lock:   cookie [Pigs in space]: 62
    175 unlock: cookie [Pigs in space]: 63
    176 PERFORM
    177 lock:   dns    [Pigs in space]: 64
    178 unlock: dns    [Pigs in space]: 65
    179 lock:   cookie [Pigs in space]: 66
    180 unlock: cookie [Pigs in space]: 67
    181 lock:   cookie [Pigs in space]: 68
    182 unlock: cookie [Pigs in space]: 69
    183 lock:   cookie [Pigs in space]: 70
    184 unlock: cookie [Pigs in space]: 71
    185 lock:   cookie [Pigs in space]: 72
    186 unlock: cookie [Pigs in space]: 73
    187 lock:   cookie [Pigs in space]: 74
    188 unlock: cookie [Pigs in space]: 75
    189 run 3: overwrite cookie 1 and 4, set cookie 6 with and without tailmatch
    190 lock:   dns    [Pigs in space]: 76
    191 unlock: dns    [Pigs in space]: 77
    192 lock:   dns    [Pigs in space]: 78
    193 unlock: dns    [Pigs in space]: 79
    194 CLEANUP
    195 lock:   cookie [Pigs in space]: 80
    196 unlock: cookie [Pigs in space]: 81
    197 lock:   share  [Pigs in space]: 82
    198 unlock: share  [Pigs in space]: 83
    199 CURLOPT_SHARE
    200 lock:   share  [Pigs in space]: 84
    201 unlock: share  [Pigs in space]: 85
    202 CURLOPT_COOKIELIST ALL
    203 lock:   cookie [Pigs in space]: 86
    204 unlock: cookie [Pigs in space]: 87
    205 CURLOPT_COOKIEJAR
    206 CURLOPT_COOKIELIST RELOAD
    207 lock:   cookie [Pigs in space]: 88
    208 unlock: cookie [Pigs in space]: 89
    209 lock:   cookie [Pigs in space]: 90
    210 unlock: cookie [Pigs in space]: 91
    211 loaded cookies:
    212 -----------------
    213   www.host.foo.com	FALSE	/	FALSE	%days[400]	test6	six_more
    214   .www.host.foo.com	TRUE	/	FALSE	%days[400]	test6	six
    215   .host.foo.com	TRUE	/	FALSE	%days[400]	test5	five
    216   .host.foo.com	TRUE	/	FALSE	%days[400]	test4	overwritten4
    217   .foo.com	TRUE	/	FALSE	%days[400]	test3	three
    218   .host.foo.com	TRUE	/	FALSE	%days[400]	test2	two
    219   .foo.com	TRUE	/	FALSE	%days[400]	test1	overwritten1
    220   .host.foo.com	TRUE	/	FALSE	%days[400]	injected	yes
    221 -----------------
    222 try SHARE_CLEANUP...
    223 lock:   share  [Pigs in space]: 92
    224 unlock: share  [Pigs in space]: 93
    225 SHARE_CLEANUP failed, correct
    226 CLEANUP
    227 lock:   cookie [Pigs in space]: 94
    228 unlock: cookie [Pigs in space]: 95
    229 lock:   share  [Pigs in space]: 96
    230 unlock: share  [Pigs in space]: 97
    231 SHARE_CLEANUP
    232 lock:   share  [Pigs in space]: 98
    233 unlock: share  [Pigs in space]: 99
    234 GLOBAL_CLEANUP
    235 </stdout>
    236 <file name="%LOGDIR/jar%TESTNUMBER" mode="text">
    237 # Netscape HTTP Cookie File
    238 # https://curl.se/docs/http-cookies.html
    239 # This file was generated by libcurl! Edit at your own risk.
    240 
    241 www.host.foo.com	FALSE	/	FALSE	%days[400]	test6	six_more
    242 .www.host.foo.com	TRUE	/	FALSE	%days[400]	test6	six
    243 .host.foo.com	TRUE	/	FALSE	%days[400]	test5	five
    244 .host.foo.com	TRUE	/	FALSE	%days[400]	test4	overwritten4
    245 .foo.com	TRUE	/	FALSE	%days[400]	test3	three
    246 .host.foo.com	TRUE	/	FALSE	%days[400]	test2	two
    247 .foo.com	TRUE	/	FALSE	%days[400]	test1	overwritten1
    248 .host.foo.com	TRUE	/	FALSE	%days[400]	injected	yes
    249 </file>
    250 </verify>
    251 </testcase>