Git init
[external/curl.git] / tests / data / test506
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: Thu, 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: Thu, 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: Thu, 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 Content-Type: text/html
45 Content-Length: 32
46
47 run 3: overwrite cookie 1 and 4
48 </data3>
49 </reply>
50
51 # Client-side
52 <client>
53 <server>
54 http
55 </server>
56 <name>
57 HTTP 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>
63 TZ=GMT
64 </setenv>
65 <tool>
66 lib506
67 </tool>
68 <command>
69 http://%HOSTIP:%HTTPPORT/506
70 </command>
71 </client>
72
73 # Verify data after the test has been "shot"
74 <verify>
75 <stdout mode="text">
76 GLOBAL_INIT
77 SHARE_INIT
78 CURLSHOPT_LOCKFUNC
79 CURLSHOPT_UNLOCKFUNC
80 CURLSHOPT_USERDATA
81 CURL_LOCK_DATA_COOKIE
82 CURL_LOCK_DATA_DNS
83 *** run 1
84 CURLOPT_SHARE
85 lock:   share  [Pigs in space]: 0
86 unlock: share  [Pigs in space]: 1
87 PERFORM
88 lock:   dns    [Pigs in space]: 2
89 unlock: dns    [Pigs in space]: 3
90 lock:   dns    [Pigs in space]: 4
91 unlock: dns    [Pigs in space]: 5
92 lock:   cookie [Pigs in space]: 6
93 unlock: cookie [Pigs in space]: 7
94 lock:   cookie [Pigs in space]: 8
95 unlock: cookie [Pigs in space]: 9
96 lock:   cookie [Pigs in space]: 10
97 unlock: cookie [Pigs in space]: 11
98 lock:   cookie [Pigs in space]: 12
99 unlock: cookie [Pigs in space]: 13
100 run 1: set cookie 1, 2 and 3
101 lock:   dns    [Pigs in space]: 14
102 unlock: dns    [Pigs in space]: 15
103 CLEANUP
104 lock:   dns    [Pigs in space]: 16
105 unlock: dns    [Pigs in space]: 17
106 lock:   cookie [Pigs in space]: 18
107 unlock: cookie [Pigs in space]: 19
108 lock:   share  [Pigs in space]: 20
109 unlock: share  [Pigs in space]: 21
110 *** run 2
111 CURLOPT_SHARE
112 lock:   share  [Pigs in space]: 22
113 unlock: share  [Pigs in space]: 23
114 PERFORM
115 lock:   dns    [Pigs in space]: 24
116 unlock: dns    [Pigs in space]: 25
117 lock:   cookie [Pigs in space]: 26
118 unlock: cookie [Pigs in space]: 27
119 lock:   cookie [Pigs in space]: 28
120 unlock: cookie [Pigs in space]: 29
121 lock:   cookie [Pigs in space]: 30
122 unlock: cookie [Pigs in space]: 31
123 run 2: set cookie 4 and 5
124 lock:   dns    [Pigs in space]: 32
125 unlock: dns    [Pigs in space]: 33
126 CLEANUP
127 lock:   dns    [Pigs in space]: 34
128 unlock: dns    [Pigs in space]: 35
129 lock:   cookie [Pigs in space]: 36
130 unlock: cookie [Pigs in space]: 37
131 lock:   share  [Pigs in space]: 38
132 unlock: share  [Pigs in space]: 39
133 *** run 3
134 CURLOPT_SHARE
135 lock:   share  [Pigs in space]: 40
136 unlock: share  [Pigs in space]: 41
137 CURLOPT_COOKIEJAR
138 PERFORM
139 lock:   dns    [Pigs in space]: 42
140 unlock: dns    [Pigs in space]: 43
141 lock:   cookie [Pigs in space]: 44
142 unlock: cookie [Pigs in space]: 45
143 lock:   cookie [Pigs in space]: 46
144 unlock: cookie [Pigs in space]: 47
145 lock:   cookie [Pigs in space]: 48
146 unlock: cookie [Pigs in space]: 49
147 run 3: overwrite cookie 1 and 4
148 lock:   dns    [Pigs in space]: 50
149 unlock: dns    [Pigs in space]: 51
150 try SHARE_CLEANUP...
151 lock:   share  [Pigs in space]: 52
152 unlock: share  [Pigs in space]: 53
153 SHARE_CLEANUP failed, correct
154 CLEANUP
155 lock:   dns    [Pigs in space]: 54
156 unlock: dns    [Pigs in space]: 55
157 lock:   cookie [Pigs in space]: 56
158 unlock: cookie [Pigs in space]: 57
159 lock:   share  [Pigs in space]: 58
160 unlock: share  [Pigs in space]: 59
161 SHARE_CLEANUP
162 lock:   share  [Pigs in space]: 60
163 unlock: share  [Pigs in space]: 61
164 GLOBAL_CLEANUP
165 </stdout>
166 <stderr>
167 http://%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>