test1025 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. <testcase>
  2. <info>
  3. <keywords>
  4. HTTP
  5. HTTP GET
  6. followlocation
  7. cookies
  8. </keywords>
  9. </info>
  10. # Server-side
  11. <reply>
  12. <data>
  13. HTTP/1.1 301 This is a weirdo text message
  14. Date: Thu, 09 Nov 2010 14:49:00 GMT
  15. Server: test-server/fake
  16. Location: ../data/10250002.txt
  17. Set-Cookie: firstcookie=want; path=/want/
  18. Content-Length: 69
  19. This server reply is for testing a Location: following with cookies
  20. </data>
  21. <data2>
  22. HTTP/1.1 301 This is a weirdo text message
  23. Date: Thu, 09 Nov 2010 14:49:00 GMT
  24. Server: test-server/fake
  25. Location: ../want/10250003.txt
  26. Set-Cookie: nextcookie=data; path=/data/
  27. Content-Length: 69
  28. This server reply is for testing a Location: following with cookies
  29. </data2>
  30. <data3>
  31. HTTP/1.1 200 Followed here fine
  32. Date: Thu, 09 Nov 2010 14:49:00 GMT
  33. Server: test-server/fake
  34. Content-Length: 52
  35. If this is received, the location following worked
  36. </data3>
  37. <datacheck>
  38. HTTP/1.1 301 This is a weirdo text message
  39. Date: Thu, 09 Nov 2010 14:49:00 GMT
  40. Server: test-server/fake
  41. Location: ../data/10250002.txt
  42. Set-Cookie: firstcookie=want; path=/want/
  43. Content-Length: 69
  44. HTTP/1.1 301 This is a weirdo text message
  45. Date: Thu, 09 Nov 2010 14:49:00 GMT
  46. Server: test-server/fake
  47. Location: ../want/10250003.txt
  48. Set-Cookie: nextcookie=data; path=/data/
  49. Content-Length: 69
  50. HTTP/1.1 200 Followed here fine
  51. Date: Thu, 09 Nov 2010 14:49:00 GMT
  52. Server: test-server/fake
  53. Content-Length: 52
  54. If this is received, the location following worked
  55. </datacheck>
  56. </reply>
  57. # Client-side
  58. <client>
  59. <server>
  60. http
  61. </server>
  62. <name>
  63. HTTP Location: following with command-line and server cookies
  64. </name>
  65. <command>
  66. http://%HOSTIP:%HTTPPORT/want/1025 -L -c log/jar1025 -b forcedcookie=yes
  67. </command>
  68. </client>
  69. # Verify data after the test has been "shot"
  70. <verify>
  71. <strip>
  72. ^User-Agent:.*
  73. </strip>
  74. <protocol>
  75. GET /want/1025 HTTP/1.1
  76. Host: %HOSTIP:%HTTPPORT
  77. Accept: */*
  78. Cookie: forcedcookie=yes
  79. GET /data/10250002.txt HTTP/1.1
  80. Host: %HOSTIP:%HTTPPORT
  81. Accept: */*
  82. Cookie: forcedcookie=yes
  83. GET /want/10250003.txt HTTP/1.1
  84. Host: %HOSTIP:%HTTPPORT
  85. Accept: */*
  86. Cookie: firstcookie=want; forcedcookie=yes
  87. </protocol>
  88. </verify>
  89. </testcase>