test1030 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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. <data>
  13. HTTP/1.1 401 Authorization Required
  14. Server: Apache/1.3.27 (Darwin) PHP/4.1.2
  15. WWW-Authenticate: Blackmagic realm="gimme all yer s3cr3ts"
  16. WWW-Authenticate: Basic realm="gimme all yer s3cr3ts"
  17. WWW-Authenticate: Digest realm="gimme all yer s3cr3ts", nonce="11223344"
  18. Content-Length: 26
  19. Content-Type: text/html; charset=iso-8859-1
  20. This is not the real page
  21. </data>
  22. # This is supposed to be returned when the server gets a
  23. # Authorization: Digest line passed-in from the client
  24. <data1000>
  25. HTTP/1.1 200 OK
  26. Server: Apache/1.3.27 (Darwin) PHP/4.1.2
  27. Content-Type: text/html; charset=iso-8859-1
  28. Content-Length: 23
  29. Connection: close
  30. This IS the real page!
  31. </data1000>
  32. <datacheck>
  33. HTTP/1.1 401 Authorization Required
  34. Server: Apache/1.3.27 (Darwin) PHP/4.1.2
  35. WWW-Authenticate: Blackmagic realm="gimme all yer s3cr3ts"
  36. WWW-Authenticate: Basic realm="gimme all yer s3cr3ts"
  37. WWW-Authenticate: Digest realm="gimme all yer s3cr3ts", nonce="11223344"
  38. Content-Length: 26
  39. Content-Type: text/html; charset=iso-8859-1
  40. HTTP/1.1 200 OK
  41. Server: Apache/1.3.27 (Darwin) PHP/4.1.2
  42. Content-Type: text/html; charset=iso-8859-1
  43. Content-Length: 23
  44. Connection: close
  45. This IS the real page!
  46. </datacheck>
  47. </reply>
  48. # Client-side
  49. <client>
  50. <server>
  51. http
  52. </server>
  53. <features>
  54. !SSPI
  55. crypto
  56. </features>
  57. <name>
  58. HTTP PUT with --anyauth authorization (picking Digest)
  59. </name>
  60. <command>
  61. http://%HOSTIP:%HTTPPORT/%TESTNUMBER -T %LOGDIR/put%TESTNUMBER -u testuser:testpass --anyauth
  62. </command>
  63. <file name="%LOGDIR/put%TESTNUMBER">
  64. This is data we upload with PUT
  65. a second line
  66. line three
  67. four is the number of lines
  68. </file>
  69. </client>
  70. # Verify data after the test has been "shot"
  71. <verify>
  72. <protocol>
  73. PUT /%TESTNUMBER HTTP/1.1
  74. Host: %HOSTIP:%HTTPPORT
  75. User-Agent: curl/%VERSION
  76. Accept: */*
  77. Content-Length: 85
  78. This is data we upload with PUT
  79. a second line
  80. line three
  81. four is the number of lines
  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="01cb59db1ddaac246b072d5f5f0716d9"
  85. User-Agent: curl/%VERSION
  86. Accept: */*
  87. Content-Length: 85
  88. This is data we upload with PUT
  89. a second line
  90. line three
  91. four is the number of lines
  92. </protocol>
  93. </verify>
  94. </testcase>