mirror of
https://github.com/curl/curl.git
synced 2025-03-31 16:00:35 +08:00
tests: update cookie expiry dates to far in the future
This allows testing Y2038 with system time set to after that, so that actual Y2038 issues can be exposed, and not masked by expiry errors. Fixes #11576 Closes #11610
This commit is contained in:
parent
bc7c4996f1
commit
c2212c05aa
@ -16,7 +16,7 @@ Date: Tue, 09 Nov 2010 14:49:00 GMT
|
||||
Location: /want/data/%TESTNUMBER0002
|
||||
Server: test-server/fake
|
||||
Set-Cookie: test=true; domain=127.0.0.1; path=/; expires=Thu Jan 1 00:00:00 GMT 1970;
|
||||
Set-Cookie: test2=true; domain=127.0.0.1; path=/; expires=Fri Feb 13 11:56:27 GMT 2037;
|
||||
Set-Cookie: test2=true; domain=127.0.0.1; path=/; expires=Fri Feb 13 11:56:27 GMT 2525;
|
||||
Connection: close
|
||||
|
||||
This server reply is for testing a set-cookie
|
||||
@ -37,7 +37,7 @@ Date: Tue, 09 Nov 2010 14:49:00 GMT
|
||||
Location: /want/data/%TESTNUMBER0002
|
||||
Server: test-server/fake
|
||||
Set-Cookie: test=true; domain=127.0.0.1; path=/; expires=Thu Jan 1 00:00:00 GMT 1970;
|
||||
Set-Cookie: test2=true; domain=127.0.0.1; path=/; expires=Fri Feb 13 11:56:27 GMT 2037;
|
||||
Set-Cookie: test2=true; domain=127.0.0.1; path=/; expires=Fri Feb 13 11:56:27 GMT 2525;
|
||||
Connection: close
|
||||
|
||||
HTTP/1.1 200 Followed here fine swsclose
|
||||
|
@ -34,10 +34,10 @@ HTTP cookie domains tailmatching the host name
|
||||
http://example.fake/c/%TESTNUMBER http://bexample.fake/c/%TESTNUMBER -b %LOGDIR/injar%TESTNUMBER -x %HOSTIP:%HTTPPORT
|
||||
</command>
|
||||
<file name="%LOGDIR/injar%TESTNUMBER">
|
||||
example.fake FALSE /a FALSE 2139150993 mooo indeed
|
||||
example.fake FALSE /a FALSE 22139150993 mooo indeed
|
||||
example.fake FALSE /b FALSE 0 moo1 indeed
|
||||
example.fake FALSE /c FALSE 2139150993 moo2 indeed
|
||||
example.fake TRUE /c FALSE 2139150993 moo3 indeed
|
||||
example.fake FALSE /c FALSE 22139150993 moo2 indeed
|
||||
example.fake TRUE /c FALSE 22139150993 moo3 indeed
|
||||
</file>
|
||||
<features>
|
||||
cookies
|
||||
|
@ -20,6 +20,15 @@ Content-Length: 4
|
||||
Content-Type: text/html
|
||||
Funny-head: yesyes
|
||||
Set-Cookie: test1value=test1; domain=example.com; path=/;
|
||||
%if large-time
|
||||
Set-Cookie: test2value=test2; expires=Thursday, 31-Dec-2525 00:00:00 GMT; domain=example.com; path=/;
|
||||
Set-Cookie: test3value=test3; expires=Monday, 13-Jun-1988 03:04:55 GMT; domain=example.com; path=/;
|
||||
Set-Cookie: test4value=test4; expires=Thursday, 31-Dec-2525 00:00:00 GMT; domain=example.com; path=/;
|
||||
Set-Cookie: test5value=test5; expires=Monday, 13-Jun-1988 03:04:55 GMT; domain=example.com; path=/;
|
||||
Set-Cookie: test6value=test6; expires=Monday, 13-Jun-1988 03:04:55 GMT; domain=example.com; path=/;
|
||||
Set-Cookie: test7value=test7; expires=Thursday, 31-Dec-2525 00:00:00 GMT; domain=example.com; path=/;
|
||||
Set-Cookie: test8value=test8; expires=Monday, 13-Jun-1988 03:04:55 GMT; domain=example.com; path=/;
|
||||
%else
|
||||
Set-Cookie: test2value=test2; expires=Thursday, 31-Dec-2037 00:00:00 GMT; domain=example.com; path=/;
|
||||
Set-Cookie: test3value=test3; expires=Monday, 13-Jun-1988 03:04:55 GMT; domain=example.com; path=/;
|
||||
Set-Cookie: test4value=test4; expires=Thursday, 31-Dec-2037 00:00:00 GMT; domain=example.com; path=/;
|
||||
@ -27,6 +36,7 @@ Set-Cookie: test5value=test5; expires=Monday, 13-Jun-1988 03:04:55 GMT; domain=e
|
||||
Set-Cookie: test6value=test6; expires=Monday, 13-Jun-1988 03:04:55 GMT; domain=example.com; path=/;
|
||||
Set-Cookie: test7value=test7; expires=Thursday, 31-Dec-2037 00:00:00 GMT; domain=example.com; path=/;
|
||||
Set-Cookie: test8value=test8; expires=Monday, 13-Jun-1988 03:04:55 GMT; domain=example.com; path=/;
|
||||
%endif
|
||||
|
||||
boo
|
||||
</data>
|
||||
@ -68,9 +78,15 @@ Proxy-Connection: Keep-Alive
|
||||
# https://curl.se/docs/http-cookies.html
|
||||
# This file was generated by libcurl! Edit at your own risk.
|
||||
|
||||
%if large-time
|
||||
.example.com TRUE / FALSE 17545593600 test7value test7
|
||||
.example.com TRUE / FALSE 17545593600 test4value test4
|
||||
.example.com TRUE / FALSE 17545593600 test2value test2
|
||||
%else
|
||||
.example.com TRUE / FALSE 2145830400 test7value test7
|
||||
.example.com TRUE / FALSE 2145830400 test4value test4
|
||||
.example.com TRUE / FALSE 2145830400 test2value test2
|
||||
%endif
|
||||
.example.com TRUE / FALSE 0 test1value test1
|
||||
</file>
|
||||
</verify>
|
||||
|
@ -36,7 +36,7 @@ http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER -b %LOGDIR/jar%TESTNUMBER.txt -b "t
|
||||
|
||||
.%HOSTIP TRUE /silly/ FALSE 0 ismatch this
|
||||
.%HOSTIP TRUE / FALSE 0 partmatch present
|
||||
%HOSTIP FALSE /we/want/ FALSE 2139150993 nodomain value
|
||||
%HOSTIP FALSE /we/want/ FALSE 22139150993 nodomain value
|
||||
</file>
|
||||
<features>
|
||||
cookies
|
||||
|
@ -34,9 +34,9 @@ HTTP using proxy and cookies with path checks
|
||||
http://supertrooper.fake/c/%TESTNUMBER -b %LOGDIR/injar%TESTNUMBER -x %HOSTIP:%HTTPPORT
|
||||
</command>
|
||||
<file name="%LOGDIR/injar%TESTNUMBER">
|
||||
supertrooper.fake FALSE /a FALSE 2139150993 mooo indeed
|
||||
supertrooper.fake FALSE /a FALSE 22139150993 mooo indeed
|
||||
supertrooper.fake FALSE /b FALSE 0 moo1 indeed
|
||||
supertrooper.fake FALSE /c FALSE 2139150993 moo2 indeed
|
||||
supertrooper.fake FALSE /c FALSE 22139150993 moo2 indeed
|
||||
</file>
|
||||
<features>
|
||||
cookies
|
||||
|
@ -42,9 +42,15 @@ http://%HOSTIP:%NOLISTENPORT/not-there/%TESTNUMBER
|
||||
42
|
||||
</errorcode>
|
||||
<stdout>
|
||||
%if large-time
|
||||
[0/4] 1.example.com 25250320 01:02:03
|
||||
[1/4] 2.example.com 25250320 03:02:01
|
||||
[2/4] 3.example.com 25250319 01:02:03
|
||||
%else
|
||||
[0/4] 1.example.com 20370320 01:02:03
|
||||
[1/4] 2.example.com 20370320 03:02:01
|
||||
[2/4] 3.example.com 20370319 01:02:03
|
||||
%endif
|
||||
[3/4] 4.example.com unlimited
|
||||
First request returned 7
|
||||
Second request returned 42
|
||||
|
@ -54,10 +54,17 @@ Set-Cookie: partmatch=present; domain=test31.curl ; path=/;
|
||||
Set-Cookie:eat=this; domain=moo.foo.moo;
|
||||
Set-Cookie: eat=this-too; domain=.foo.moo;
|
||||
Set-Cookie: nodomainnovalue
|
||||
%if large-time
|
||||
Set-Cookie: nodomain=value; expires=Fri Feb 13 11:56:27 GMT 2525
|
||||
Set-Cookie: novalue; domain=reallysilly
|
||||
Set-Cookie: test=yes; domain=foo.com; expires=Sat Feb 2 11:56:27 GMT 2525
|
||||
Set-Cookie: test2=yes; domain=se; expires=Sat Feb 2 11:56:27 GMT 2525
|
||||
%else
|
||||
Set-Cookie: nodomain=value; expires=Fri Feb 13 11:56:27 GMT 2037
|
||||
Set-Cookie: novalue; domain=reallysilly
|
||||
Set-Cookie: test=yes; domain=foo.com; expires=Sat Feb 2 11:56:27 GMT 2030
|
||||
Set-Cookie: test2=yes; domain=se; expires=Sat Feb 2 11:56:27 GMT 2030
|
||||
%endif
|
||||
Set-Cookie: magic=yessir; path=/silly/; HttpOnly
|
||||
Set-Cookie: blexp=yesyes; domain=test31.curl; domain=test31.curl; expiry=totally bad;
|
||||
Set-Cookie: partialip=nono; domain=.0.0.1;
|
||||
@ -96,10 +103,17 @@ Set-Cookie: partmatch=present; domain=test31.curl ; path=/;
|
||||
Set-Cookie: eat=this; domain=moo.foo.moo;
|
||||
Set-Cookie: eat=this-too; domain=.foo.moo;
|
||||
Set-Cookie: nodomainnovalue
|
||||
%if large-time
|
||||
Set-Cookie: nodomain=value; expires=Fri Feb 13 11:56:27 GMT 2525
|
||||
Set-Cookie: novalue; domain=reallysilly
|
||||
Set-Cookie: test=yes; domain=foo.com; expires=Sat Feb 2 11:56:27 GMT 2525
|
||||
Set-Cookie: test2=yes; domain=se; expires=Sat Feb 2 11:56:27 GMT 2525
|
||||
%else
|
||||
Set-Cookie: nodomain=value; expires=Fri Feb 13 11:56:27 GMT 2037
|
||||
Set-Cookie: novalue; domain=reallysilly
|
||||
Set-Cookie: test=yes; domain=foo.com; expires=Sat Feb 2 11:56:27 GMT 2030
|
||||
Set-Cookie: test2=yes; domain=se; expires=Sat Feb 2 11:56:27 GMT 2030
|
||||
%endif
|
||||
Set-Cookie: magic=yessir; path=/silly/; HttpOnly
|
||||
Set-Cookie: blexp=yesyes; domain=test31.curl; domain=test31.curl; expiry=totally bad;
|
||||
Set-Cookie: partialip=nono; domain=.0.0.1;
|
||||
@ -157,7 +171,11 @@ test31.curl FALSE /we/want/ FALSE 0 withspaces2 before equals
|
||||
test31.curl FALSE /we/want/ FALSE 0 withspaces yes within and around
|
||||
.test31.curl TRUE /we/want/ FALSE 0 blexp yesyes
|
||||
#HttpOnly_test31.curl FALSE /silly/ FALSE 0 magic yessir
|
||||
%if large-time
|
||||
test31.curl FALSE /we/want/ FALSE 17517902187 nodomain value
|
||||
%else
|
||||
test31.curl FALSE /we/want/ FALSE 2118138987 nodomain value
|
||||
%endif
|
||||
.test31.curl TRUE / FALSE 0 partmatch present
|
||||
#HttpOnly_.test31.curl TRUE /p4/ FALSE 0 httponly myvalue1
|
||||
#HttpOnly_.test31.curl TRUE /p4/ FALSE 0 httpo4 value4
|
||||
|
@ -20,7 +20,7 @@ Date: Tue, 09 Nov 2010 14:49:00 GMT
|
||||
Server: test-server/fake
|
||||
Content-Type: text/html
|
||||
Funny-head: yesyes swsclose
|
||||
Set-Cookie: foobar=name; expires=Thu, 22 Nov 2037 10:54:11 GMT;
|
||||
Set-Cookie: foobar=name; expires=Thu, 22 Nov 2525 10:54:11 GMT;
|
||||
|
||||
</data>
|
||||
<data2>
|
||||
|
@ -32,10 +32,10 @@ moo
|
||||
# Client-side
|
||||
<client>
|
||||
<file name="%LOGDIR/jar%TESTNUMBER.txt" mode="text">
|
||||
.host.foo.com TRUE /we/want/ FALSE 2147483647 test no
|
||||
.host.foo.com TRUE /we/want/ FALSE 22147483647 test no
|
||||
</file>
|
||||
<file name="%LOGDIR/jar%TESTNUMBER-2.txt" mode="text">
|
||||
.host.foo.com TRUE /we/want/ FALSE 2147483647 tester yes
|
||||
.host.foo.com TRUE /we/want/ FALSE 22147483647 tester yes
|
||||
</file>
|
||||
<server>
|
||||
http
|
||||
|
@ -40,12 +40,12 @@ Setting cookies set with expired dates that were loaded from jar
|
||||
http://%HOSTIP:%HTTPPORT/func_test/del_cookie -b %LOGDIR/cookie%TESTNUMBER -c %LOGDIR/save%TESTNUMBER
|
||||
</command>
|
||||
<file name="%LOGDIR/cookie%TESTNUMBER" mode="text">
|
||||
%HOSTIP FALSE /func_test FALSE 1709598616 mycookie6 991
|
||||
#HttpOnly_%HOSTIP FALSE /func_test FALSE 1709598616 mycookie5 990
|
||||
#HttpOnly_%HOSTIP FALSE /func_test FALSE 1709598616 mycookie4 950
|
||||
#HttpOnly_%HOSTIP FALSE /func_test FALSE 1709598616 mycookie3 900
|
||||
#HttpOnly_%HOSTIP FALSE /func_test/ FALSE 1709598616 mycookie2 5900
|
||||
#HttpOnly_%HOSTIP FALSE / FALSE 1709598616 mycookie1 4900
|
||||
%HOSTIP FALSE /func_test FALSE 21709598616 mycookie6 991
|
||||
#HttpOnly_%HOSTIP FALSE /func_test FALSE 21709598616 mycookie5 990
|
||||
#HttpOnly_%HOSTIP FALSE /func_test FALSE 21709598616 mycookie4 950
|
||||
#HttpOnly_%HOSTIP FALSE /func_test FALSE 21709598616 mycookie3 900
|
||||
#HttpOnly_%HOSTIP FALSE /func_test/ FALSE 21709598616 mycookie2 5900
|
||||
#HttpOnly_%HOSTIP FALSE / FALSE 21709598616 mycookie1 4900
|
||||
#HttpOnly_%HOSTIP FALSE /func_test/ FALSE 0 mycookie 1200
|
||||
</file>
|
||||
<features>
|
||||
@ -69,7 +69,7 @@ Cookie: mycookie2=5900; mycookie=1200; mycookie3=900; mycookie4=950; mycookie5=9
|
||||
# https://curl.se/docs/http-cookies.html
|
||||
# This file was generated by libcurl! Edit at your own risk.
|
||||
|
||||
#HttpOnly_127.0.0.1 FALSE /func_test/ FALSE 1709598616 mycookie2 5900
|
||||
#HttpOnly_127.0.0.1 FALSE /func_test/ FALSE 21709598616 mycookie2 5900
|
||||
</file>
|
||||
</verify>
|
||||
</testcase>
|
||||
|
@ -16,7 +16,11 @@ HTTP/1.1 200 OK
|
||||
Server: Microsoft-IIS/4.0
|
||||
Date: Tue, 25 Sep 2001 19:37:44 GMT
|
||||
Content-Type: text/html
|
||||
%if large-time
|
||||
Set-Cookie: ckyPersistent=permanent; expires=Fri, 13-Feb-2525 11:56:27 GMT; path=/
|
||||
%else
|
||||
Set-Cookie: ckyPersistent=permanent; expires=Fri, 13-Feb-2037 11:56:27 GMT; path=/
|
||||
%endif
|
||||
Set-Cookie: ckySession=temporary; path=/
|
||||
Set-Cookie: ASPSESSIONIDQGGQQSJJ=GKNBDIFAAOFDPDAIEAKDIBKE; path=/
|
||||
Set-Cookie: justaname=; path=/;
|
||||
@ -50,10 +54,17 @@ domain..tld:%HTTPPORT/want/%TESTNUMBER --resolve domain..tld:%HTTPPORT:%HOSTIP -
|
||||
# https://curl.se/docs/http-cookies.html
|
||||
# This is generated by libcurl! Do not edit.
|
||||
|
||||
%if large-time
|
||||
www.fake.come FALSE / FALSE 22147483647 cookiecliente si
|
||||
www.loser.com FALSE / FALSE 22139150993 UID 99
|
||||
domain..tld FALSE / FALSE 22139150993 mooo indeed
|
||||
#HttpOnly_domain..tld FALSE /want FALSE 22139150993 mooo2 indeed2
|
||||
%else
|
||||
www.fake.come FALSE / FALSE 2147483647 cookiecliente si
|
||||
www.loser.com FALSE / FALSE 2139150993 UID 99
|
||||
domain..tld FALSE / FALSE 2139150993 mooo indeed
|
||||
#HttpOnly_domain..tld FALSE /want FALSE 2139150993 mooo2 indeed2
|
||||
%endif
|
||||
domain..tld FALSE /want FALSE 0 empty
|
||||
</file>
|
||||
<features>
|
||||
@ -80,12 +91,21 @@ domain..tld FALSE /want/ FALSE 0 simplyhuge zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
|
||||
domain..tld FALSE / FALSE 0 justaname
|
||||
domain..tld FALSE / FALSE 0 ASPSESSIONIDQGGQQSJJ GKNBDIFAAOFDPDAIEAKDIBKE
|
||||
domain..tld FALSE / FALSE 0 ckySession temporary
|
||||
%if large-time
|
||||
domain..tld FALSE / FALSE 17517902187 ckyPersistent permanent
|
||||
domain..tld FALSE /want FALSE 0 empty
|
||||
#HttpOnly_domain..tld FALSE /want FALSE 22139150993 mooo2 indeed2
|
||||
domain..tld FALSE / FALSE 22139150993 mooo indeed
|
||||
www.loser.com FALSE / FALSE 22139150993 UID 99
|
||||
www.fake.come FALSE / FALSE 22147483647 cookiecliente si
|
||||
%else
|
||||
domain..tld FALSE / FALSE 2118138987 ckyPersistent permanent
|
||||
domain..tld FALSE /want FALSE 0 empty
|
||||
#HttpOnly_domain..tld FALSE /want FALSE 2139150993 mooo2 indeed2
|
||||
domain..tld FALSE / FALSE 2139150993 mooo indeed
|
||||
www.loser.com FALSE / FALSE 2139150993 UID 99
|
||||
www.fake.come FALSE / FALSE 2147483647 cookiecliente si
|
||||
%endif
|
||||
</file>
|
||||
</verify>
|
||||
</testcase>
|
||||
|
@ -32,7 +32,7 @@ HTTP, junk session cookies
|
||||
%HOSTIP:%HTTPPORT/want/%TESTNUMBER -b %LOGDIR/injar%TESTNUMBER -j
|
||||
</command>
|
||||
<file name="%LOGDIR/injar%TESTNUMBER">
|
||||
%HOSTIP FALSE / FALSE 2139150993 mooo indeed
|
||||
%HOSTIP FALSE / FALSE 22139150993 mooo indeed
|
||||
%HOSTIP FALSE / FALSE 0 moo1 indeed
|
||||
%HOSTIP FALSE / FALSE 1 moo2 indeed
|
||||
</file>
|
||||
|
@ -17,8 +17,13 @@ Date: Tue, 09 Nov 2010 14:49:00 GMT
|
||||
Server: test-server/fake
|
||||
Content-Type: text/html
|
||||
Funny-head: yesyes
|
||||
%if large-time
|
||||
Set-Cookie: test=yes; httponly; domain=foo.com; expires=Fri Feb 13 11:56:27 GMT 2525
|
||||
SET-COOKIE: test2=yes; domain=host.foo.com; expires=Fri Feb 13 11:56:27 GMT 2525
|
||||
%else
|
||||
Set-Cookie: test=yes; httponly; domain=foo.com; expires=Fri Feb 13 11:56:27 GMT 2037
|
||||
SET-COOKIE: test2=yes; domain=host.foo.com; expires=Fri Feb 13 11:56:27 GMT 2037
|
||||
%endif
|
||||
Set-Cookie: test3=maybe; domain=foo.com; path=/moo; secure
|
||||
Set-Cookie: test4=no; domain=nope.foo.com; path=/moo; secure
|
||||
Set-Cookie: test5=name; domain=anything.com; path=/ ; secure
|
||||
@ -66,8 +71,13 @@ Accept: */*
|
||||
# https://curl.se/docs/http-cookies.html
|
||||
# This file was generated by libcurl! Edit at your own risk.
|
||||
|
||||
%if large-time
|
||||
.host.foo.com TRUE /we/want/ FALSE 17517902187 test2 yes
|
||||
#HttpOnly_.foo.com TRUE /we/want/ FALSE 17517902187 test yes
|
||||
%else
|
||||
.host.foo.com TRUE /we/want/ FALSE 2118138987 test2 yes
|
||||
#HttpOnly_.foo.com TRUE /we/want/ FALSE 2118138987 test yes
|
||||
%endif
|
||||
</file>
|
||||
</verify>
|
||||
</testcase>
|
||||
|
@ -36,9 +36,9 @@ http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER http://%HOSTIP:%HTTPPORT/we/want/%T
|
||||
# https://curl.se/docs/http-cookies.html
|
||||
# This file was generated by libcurl! Edit at your own risk.
|
||||
|
||||
#HttpOnly_.foo.com TRUE /we/want/ FALSE 2147483647 test yes
|
||||
.host.foo.com TRUE /we/want/ FALSE 2147483647 test2 yes
|
||||
.fake.host.foo.com TRUE /we/want/ FALSE 2147483647 test4 yes
|
||||
#HttpOnly_.foo.com TRUE /we/want/ FALSE 22147483647 test yes
|
||||
.host.foo.com TRUE /we/want/ FALSE 22147483647 test2 yes
|
||||
.fake.host.foo.com TRUE /we/want/ FALSE 22147483647 test4 yes
|
||||
|
||||
.foo.com TRUE /moo TRUE 0 test3 maybe
|
||||
</file>
|
||||
|
@ -45,7 +45,7 @@ Content-Type: text/html
|
||||
# Client-side
|
||||
<client>
|
||||
<file name="%LOGDIR/cookies%TESTNUMBER">
|
||||
%HOSTIP TRUE /we/want/ FALSE 2118138987 proven yes
|
||||
%HOSTIP TRUE /we/want/ FALSE 22118138987 proven yes
|
||||
</file>
|
||||
<server>
|
||||
http
|
||||
|
@ -33,10 +33,15 @@ struct entry {
|
||||
};
|
||||
|
||||
static const struct entry preload_hosts[] = {
|
||||
/* curl turns 39 that day just before 31-bit time_t overflow */
|
||||
#if (SIZEOF_TIME_T < 5)
|
||||
{ "1.example.com", "20370320 01:02:03" },
|
||||
{ "2.example.com", "20370320 03:02:01" },
|
||||
{ "3.example.com", "20370319 01:02:03" },
|
||||
#else
|
||||
{ "1.example.com", "25250320 01:02:03" },
|
||||
{ "2.example.com", "25250320 03:02:01" },
|
||||
{ "3.example.com", "25250319 01:02:03" },
|
||||
#endif
|
||||
{ "4.example.com", "" },
|
||||
{ NULL, NULL } /* end of list marker */
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user