test88 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. <testcase>
  2. <info>
  3. <keywords>
  4. HTTP
  5. HTTP PUT
  6. HTTP Digest auth
  7. </keywords>
  8. </info>
  9. # Server-side
  10. <reply>
  11. <servercmd>
  12. auth_required
  13. </servercmd>
  14. <data>
  15. HTTP/1.1 401 Authorization Required swsclose
  16. Server: Apache/1.3.27 (Darwin) PHP/4.1.2
  17. WWW-Authenticate: Digest realm="testrealm", nonce="1053604145"
  18. Content-Type: text/html; charset=iso-8859-1
  19. Connection: close
  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 swsclose
  26. Server: Apache/1.3.27 (Darwin) PHP/4.1.2
  27. Content-Type: text/html; charset=iso-8859-1
  28. Connection: close
  29. This IS the real page!
  30. </data1000>
  31. <datacheck>
  32. HTTP/1.1 401 Authorization Required swsclose
  33. Server: Apache/1.3.27 (Darwin) PHP/4.1.2
  34. WWW-Authenticate: Digest realm="testrealm", nonce="1053604145"
  35. Content-Type: text/html; charset=iso-8859-1
  36. Connection: close
  37. HTTP/1.1 200 OK swsclose
  38. Server: Apache/1.3.27 (Darwin) PHP/4.1.2
  39. Content-Type: text/html; charset=iso-8859-1
  40. Connection: close
  41. This IS the real page!
  42. </datacheck>
  43. </reply>
  44. # Client-side
  45. <client>
  46. <server>
  47. http
  48. </server>
  49. <features>
  50. crypto
  51. </features>
  52. <name>
  53. HTTP PUT with Digest authorization
  54. </name>
  55. <command>
  56. http://%HOSTIP:%HTTPPORT/88 -T log/put88 -u testuser:testpass --digest
  57. </command>
  58. <file name="log/put88">
  59. This is data we upload with PUT
  60. a second line
  61. line three
  62. four is the number of lines
  63. </file>
  64. </client>
  65. # Verify data after the test has been "shot"
  66. <verify>
  67. <strip>
  68. ^User-Agent:.*
  69. </strip>
  70. <protocol>
  71. PUT /88 HTTP/1.1
  72. Host: %HOSTIP:%HTTPPORT
  73. Accept: */*
  74. Content-Length: 0
  75. Expect: 100-continue
  76. PUT /88 HTTP/1.1
  77. Authorization: Digest username="testuser", realm="testrealm", nonce="1053604145", uri="/88", response="78a49fa53d0c228778297687d4168e71"
  78. User-Agent: curl/7.10.5 (i686-pc-linux-gnu) libcurl/7.10.5 OpenSSL/0.9.7a ipv6 zlib/1.1.3
  79. Host: %HOSTIP:%HTTPPORT
  80. Accept: */*
  81. Content-Length: 85
  82. Expect: 100-continue
  83. This is data we upload with PUT
  84. a second line
  85. line three
  86. four is the number of lines
  87. </protocol>
  88. </verify>
  89. </testcase>