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
159lock:   cookie [Pigs in space]: 55
160unlock: cookie [Pigs in space]: 56
161unlock: cookie [Pigs in space]: 57
162PERFORM
163lock:   dns    [Pigs in space]: 58
164unlock: dns    [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
169lock:   cookie [Pigs in space]: 64
170unlock: cookie [Pigs in space]: 65
171run 3: overwrite cookie 1 and 4
172lock:   dns    [Pigs in space]: 66
173unlock: dns    [Pigs in space]: 67
174try SHARE_CLEANUP...
175lock:   share  [Pigs in space]: 68
176unlock: share  [Pigs in space]: 69
177SHARE_CLEANUP failed, correct
178CLEANUP
179lock:   cookie [Pigs in space]: 70
180unlock: cookie [Pigs in space]: 71
181lock:   share  [Pigs in space]: 72
182unlock: share  [Pigs in space]: 73
183SHARE_CLEANUP
184lock:   share  [Pigs in space]: 74
185unlock: share  [Pigs in space]: 75
186GLOBAL_CLEANUP
187</stdout>
188<stderr>
189http://%HOSTIP:%HTTPPORT/506 
190</stderr>
191<file name="log/jar506" mode="text">
192# Netscape HTTP Cookie File
193# http://curl.haxx.se/docs/http-cookies.html
194# This file was generated by libcurl! Edit at your own risk.
195
196.host.foo.com	TRUE	/	FALSE	1896263787	injected	yes
197.foo.com	TRUE	/	FALSE	1993463787	test1	overwritten1
198.host.foo.com	TRUE	/	FALSE	1896263787	test2	two
199.foo.com	TRUE	/	FALSE	1896263787	test3	three
200.host.foo.com	TRUE	/	FALSE	2061978987	test4	overwritten4
201.host.foo.com	TRUE	/	FALSE	1896263787	test5	five
202</file>
203</verify>
204</testcase>
205