test154 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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/%TESTNUMBER -T log/put%TESTNUMBER -u testuser:testpass --anyauth
  65. </command>
  66. <file name="log/put%TESTNUMBER">
  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. <protocol>
  76. PUT /%TESTNUMBER HTTP/1.1
  77. Host: %HOSTIP:%HTTPPORT
  78. User-Agent: curl/%VERSION
  79. Accept: */*
  80. Content-Length: 85
  81. Expect: 100-continue
  82. PUT /%TESTNUMBER HTTP/1.1
  83. Host: %HOSTIP:%HTTPPORT
  84. Authorization: Digest username="testuser", realm="gimme all yer s3cr3ts", nonce="11223344", uri="/%TESTNUMBER", response="b71551e12d1c456e47d8388ecb2edeca"
  85. User-Agent: curl/%VERSION
  86. Accept: */*
  87. Content-Length: 85
  88. Expect: 100-continue
  89. This is data we upload with PUT
  90. a second line
  91. line three
  92. four is the number of lines
  93. </protocol>
  94. </verify>
  95. </testcase>