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