test154 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. <testcase>
  2. <info>
  3. <keywords>
  4. HTTP
  5. HTTP PUT
  6. HTTP Digest auth
  7. --anyauth
  8. </keywords>
  9. </info>
  10. # Server-side
  11. <reply>
  12. <servercmd>
  13. auth_required
  14. </servercmd>
  15. <data>
  16. HTTP/1.1 401 Authorization Required swsclose
  17. Server: Apache/1.3.27 (Darwin) PHP/4.1.2
  18. WWW-Authenticate: Blackmagic realm="gimme all yer s3cr3ts"
  19. WWW-Authenticate: Basic realm="gimme all yer s3cr3ts"
  20. WWW-Authenticate: Digest realm="gimme all yer s3cr3ts", nonce="11223344"
  21. Content-Type: text/html; charset=iso-8859-1
  22. Connection: close
  23. This is not the real page
  24. </data>
  25. # This is supposed to be returned when the server gets a
  26. # Authorization: Digest line passed-in from the client
  27. <data1000>
  28. HTTP/1.1 200 OK swsclose
  29. Server: Apache/1.3.27 (Darwin) PHP/4.1.2
  30. Content-Type: text/html; charset=iso-8859-1
  31. Content-Length: 23
  32. Connection: close
  33. This IS the real page!
  34. </data1000>
  35. <datacheck>
  36. HTTP/1.1 401 Authorization Required swsclose
  37. Server: Apache/1.3.27 (Darwin) PHP/4.1.2
  38. WWW-Authenticate: Blackmagic realm="gimme all yer s3cr3ts"
  39. WWW-Authenticate: Basic realm="gimme all yer s3cr3ts"
  40. WWW-Authenticate: Digest realm="gimme all yer s3cr3ts", nonce="11223344"
  41. Content-Type: text/html; charset=iso-8859-1
  42. Connection: close
  43. HTTP/1.1 200 OK swsclose
  44. Server: Apache/1.3.27 (Darwin) PHP/4.1.2
  45. Content-Type: text/html; charset=iso-8859-1
  46. Content-Length: 23
  47. Connection: close
  48. This IS the real page!
  49. </datacheck>
  50. </reply>
  51. # Client-side
  52. <client>
  53. <server>
  54. http
  55. </server>
  56. <features>
  57. !SSPI
  58. crypto
  59. </features>
  60. <name>
  61. HTTP PUT with --anyauth authorization (picking Digest)
  62. </name>
  63. <command>
  64. http://%HOSTIP:%HTTPPORT/154 -T log/put154 -u testuser:testpass --anyauth
  65. </command>
  66. <file name="log/put154">
  67. This is data we upload with PUT
  68. a second line
  69. line three
  70. four is the number of lines
  71. </file>
  72. </client>
  73. # Verify data after the test has been "shot"
  74. <verify>
  75. <strip>
  76. ^User-Agent:.*
  77. </strip>
  78. <protocol>
  79. PUT /154 HTTP/1.1
  80. Host: %HOSTIP:%HTTPPORT
  81. Accept: */*
  82. Content-Length: 85
  83. Expect: 100-continue
  84. PUT /154 HTTP/1.1
  85. Host: %HOSTIP:%HTTPPORT
  86. Authorization: Digest username="testuser", realm="gimme all yer s3cr3ts", nonce="11223344", uri="/154", response="b71551e12d1c456e47d8388ecb2edeca"
  87. User-Agent: curl/7.10.5 (i686-pc-linux-gnu) libcurl/7.10.5 OpenSSL/0.9.7a ipv6 zlib/1.1.3
  88. Accept: */*
  89. Content-Length: 85
  90. Expect: 100-continue
  91. This is data we upload with PUT
  92. a second line
  93. line three
  94. four is the number of lines
  95. </protocol>
  96. </verify>
  97. </testcase>