xf.li | 6c8fc1e | 2023-08-12 00:11:09 -0700 | [diff] [blame] | 1 | <testcase> |
| 2 | <info> |
| 3 | <keywords> |
| 4 | HTTP |
| 5 | HTTP GET |
| 6 | cookies |
| 7 | </keywords> |
| 8 | </info> |
| 9 | # Server-side |
| 10 | <reply> |
| 11 | <data> |
| 12 | HTTP/1.1 200 OK
|
| 13 | Date: Tue, 09 Nov 2010 14:49:00 GMT
|
| 14 | Server: test-server/fake
|
| 15 | Content-Type: text/html
|
| 16 | Funny-head: yesyes
|
| 17 | Set-Cookie: test=yes; path=/we/want/; domain=.host.foo.com; Max-Age=0;
|
| 18 | Content-Length: 4
|
| 19 |
|
| 20 | boo |
| 21 | </data> |
| 22 | <data2> |
| 23 | HTTP/1.1 200 OK
|
| 24 | Funny-head: yesyes
|
| 25 | Content-Length: 4
|
| 26 |
|
| 27 | moo |
| 28 | </data2> |
| 29 | </reply> |
| 30 | |
| 31 | # Client-side |
| 32 | <client> |
| 33 | <file name="log/jar%TESTNUMBER.txt" mode="text"> |
| 34 | .host.foo.com TRUE /we/want/ FALSE 2147483647 test no |
| 35 | </file> |
| 36 | <file name="log/jar%TESTNUMBER-2.txt" mode="text"> |
| 37 | .host.foo.com TRUE /we/want/ FALSE 2147483647 tester yes |
| 38 | </file> |
| 39 | <server> |
| 40 | http |
| 41 | </server> |
| 42 | <name> |
| 43 | HTTP cookie with Max-Age=0 |
| 44 | </name> |
| 45 | # Explicitly set the time zone to a known good one, in case the user is |
| 46 | # using one of the 'right' zones that take into account leap seconds |
| 47 | # which causes the cookie expiry times to be different. |
| 48 | <setenv> |
| 49 | TZ=GMT |
| 50 | </setenv> |
| 51 | <command> |
| 52 | http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER -b log/jar%TESTNUMBER.txt -b log/jar%TESTNUMBER-2.txt -H "Host: host.foo.com" http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER0002 |
| 53 | </command> |
| 54 | </client> |
| 55 | |
| 56 | # Verify data after the test has been "shot" |
| 57 | <verify> |
| 58 | <protocol> |
| 59 | GET /we/want/%TESTNUMBER HTTP/1.1
|
| 60 | Host: host.foo.com
|
| 61 | User-Agent: curl/%VERSION
|
| 62 | Accept: */*
|
| 63 | Cookie: tester=yes; test=no
|
| 64 |
|
| 65 | GET /we/want/%TESTNUMBER0002 HTTP/1.1
|
| 66 | Host: host.foo.com
|
| 67 | User-Agent: curl/%VERSION
|
| 68 | Accept: */*
|
| 69 | Cookie: tester=yes
|
| 70 |
|
| 71 | </protocol> |
| 72 | </verify> |
| 73 | </testcase> |