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