test154 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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. crypto
  58. </features>
  59. <name>
  60. HTTP PUT with --anyauth authorization (picking Digest)
  61. </name>
  62. <command>
  63. http://%HOSTIP:%HTTPPORT/154 -T log/put154 -u testuser:testpass --anyauth
  64. </command>
  65. <file name="log/put154">
  66. This is data we upload with PUT
  67. a second line
  68. line three
  69. four is the number of lines
  70. </file>
  71. </client>
  72. # Verify data after the test has been "shot"
  73. <verify>
  74. <strip>
  75. ^User-Agent:.*
  76. </strip>
  77. <protocol>
  78. PUT /154 HTTP/1.1
  79. Host: %HOSTIP:%HTTPPORT
  80. Accept: */*
  81. Content-Length: 85
  82. Expect: 100-continue
  83. PUT /154 HTTP/1.1
  84. Authorization: Digest username="testuser", realm="gimme all yer s3cr3ts", nonce="11223344", uri="/154", response="b71551e12d1c456e47d8388ecb2edeca"
  85. User-Agent: curl/7.10.5 (i686-pc-linux-gnu) libcurl/7.10.5 OpenSSL/0.9.7a ipv6 zlib/1.1.3
  86. Host: %HOSTIP:%HTTPPORT
  87. Accept: */*
  88. Content-Length: 85
  89. Expect: 100-continue
  90. This is data we upload with PUT
  91. a second line
  92. line three
  93. four is the number of lines
  94. </protocol>
  95. </verify>
  96. </testcase>