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 mode="text">
76GLOBAL_INIT
77SHARE_INIT
78CURLSHOPT_LOCKFUNC
79CURLSHOPT_UNLOCKFUNC
80CURLSHOPT_USERDATA
81CURL_LOCK_DATA_COOKIE
82CURL_LOCK_DATA_DNS
83*** run 1
84CURLOPT_SHARE
85lock:   share  [Pigs in space]: 0
86unlock: share  [Pigs in space]: 1
87PERFORM
88lock:   dns    [Pigs in space]: 2
89unlock: dns    [Pigs in space]: 3
90lock:   dns    [Pigs in space]: 4
91unlock: dns    [Pigs in space]: 5
92lock:   cookie [Pigs in space]: 6
93unlock: cookie [Pigs in space]: 7
94lock:   cookie [Pigs in space]: 8
95unlock: cookie [Pigs in space]: 9
96lock:   cookie [Pigs in space]: 10
97unlock: cookie [Pigs in space]: 11
98lock:   cookie [Pigs in space]: 12
99unlock: cookie [Pigs in space]: 13
100run 1: set cookie 1, 2 and 3
101lock:   dns    [Pigs in space]: 14
102unlock: dns    [Pigs in space]: 15
103CLEANUP
104lock:   dns    [Pigs in space]: 16
105unlock: dns    [Pigs in space]: 17
106lock:   cookie [Pigs in space]: 18
107unlock: cookie [Pigs in space]: 19
108lock:   share  [Pigs in space]: 20
109unlock: share  [Pigs in space]: 21
110*** run 2
111CURLOPT_SHARE
112lock:   share  [Pigs in space]: 22
113unlock: share  [Pigs in space]: 23
114PERFORM
115lock:   dns    [Pigs in space]: 24
116unlock: dns    [Pigs in space]: 25
117lock:   cookie [Pigs in space]: 26
118unlock: cookie [Pigs in space]: 27
119lock:   cookie [Pigs in space]: 28
120unlock: cookie [Pigs in space]: 29
121lock:   cookie [Pigs in space]: 30
122unlock: cookie [Pigs in space]: 31
123run 2: set cookie 4 and 5
124lock:   dns    [Pigs in space]: 32
125unlock: dns    [Pigs in space]: 33
126CLEANUP
127lock:   dns    [Pigs in space]: 34
128unlock: dns    [Pigs in space]: 35
129lock:   cookie [Pigs in space]: 36
130unlock: cookie [Pigs in space]: 37
131lock:   share  [Pigs in space]: 38
132unlock: share  [Pigs in space]: 39
133*** run 3
134CURLOPT_SHARE
135lock:   share  [Pigs in space]: 40
136unlock: share  [Pigs in space]: 41
137CURLOPT_COOKIEJAR
138PERFORM
139lock:   dns    [Pigs in space]: 42
140unlock: dns    [Pigs in space]: 43
141lock:   cookie [Pigs in space]: 44
142unlock: cookie [Pigs in space]: 45
143lock:   cookie [Pigs in space]: 46
144unlock: cookie [Pigs in space]: 47
145lock:   cookie [Pigs in space]: 48
146unlock: cookie [Pigs in space]: 49
147run 3: overwrite cookie 1 and 4
148lock:   dns    [Pigs in space]: 50
149unlock: dns    [Pigs in space]: 51
150try SHARE_CLEANUP...
151lock:   share  [Pigs in space]: 52
152unlock: share  [Pigs in space]: 53
153SHARE_CLEANUP failed, correct
154CLEANUP
155lock:   dns    [Pigs in space]: 54
156unlock: dns    [Pigs in space]: 55
157lock:   cookie [Pigs in space]: 56
158unlock: cookie [Pigs in space]: 57
159lock:   share  [Pigs in space]: 58
160unlock: share  [Pigs in space]: 59
161SHARE_CLEANUP
162lock:   share  [Pigs in space]: 60
163unlock: share  [Pigs in space]: 61
164GLOBAL_CLEANUP
165</stdout>
166<stderr>
167http://%HOSTIP:%HTTPPORT/506 
168</stderr>
169<file name="log/jar506" mode="text">
170# Netscape HTTP Cookie File
171# http://curl.haxx.se/rfc/cookie_spec.html
172# This file was generated by libcurl! Edit at your own risk.
173
174.foo.com	TRUE	/	FALSE	1993463787	test1	overwritten1
175.host.foo.com	TRUE	/	FALSE	1896263787	test2	two
176.foo.com	TRUE	/	FALSE	1896263787	test3	three
177.host.foo.com	TRUE	/	FALSE	2061978987	test4	overwritten4
178.host.foo.com	TRUE	/	FALSE	1896263787	test5	five
179</file>
180</verify>
181</testcase>
182