test1075 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. <testcase>
  2. <info>
  3. <keywords>
  4. HTTP
  5. HTTP PUT
  6. HTTP Basic auth
  7. --anyauth
  8. </keywords>
  9. </info>
  10. # Server-side
  11. <reply>
  12. # The test server provides no way to respond differently to a subsequent
  13. # Basic authenticated request (we really want to respond with 200 for
  14. # the second), so just respond with 401 for both and let curl deal with it.
  15. <data>
  16. HTTP/1.1 401 Authorization Required
  17. Server: testcurl
  18. WWW-Authenticate: Blackmagic realm="gimme all yer s3cr3ts"
  19. WWW-Authenticate: Basic realm="gimme all yer s3cr3ts"
  20. WWW-Authenticate: X-bogus-auth realm="gimme all yer s3cr3ts"
  21. Content-Type: text/plain
  22. Content-Length: 0
  23. </data>
  24. <datacheck>
  25. HTTP/1.1 401 Authorization Required
  26. Server: testcurl
  27. WWW-Authenticate: Blackmagic realm="gimme all yer s3cr3ts"
  28. WWW-Authenticate: Basic realm="gimme all yer s3cr3ts"
  29. WWW-Authenticate: X-bogus-auth realm="gimme all yer s3cr3ts"
  30. Content-Type: text/plain
  31. Content-Length: 0
  32. HTTP/1.1 401 Authorization Required
  33. Server: testcurl
  34. WWW-Authenticate: Blackmagic realm="gimme all yer s3cr3ts"
  35. WWW-Authenticate: Basic realm="gimme all yer s3cr3ts"
  36. WWW-Authenticate: X-bogus-auth realm="gimme all yer s3cr3ts"
  37. Content-Type: text/plain
  38. Content-Length: 0
  39. </datacheck>
  40. </reply>
  41. # Client-side
  42. <client>
  43. <server>
  44. http
  45. </server>
  46. <name>
  47. HTTP PUT with --anyauth authorization (picking Basic)
  48. </name>
  49. <command>
  50. http://%HOSTIP:%HTTPPORT/%TESTNUMBER -T log/put%TESTNUMBER -u testuser:testpass --anyauth
  51. </command>
  52. <file name="log/put%TESTNUMBER">
  53. This is data we upload with PUT
  54. a second line
  55. line three
  56. four is the number of lines
  57. </file>
  58. </client>
  59. # Verify data after the test has been "shot"
  60. <verify>
  61. <protocol>
  62. PUT /%TESTNUMBER HTTP/1.1
  63. Host: %HOSTIP:%HTTPPORT
  64. User-Agent: curl/%VERSION
  65. Accept: */*
  66. Content-Length: 85
  67. Expect: 100-continue
  68. This is data we upload with PUT
  69. a second line
  70. line three
  71. four is the number of lines
  72. PUT /%TESTNUMBER HTTP/1.1
  73. Host: %HOSTIP:%HTTPPORT
  74. Authorization: Basic dGVzdHVzZXI6dGVzdHBhc3M=
  75. User-Agent: curl/%VERSION
  76. Accept: */*
  77. Content-Length: 85
  78. Expect: 100-continue
  79. This is data we upload with PUT
  80. a second line
  81. line three
  82. four is the number of lines
  83. </protocol>
  84. </verify>
  85. </testcase>