test1105 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <testcase>
  2. <info>
  3. <keywords>
  4. HTTP
  5. HTTP POST
  6. cookies
  7. cookiejar
  8. </keywords>
  9. </info>
  10. # Server-side
  11. <reply>
  12. <data>
  13. HTTP/1.1 200 OK
  14. Date: Thu, 09 Nov 2010 14:49:00 GMT
  15. Server: test-server/fake
  16. Content-Type: text/html
  17. Funny-head: yesyes swsclose
  18. Set-Cookie: foobar=name;
  19. Set-Cookie: mismatch=this; domain=127.0.0.1; path="/silly/";
  20. Set-Cookie: partmatch=present; domain=.0.0.1; path=/;
  21. </data>
  22. </reply>
  23. # Client-side
  24. <client>
  25. <server>
  26. http
  27. </server>
  28. <name>
  29. HTTP with cookie parser and header recording
  30. </name>
  31. <command>
  32. "http://%HOSTIP:%HTTPPORT/we/want/1105?parm1=this*that/other/thing&parm2=foobar/1105" -c log/cookie1105.txt -d "userid=myname&password=mypassword"
  33. </command>
  34. <precheck>
  35. perl -e 'if ("%HOSTIP" !~ /127\.0\.0\.1$/) {print "Test only works for HOSTIP 127.0.0.1"; exit(1)}'
  36. </precheck>
  37. </client>
  38. # Verify data after the test has been "shot"
  39. <verify>
  40. <strip>
  41. ^User-Agent:.*
  42. </strip>
  43. <protocol nonewline="yes">
  44. POST /we/want/1105?parm1=this*that/other/thing&parm2=foobar/1105 HTTP/1.1
  45. Host: %HOSTIP:%HTTPPORT
  46. Accept: */*
  47. Content-Length: 33
  48. Content-Type: application/x-www-form-urlencoded
  49. userid=myname&password=mypassword
  50. </protocol>
  51. <file name="log/cookie1105.txt" mode="text">
  52. # Netscape HTTP Cookie File
  53. # http://curl.haxx.se/docs/http-cookies.html
  54. # This file was generated by libcurl! Edit at your own risk.
  55. 127.0.0.1 FALSE /we/want/ FALSE 0 foobar name
  56. .127.0.0.1 TRUE "/silly/" FALSE 0 mismatch this
  57. .0.0.1 TRUE / FALSE 0 partmatch present
  58. </file>
  59. </verify>
  60. </testcase>