test1025 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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: Tue, 09 Nov 2010 14:49:00 GMT
  15. Server: test-server/fake
  16. Location: ../data/%TESTNUMBER0002.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: Tue, 09 Nov 2010 14:49:00 GMT
  24. Server: test-server/fake
  25. Location: ../want/%TESTNUMBER0003.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: Tue, 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: Tue, 09 Nov 2010 14:49:00 GMT
  40. Server: test-server/fake
  41. Location: ../data/%TESTNUMBER0002.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: Tue, 09 Nov 2010 14:49:00 GMT
  46. Server: test-server/fake
  47. Location: ../want/%TESTNUMBER0003.txt
  48. Set-Cookie: nextcookie=data; path=/data/
  49. Content-Length: 69
  50. HTTP/1.1 200 Followed here fine
  51. Date: Tue, 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/%TESTNUMBER -L -c %LOGDIR/jar%TESTNUMBER -b forcedcookie=yes
  67. </command>
  68. <features>
  69. cookies
  70. </features>
  71. </client>
  72. # Verify data after the test has been "shot"
  73. <verify>
  74. <protocol>
  75. GET /want/%TESTNUMBER HTTP/1.1
  76. Host: %HOSTIP:%HTTPPORT
  77. User-Agent: curl/%VERSION
  78. Accept: */*
  79. Cookie: forcedcookie=yes
  80. GET /data/%TESTNUMBER0002.txt HTTP/1.1
  81. Host: %HOSTIP:%HTTPPORT
  82. User-Agent: curl/%VERSION
  83. Accept: */*
  84. Cookie: forcedcookie=yes
  85. GET /want/%TESTNUMBER0003.txt HTTP/1.1
  86. Host: %HOSTIP:%HTTPPORT
  87. User-Agent: curl/%VERSION
  88. Accept: */*
  89. Cookie: firstcookie=want; forcedcookie=yes
  90. </protocol>
  91. </verify>
  92. </testcase>