test257 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  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: Thu, 09 Nov 2010 14:49:00 GMT
  17. Server: test-server/fake
  18. Location: http://anotherone.com/2570002
  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: Thu, 09 Nov 2010 14:49:00 GMT
  25. Server: test-server/fake
  26. Location: http://athird.com/2570003
  27. If this is received, the location following worked
  28. </data2>
  29. <data3>
  30. HTTP/1.1 200 Followed here fine swsclose
  31. Date: Thu, 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: Thu, 09 Nov 2010 14:49:00 GMT
  39. Server: test-server/fake
  40. Location: http://anotherone.com/2570002
  41. Connection: close
  42. HTTP/1.1 302 Followed here fine swsclose
  43. Date: Thu, 09 Nov 2010 14:49:00 GMT
  44. Server: test-server/fake
  45. Location: http://athird.com/2570003
  46. HTTP/1.1 200 Followed here fine swsclose
  47. Date: Thu, 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/257 -L -x http://%HOSTIP:%HTTPPORT --netrc-optional --netrc-file log/netrc257
  63. </command>
  64. # netrc auth for two out of three sites:
  65. <file name="log/netrc257">
  66. machine supersite.com login user1 password passwd1
  67. machine anotherone.com login user2 password passwd2
  68. </file>
  69. </client>
  70. # Verify data after the test has been "shot"
  71. <verify>
  72. <strip>
  73. ^User-Agent:.*
  74. </strip>
  75. <protocol>
  76. GET http://supersite.com/want/257 HTTP/1.1
  77. Authorization: Basic dXNlcjE6cGFzc3dkMQ==
  78. User-Agent: curl/7.14.0-CVS (i686-pc-linux-gnu) libcurl/7.14.0-CVS OpenSSL/0.9.7e zlib/1.2.2 libidn/0.5.13
  79. Host: supersite.com
  80. Accept: */*
  81. Proxy-Connection: Keep-Alive
  82. GET http://anotherone.com/2570002 HTTP/1.1
  83. Authorization: Basic dXNlcjI6cGFzc3dkMg==
  84. User-Agent: curl/7.14.0-CVS (i686-pc-linux-gnu) libcurl/7.14.0-CVS OpenSSL/0.9.7e zlib/1.2.2 libidn/0.5.13
  85. Host: anotherone.com
  86. Accept: */*
  87. Proxy-Connection: Keep-Alive
  88. GET http://athird.com/2570003 HTTP/1.1
  89. User-Agent: curl/7.14.0-CVS (i686-pc-linux-gnu) libcurl/7.14.0-CVS OpenSSL/0.9.7e zlib/1.2.2 libidn/0.5.13
  90. Host: athird.com
  91. Accept: */*
  92. Proxy-Connection: Keep-Alive
  93. </protocol>
  94. </verify>
  95. </testcase>