test257 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. <testcase>
  2. <info>
  3. <keywords>
  4. HTTP
  5. HTTP GET
  6. HTTP proxy
  7. HTTP Basic auth
  8. followlocation
  9. netrc
  10. </keywords>
  11. </info>
  12. # Server-side
  13. <reply>
  14. <data>
  15. HTTP/1.1 301 This is a weirdo text message swsclose
  16. Date: Tue, 09 Nov 2010 14:49:00 GMT
  17. Server: test-server/fake
  18. Location: http://anotherone.com/%TESTNUMBER0002
  19. Connection: close
  20. This server reply is for testing a simple Location: following
  21. </data>
  22. <data2>
  23. HTTP/1.1 302 Followed here fine swsclose
  24. Date: Tue, 09 Nov 2010 14:49:00 GMT
  25. Server: test-server/fake
  26. Location: http://athird.com/%TESTNUMBER0003
  27. If this is received, the location following worked
  28. </data2>
  29. <data3>
  30. HTTP/1.1 200 Followed here fine swsclose
  31. Date: Tue, 09 Nov 2010 14:49:00 GMT
  32. Server: test-server/fake
  33. Content-Length: 52
  34. If this is received, the location following worked
  35. </data3>
  36. <datacheck>
  37. HTTP/1.1 301 This is a weirdo text message swsclose
  38. Date: Tue, 09 Nov 2010 14:49:00 GMT
  39. Server: test-server/fake
  40. Location: http://anotherone.com/%TESTNUMBER0002
  41. Connection: close
  42. HTTP/1.1 302 Followed here fine swsclose
  43. Date: Tue, 09 Nov 2010 14:49:00 GMT
  44. Server: test-server/fake
  45. Location: http://athird.com/%TESTNUMBER0003
  46. HTTP/1.1 200 Followed here fine swsclose
  47. Date: Tue, 09 Nov 2010 14:49:00 GMT
  48. Server: test-server/fake
  49. Content-Length: 52
  50. If this is received, the location following worked
  51. </datacheck>
  52. </reply>
  53. # Client-side
  54. <client>
  55. <server>
  56. http
  57. </server>
  58. <name>
  59. HTTP Location: following with --netrc-optional
  60. </name>
  61. <command>
  62. http://supersite.com/want/%TESTNUMBER -L -x http://%HOSTIP:%HTTPPORT --netrc-optional --netrc-file %LOGDIR/netrc%TESTNUMBER
  63. </command>
  64. <features>
  65. proxy
  66. </features>
  67. # netrc auth for two out of three sites:
  68. <file name="%LOGDIR/netrc%TESTNUMBER">
  69. machine supersite.com login user1 password passwd1
  70. machine anotherone.com login user2 password passwd2
  71. </file>
  72. </client>
  73. # Verify data after the test has been "shot"
  74. <verify>
  75. <protocol>
  76. GET http://supersite.com/want/%TESTNUMBER HTTP/1.1
  77. Host: supersite.com
  78. Authorization: Basic dXNlcjE6cGFzc3dkMQ==
  79. User-Agent: curl/%VERSION
  80. Accept: */*
  81. Proxy-Connection: Keep-Alive
  82. GET http://anotherone.com/%TESTNUMBER0002 HTTP/1.1
  83. Host: anotherone.com
  84. Authorization: Basic dXNlcjI6cGFzc3dkMg==
  85. User-Agent: curl/%VERSION
  86. Accept: */*
  87. Proxy-Connection: Keep-Alive
  88. GET http://athird.com/%TESTNUMBER0003 HTTP/1.1
  89. Host: athird.com
  90. User-Agent: curl/%VERSION
  91. Accept: */*
  92. Proxy-Connection: Keep-Alive
  93. </protocol>
  94. </verify>
  95. </testcase>