test8 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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 swsclose
  13. Date: Thu, 09 Nov 2010 14:49:00 GMT
  14. Server: test-server/fake
  15. </data>
  16. </reply>
  17. # Client-side
  18. <client>
  19. <server>
  20. http
  21. </server>
  22. <name>
  23. HTTP with cookie parsing from header file
  24. </name>
  25. <command>
  26. http://%HOSTIP:%HTTPPORT/we/want/8 -b log/heads8.txt
  27. </command>
  28. # We create this file before the command is invoked!
  29. <file name="log/heads8.txt">
  30. HTTP/1.1 200 OK
  31. Date: Thu, 09 Nov 2010 14:49:00 GMT
  32. Server: test-server/fake
  33. Content-Type: text/html
  34. Funny-head: yesyes
  35. Set-Cookie: foobar=name; domain=%HOSTIP; path=/;
  36. Set-Cookie: mismatch=this; domain=%HOSTIP; path="/silly/";
  37. Set-Cookie: partmatch=present; domain=.0.0.1; path=/w;
  38. Set-Cookie: duplicate=test; domain=.0.0.1; domain=.0.0.1; path=/donkey;
  39. Set-Cookie: cookie=yes; path=/we;
  40. Set-Cookie: cookie=perhaps; path=/we/want;
  41. Set-Cookie: nocookie=yes; path=/WE;
  42. Set-Cookie: blexp=yesyes; domain=%HOSTIP; domain=%HOSTIP; expiry=totally bad;
  43. Set-Cookie: partialip=nono; domain=.0.0.1;
  44. </file>
  45. <precheck>
  46. perl -e 'if ("%HOSTIP" !~ /\.0\.0\.1$/) {print "Test only works for HOSTIPs ending with .0.0.1"; exit(1)}'
  47. </precheck>
  48. </client>
  49. # Verify data after the test has been "shot"
  50. <verify>
  51. <strip>
  52. ^User-Agent:.*
  53. </strip>
  54. <protocol>
  55. GET /we/want/8 HTTP/1.1
  56. Host: %HOSTIP:%HTTPPORT
  57. Accept: */*
  58. Cookie: cookie=perhaps; cookie=yes; foobar=name; blexp=yesyes
  59. </protocol>
  60. </verify>
  61. </testcase>