test1331 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. # Test case inspired by this question on stackoverflow:
  2. #
  3. # http://stackoverflow.com/questions/10017165/use-libcurl-with-bluecoat-cookie-proxy
  4. #
  5. <testcase>
  6. <info>
  7. <keywords>
  8. HTTP
  9. HTTP GET
  10. HTTP proxy
  11. cookies
  12. </keywords>
  13. </info>
  14. # Server-side
  15. <reply>
  16. <data>
  17. HTTP/1.1 407 Me not know you swsbounce
  18. Date: Tue, 25 Sep 2001 19:37:44 GMT
  19. Content-Type: text/html
  20. Set-Cookie: proxycookie=weirdo; Path=/
  21. Cache-control: private
  22. Content-Length: 62
  23. Proxy-Authenticate: Basic realm="moo on you"
  24. This server reply is for testing a simple cookie test case...
  25. </data>
  26. <data1>
  27. HTTP/1.1 200 Fine!
  28. Content-Type: text/html
  29. Content-Length: 6
  30. hello
  31. </data1>
  32. <datacheck>
  33. HTTP/1.1 407 Me not know you swsbounce
  34. Date: Tue, 25 Sep 2001 19:37:44 GMT
  35. Content-Type: text/html
  36. Set-Cookie: proxycookie=weirdo; Path=/
  37. Cache-control: private
  38. Content-Length: 62
  39. Proxy-Authenticate: Basic realm="moo on you"
  40. HTTP/1.1 200 Fine!
  41. Content-Type: text/html
  42. Content-Length: 6
  43. hello
  44. </datacheck>
  45. </reply>
  46. # Client-side
  47. <client>
  48. <server>
  49. http
  50. </server>
  51. <name>
  52. HTTP --proxy-anyauth and 407 with cookies
  53. </name>
  54. <command>
  55. -U myname:mypassword -x %HOSTIP:%HTTPPORT http://z.x.com/1331 --proxy-anyauth -c log/dump1331
  56. </command>
  57. </client>
  58. # Verify data after the test has been "shot"
  59. <verify>
  60. <strip>
  61. ^User-Agent:.*
  62. </strip>
  63. <protocol>
  64. GET http://z.x.com/1331 HTTP/1.1
  65. Host: z.x.com
  66. Accept: */*
  67. Proxy-Connection: Keep-Alive
  68. GET http://z.x.com/1331 HTTP/1.1
  69. Proxy-Authorization: Basic bXluYW1lOm15cGFzc3dvcmQ=
  70. Host: z.x.com
  71. Accept: */*
  72. Proxy-Connection: Keep-Alive
  73. Cookie: proxycookie=weirdo
  74. </protocol>
  75. </verify>
  76. </testcase>