Base code merged to SPIN 2.4
[platform/upstream/curl.git] / tests / data / test31
index eddc9b6..dfcac04 100644 (file)
@@ -1,19 +1,58 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+cookies
+cookiejar
+</keywords>
+</info>
 # Server-side
 <reply>
 <data>
 HTTP/1.1 200 OK\r
 Date: Thu, 09 Nov 2010 14:49:00 GMT\r
 Server: test-server/fake\r
+Content-Length: 4\r
 Content-Type: text/html\r
 Funny-head: yesyes\r
-Set-Cookie: foobar=name; domain=127.0.0.1; path=/ ; secure\r
-Set-Cookie:mismatch=this  ; domain=127.0.0.1; path=/silly/\r
+Set-Cookie: foobar=name; domain=anything.com; path=/ ; secure\r
+Set-Cookie:ismatch=this  ; domain=127.0.0.1; path=/silly/\r
+Set-Cookie: overwrite=this  ; domain=127.0.0.1; path=/overwrite/\r
+Set-Cookie: overwrite=this2  ; domain=127.0.0.1; path=/overwrite\r
+Set-Cookie: sec1value=secure1  ; domain=127.0.0.1; path=/secure1/ ; secure\r
+Set-Cookie: sec2value=secure2  ; domain=127.0.0.1; path=/secure2/ ; secure=\r
+Set-Cookie: sec3value=secure3  ; domain=127.0.0.1; path=/secure3/ ; secure=\r
+Set-Cookie: sec4value=secure4  ; secure=; domain=127.0.0.1; path=/secure4/ ; \r
+Set-Cookie: sec5value=secure5  ; secure; domain=127.0.0.1; path=/secure5/ ; \r
+Set-Cookie: sec6value=secure6  ; secure ; domain=127.0.0.1; path=/secure6/ ; \r
+Set-Cookie: sec7value=secure7  ; secure   ; domain=127.0.0.1; path=/secure7/ ; \r
+Set-Cookie: sec8value=secure8  ; secure= ; domain=127.0.0.1; path=/secure8/ ; \r
+Set-Cookie: secure=very1  ; secure=; domain=127.0.0.1; path=/secure9/; \r
+Set-Cookie: httpo1=value1  ; domain=127.0.0.1; path=/p1/; httponly\r
+Set-Cookie: httpo2=value2  ; domain=127.0.0.1; path=/p2/; httponly=\r
+Set-Cookie: httpo3=value3  ; httponly; domain=127.0.0.1; path=/p3/;\r
+Set-Cookie: httpo4=value4  ; httponly=; domain=127.0.0.1; path=/p4/; \r
+Set-Cookie: httponly=myvalue1  ; domain=127.0.0.1; path=/p4/; httponly\r
+Set-Cookie: httpandsec=myvalue2  ; domain=127.0.0.1; path=/p4/; httponly; secure\r
+Set-Cookie: httpandsec2=myvalue3; domain=127.0.0.1; path=/p4/; httponly=; secure\r
+Set-Cookie: httpandsec3=myvalue4  ; domain=127.0.0.1; path=/p4/; httponly; secure=\r
+Set-Cookie: httpandsec4=myvalue5  ; domain=127.0.0.1; path=/p4/; httponly=; secure=\r
+Set-Cookie: httpandsec5=myvalue6  ; domain=127.0.0.1; path=/p4/; secure; httponly=\r
+Set-Cookie: httpandsec6=myvalue7  ; domain=127.0.0.1; path=/p4/; secure=; httponly=\r
+Set-Cookie: httpandsec7=myvalue8  ; domain=127.0.0.1; path=/p4/; secure; httponly\r
+Set-Cookie: httpandsec8=myvalue9; domain=127.0.0.1; path=/p4/; secure=; httponly\r
 Set-Cookie: partmatch=present; domain=127.0.0.1 ; path=/;\r
-Set-Cookie: eat=this; domain=moo.foo.moo;\r
+Set-Cookie:eat=this; domain=moo.foo.moo;\r
 Set-Cookie: eat=this-too; domain=.foo.moo;\r
 Set-Cookie: nodomainnovalue\r
-Set-Cookie: nodomain=value; expires=Tue Feb 1 11:56:27 MET 2014\r
-Set-Cookie: nodomainnovalue; domain=reallysilly\r
+Set-Cookie:   nodomain=value; expires=Fri Feb 2 11:56:27 GMT 2035\r
+Set-Cookie: novalue; domain=reallysilly\r
+Set-Cookie: test=yes; domain=foo.com; expires=Sat Feb 2 11:56:27 GMT 2030\r
+Set-Cookie: test2=yes; domain=se; expires=Sat Feb 2 11:56:27 GMT 2030\r
+Set-Cookie: magic=yessir; path=/silly/; HttpOnly\r
+Set-Cookie: blexp=yesyes; domain=127.0.0.1; domain=127.0.0.1; expiry=totally bad;\r
+Set-Cookie: partialip=nono; domain=.0.0.1;\r
 \r
 boo
 </data>
@@ -21,13 +60,25 @@ boo
 
 # Client-side
 <client>
+<server>
+http
+</server>
  <name>
 HTTP with weirdly formatted cookies and cookiejar storage
  </name>
+# 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>
  <command>
-http://%HOSTIP:%HOSTPORT/we/want/31 -b none -c log/jar31.txt
+http://%HOSTIP:%HTTPPORT/we/want/31 -b none -c log/jar31.txt
 </command>
-</test>
+<precheck>
+perl -e 'if ("%HOSTIP" !~ /127\.0\.0\.1$/) {print "Test only works for HOSTIP 127.0.0.1"; exit(1)}'
+</precheck>
+</client>
 
 # Verify data after the test has been "shot"
 <verify>
@@ -36,21 +87,43 @@ http://%HOSTIP:%HOSTPORT/we/want/31 -b none -c log/jar31.txt
 </strip>
 <protocol>
 GET /we/want/31 HTTP/1.1\r
-Host: 127.0.0.1:8999\r
-Pragma: no-cache\r
-Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*\r
+Host: %HOSTIP:%HTTPPORT\r
+Accept: */*\r
 \r
 </protocol>
-<file name="log/jar31.txt">
+<file name="log/jar31.txt" mode="text">
 # Netscape HTTP Cookie File
-# http://www.netscape.com/newsref/std/cookie_spec.html
+# http://curl.haxx.se/docs/http-cookies.html
 # This file was generated by libcurl! Edit at your own risk.
 
-127.0.0.1      FALSE   /       TRUE    0       foobar  name
 127.0.0.1      FALSE   /silly/ FALSE   0       ismatch this
+127.0.0.1      FALSE   /overwrite      FALSE   0       overwrite       this2
+127.0.0.1      FALSE   /secure1/       TRUE    0       sec1value       secure1
+127.0.0.1      FALSE   /secure2/       TRUE    0       sec2value       secure2
+127.0.0.1      FALSE   /secure3/       TRUE    0       sec3value       secure3
+127.0.0.1      FALSE   /secure4/       TRUE    0       sec4value       secure4
+127.0.0.1      FALSE   /secure5/       TRUE    0       sec5value       secure5
+127.0.0.1      FALSE   /secure6/       TRUE    0       sec6value       secure6
+127.0.0.1      FALSE   /secure7/       TRUE    0       sec7value       secure7
+127.0.0.1      FALSE   /secure8/       TRUE    0       sec8value       secure8
+127.0.0.1      FALSE   /secure9/       TRUE    0       secure  very1
+#HttpOnly_127.0.0.1    FALSE   /p1/    FALSE   0       httpo1  value1
+#HttpOnly_127.0.0.1    FALSE   /p2/    FALSE   0       httpo2  value2
+#HttpOnly_127.0.0.1    FALSE   /p3/    FALSE   0       httpo3  value3
+#HttpOnly_127.0.0.1    FALSE   /p4/    FALSE   0       httpo4  value4
+#HttpOnly_127.0.0.1    FALSE   /p4/    FALSE   0       httponly        myvalue1
+#HttpOnly_127.0.0.1    FALSE   /p4/    TRUE    0       httpandsec      myvalue2
+#HttpOnly_127.0.0.1    FALSE   /p4/    TRUE    0       httpandsec2     myvalue3
+#HttpOnly_127.0.0.1    FALSE   /p4/    TRUE    0       httpandsec3     myvalue4
+#HttpOnly_127.0.0.1    FALSE   /p4/    TRUE    0       httpandsec4     myvalue5
+#HttpOnly_127.0.0.1    FALSE   /p4/    TRUE    0       httpandsec5     myvalue6
+#HttpOnly_127.0.0.1    FALSE   /p4/    TRUE    0       httpandsec6     myvalue7
+#HttpOnly_127.0.0.1    FALSE   /p4/    TRUE    0       httpandsec7     myvalue8
+#HttpOnly_127.0.0.1    FALSE   /p4/    TRUE    0       httpandsec8     myvalue9
 127.0.0.1      FALSE   /       FALSE   0       partmatch       present
-moo.foo.moo    FALSE   /       FALSE   0       eat     this
-.foo.moo       TRUE    /       FALSE   0       eat     this-too
-127.0.0.1      FALSE   /       FALSE   1391252187      nodomain        value
+127.0.0.1      FALSE   /we/want/       FALSE   2054030187      nodomain        value
+#HttpOnly_127.0.0.1    FALSE   /silly/ FALSE   0       magic   yessir
+127.0.0.1      FALSE   /we/want/       FALSE   0       blexp   yesyes
 </file>
 </verify>
+</testcase>