2007-01-23 10:25:56 +08:00
|
|
|
<testcase>
|
2007-10-12 09:44:22 +08:00
|
|
|
<info>
|
|
|
|
<keywords>
|
|
|
|
HTTP
|
|
|
|
HTTP GET
|
|
|
|
cookies
|
|
|
|
shared cookies
|
|
|
|
</keywords>
|
|
|
|
</info>
|
|
|
|
|
2003-08-11 14:44:46 +08:00
|
|
|
# Server-side
|
|
|
|
<reply>
|
|
|
|
<data1>
|
|
|
|
HTTP/1.1 200 OK
|
|
|
|
Date: Thu, 09 Nov 2010 14:49:00 GMT
|
|
|
|
Server: test-server/fake
|
|
|
|
Content-Type: text/html
|
2007-02-05 10:38:25 +08:00
|
|
|
Set-Cookie: test1=one; domain=foo.com; expires=Sat Feb 2 11:56:27 GMT 2030
|
|
|
|
Set-Cookie: test2=two; domain=host.foo.com; expires=Sat Feb 2 11:56:27 GMT 2030
|
|
|
|
Set-Cookie: test3=three; domain=foo.com; expires=Sat Feb 2 11:56:27 GMT 2030
|
2003-08-11 14:44:46 +08:00
|
|
|
Content-Length: 29
|
|
|
|
|
|
|
|
run 1: set cookie 1, 2 and 3
|
|
|
|
</data1>
|
|
|
|
<data2>
|
|
|
|
HTTP/1.1 200 OK
|
|
|
|
Date: Thu, 09 Nov 2010 14:49:01 GMT
|
|
|
|
Server: test-server/fake
|
|
|
|
Content-Type: text/html
|
2007-02-05 10:38:25 +08:00
|
|
|
Set-Cookie: test4=four; domain=host.foo.com; expires=Sat Feb 2 11:56:27 GMT 2030
|
|
|
|
Set-Cookie: test5=five; domain=host.foo.com; expires=Sat Feb 2 11:56:27 GMT 2030
|
2003-08-11 14:44:46 +08:00
|
|
|
Content-Length: 26
|
|
|
|
|
|
|
|
run 2: set cookie 4 and 5
|
|
|
|
</data2>
|
|
|
|
<data3>
|
|
|
|
HTTP/1.1 200 OK
|
|
|
|
Date: Thu, 09 Nov 2010 14:49:02 GMT
|
|
|
|
Server: test-server/fake
|
|
|
|
Content-Type: text/html
|
|
|
|
Funny-head: yesyes
|
2007-02-05 10:38:25 +08:00
|
|
|
Set-Cookie: test4=overwritten4; domain=host.foo.com; expires=Sat May 5 GMT 11:56:27 2035
|
|
|
|
Set-Cookie: test1=overwritten1; domain=foo.com; expires=Thu Mar 3 GMT 11:56:27 2033
|
2003-08-11 14:44:46 +08:00
|
|
|
Content-Type: text/html
|
|
|
|
Content-Length: 32
|
|
|
|
|
|
|
|
run 3: overwrite cookie 1 and 4
|
2005-06-03 22:06:03 +08:00
|
|
|
</data3>
|
2003-08-11 14:44:46 +08:00
|
|
|
</reply>
|
|
|
|
|
|
|
|
# Client-side
|
|
|
|
<client>
|
|
|
|
<server>
|
|
|
|
http
|
|
|
|
</server>
|
|
|
|
<name>
|
|
|
|
HTTP with shared cookie list (and dns cache)
|
|
|
|
</name>
|
2007-07-11 06:27:16 +08:00
|
|
|
# Explicitly set the time zone to a known good one, in case the user is
|
|
|
|
# using one of the 'right' zones that take into account leap seconds
|
|
|
|
# which causes the cookie expiry times to be different.
|
|
|
|
<setenv>
|
|
|
|
TZ=GMT
|
|
|
|
</setenv>
|
2003-08-11 14:44:46 +08:00
|
|
|
<tool>
|
|
|
|
lib506
|
|
|
|
</tool>
|
|
|
|
<command>
|
2004-09-08 16:08:38 +08:00
|
|
|
http://%HOSTIP:%HTTPPORT/506
|
2003-08-11 14:44:46 +08:00
|
|
|
</command>
|
|
|
|
</client>
|
|
|
|
|
|
|
|
# Verify data after the test has been "shot"
|
|
|
|
<verify>
|
2005-06-03 22:06:03 +08:00
|
|
|
<stdout mode="text">
|
2003-08-11 14:44:46 +08:00
|
|
|
GLOBAL_INIT
|
|
|
|
SHARE_INIT
|
2006-07-18 00:47:07 +08:00
|
|
|
CURLSHOPT_LOCKFUNC
|
|
|
|
CURLSHOPT_UNLOCKFUNC
|
|
|
|
CURLSHOPT_USERDATA
|
2003-08-11 14:44:46 +08:00
|
|
|
CURL_LOCK_DATA_COOKIE
|
|
|
|
CURL_LOCK_DATA_DNS
|
|
|
|
*** run 1
|
|
|
|
CURLOPT_SHARE
|
2003-12-16 17:49:36 +08:00
|
|
|
lock: share <Pigs in space>: 0
|
|
|
|
unlock: share <Pigs in space>: 1
|
2003-08-11 14:44:46 +08:00
|
|
|
PERFORM
|
2003-12-16 17:49:36 +08:00
|
|
|
lock: dns <Pigs in space>: 2
|
|
|
|
unlock: dns <Pigs in space>: 3
|
|
|
|
lock: dns <Pigs in space>: 4
|
|
|
|
unlock: dns <Pigs in space>: 5
|
|
|
|
lock: cookie <Pigs in space>: 6
|
|
|
|
unlock: cookie <Pigs in space>: 7
|
|
|
|
lock: cookie <Pigs in space>: 8
|
|
|
|
unlock: cookie <Pigs in space>: 9
|
|
|
|
lock: cookie <Pigs in space>: 10
|
|
|
|
unlock: cookie <Pigs in space>: 11
|
|
|
|
lock: cookie <Pigs in space>: 12
|
|
|
|
unlock: cookie <Pigs in space>: 13
|
2003-08-11 14:44:46 +08:00
|
|
|
run 1: set cookie 1, 2 and 3
|
2003-12-16 17:49:36 +08:00
|
|
|
lock: dns <Pigs in space>: 14
|
|
|
|
unlock: dns <Pigs in space>: 15
|
2005-01-29 06:22:59 +08:00
|
|
|
CLEANUP
|
2003-12-16 17:49:36 +08:00
|
|
|
lock: dns <Pigs in space>: 16
|
|
|
|
unlock: dns <Pigs in space>: 17
|
|
|
|
lock: cookie <Pigs in space>: 18
|
|
|
|
unlock: cookie <Pigs in space>: 19
|
|
|
|
lock: share <Pigs in space>: 20
|
|
|
|
unlock: share <Pigs in space>: 21
|
2007-06-21 22:23:38 +08:00
|
|
|
*** run 2
|
|
|
|
CURLOPT_SHARE
|
|
|
|
lock: share <Pigs in space>: 22
|
|
|
|
unlock: share <Pigs in space>: 23
|
2003-08-11 14:44:46 +08:00
|
|
|
PERFORM
|
2004-10-04 18:36:51 +08:00
|
|
|
lock: dns <Pigs in space>: 24
|
|
|
|
unlock: dns <Pigs in space>: 25
|
2008-03-12 06:58:52 +08:00
|
|
|
lock: cookie <Pigs in space>: 26
|
|
|
|
unlock: cookie <Pigs in space>: 27
|
2003-12-16 17:49:36 +08:00
|
|
|
lock: cookie <Pigs in space>: 28
|
|
|
|
unlock: cookie <Pigs in space>: 29
|
2004-10-04 18:36:51 +08:00
|
|
|
lock: cookie <Pigs in space>: 30
|
|
|
|
unlock: cookie <Pigs in space>: 31
|
2003-08-11 14:44:46 +08:00
|
|
|
run 2: set cookie 4 and 5
|
2008-03-12 06:58:52 +08:00
|
|
|
lock: dns <Pigs in space>: 32
|
|
|
|
unlock: dns <Pigs in space>: 33
|
|
|
|
CLEANUP
|
2004-10-04 18:36:51 +08:00
|
|
|
lock: dns <Pigs in space>: 34
|
|
|
|
unlock: dns <Pigs in space>: 35
|
2008-03-12 06:58:52 +08:00
|
|
|
lock: cookie <Pigs in space>: 36
|
|
|
|
unlock: cookie <Pigs in space>: 37
|
|
|
|
lock: share <Pigs in space>: 38
|
|
|
|
unlock: share <Pigs in space>: 39
|
2003-08-11 14:44:46 +08:00
|
|
|
*** run 3
|
|
|
|
CURLOPT_SHARE
|
2008-03-12 06:58:52 +08:00
|
|
|
lock: share <Pigs in space>: 40
|
|
|
|
unlock: share <Pigs in space>: 41
|
2003-08-11 14:44:46 +08:00
|
|
|
CURLOPT_COOKIEJAR
|
|
|
|
PERFORM
|
2008-03-12 06:58:52 +08:00
|
|
|
lock: dns <Pigs in space>: 42
|
|
|
|
unlock: dns <Pigs in space>: 43
|
|
|
|
lock: cookie <Pigs in space>: 44
|
|
|
|
unlock: cookie <Pigs in space>: 45
|
|
|
|
lock: cookie <Pigs in space>: 46
|
|
|
|
unlock: cookie <Pigs in space>: 47
|
2004-10-04 18:36:51 +08:00
|
|
|
lock: cookie <Pigs in space>: 48
|
|
|
|
unlock: cookie <Pigs in space>: 49
|
2003-08-11 14:44:46 +08:00
|
|
|
run 3: overwrite cookie 1 and 4
|
2008-03-12 06:58:52 +08:00
|
|
|
lock: dns <Pigs in space>: 50
|
|
|
|
unlock: dns <Pigs in space>: 51
|
2003-08-11 14:44:46 +08:00
|
|
|
try SHARE_CLEANUP...
|
2008-03-12 06:58:52 +08:00
|
|
|
lock: share <Pigs in space>: 52
|
|
|
|
unlock: share <Pigs in space>: 53
|
2003-08-11 14:44:46 +08:00
|
|
|
SHARE_CLEANUP failed, correct
|
|
|
|
CLEANUP
|
2008-03-12 06:58:52 +08:00
|
|
|
lock: dns <Pigs in space>: 54
|
|
|
|
unlock: dns <Pigs in space>: 55
|
|
|
|
lock: cookie <Pigs in space>: 56
|
|
|
|
unlock: cookie <Pigs in space>: 57
|
|
|
|
lock: share <Pigs in space>: 58
|
|
|
|
unlock: share <Pigs in space>: 59
|
2003-08-11 14:44:46 +08:00
|
|
|
SHARE_CLEANUP
|
2008-03-12 06:58:52 +08:00
|
|
|
lock: share <Pigs in space>: 60
|
|
|
|
unlock: share <Pigs in space>: 61
|
2003-08-11 14:44:46 +08:00
|
|
|
GLOBAL_CLEANUP
|
|
|
|
</stdout>
|
|
|
|
<stderr>
|
2004-09-08 16:08:38 +08:00
|
|
|
http://%HOSTIP:%HTTPPORT/506
|
2003-08-11 14:44:46 +08:00
|
|
|
</stderr>
|
2005-06-03 22:06:03 +08:00
|
|
|
<file name="log/jar506" mode="text">
|
2003-08-11 14:44:46 +08:00
|
|
|
# Netscape HTTP Cookie File
|
2006-09-28 05:00:45 +08:00
|
|
|
# http://curlm.haxx.se/rfc/cookie_spec.html
|
2003-08-11 14:44:46 +08:00
|
|
|
# This file was generated by libcurl! Edit at your own risk.
|
|
|
|
|
2007-02-05 10:38:25 +08:00
|
|
|
.foo.com TRUE / FALSE 1993463787 test1 overwritten1
|
|
|
|
.host.foo.com TRUE / FALSE 1896263787 test2 two
|
|
|
|
.foo.com TRUE / FALSE 1896263787 test3 three
|
|
|
|
.host.foo.com TRUE / FALSE 2061978987 test4 overwritten4
|
|
|
|
.host.foo.com TRUE / FALSE 1896263787 test5 five
|
2003-08-11 14:44:46 +08:00
|
|
|
</file>
|
|
|
|
</verify>
|
2007-01-23 10:25:56 +08:00
|
|
|
</testcase>
|