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