test1030 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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/1030 -T log/put1030 -u testuser:testpass --anyauth
  62. </command>
  63. <file name="log/put1030">
  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. <strip>
  73. ^User-Agent:.*
  74. </strip>
  75. <protocol>
  76. PUT /1030 HTTP/1.1
  77. Host: %HOSTIP:%HTTPPORT
  78. Accept: */*
  79. Content-Length: 85
  80. Expect: 100-continue
  81. This is data we upload with PUT
  82. a second line
  83. line three
  84. four is the number of lines
  85. PUT /1030 HTTP/1.1
  86. Authorization: Digest username="testuser", realm="gimme all yer s3cr3ts", nonce="11223344", uri="/1030", response="01cb59db1ddaac246b072d5f5f0716d9"
  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. Host: %HOSTIP:%HTTPPORT
  89. Accept: */*
  90. Content-Length: 85
  91. Expect: 100-continue
  92. This is data we upload with PUT
  93. a second line
  94. line three
  95. four is the number of lines
  96. </protocol>
  97. </verify>
  98. </testcase>