test72 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. <testcase>
  2. <info>
  3. <keywords>
  4. HTTP
  5. HTTP GET
  6. HTTP Digest auth
  7. </keywords>
  8. </info>
  9. # Server-side
  10. <reply>
  11. <data>
  12. HTTP/1.1 401 Authorization Required
  13. Server: Apache/1.3.27 (Darwin) PHP/4.1.2
  14. WWW-Authenticate: Basic realm="foothis"
  15. WWW-Authenticate: Digest realm="testrealm", nonce="1053604199"
  16. Content-Type: text/html; charset=iso-8859-1
  17. Content-Length: 26
  18. This is not the real page
  19. </data>
  20. # This is supposed to be returned when the server gets a
  21. # Authorization: Digest line passed-in from the client
  22. <data1000>
  23. HTTP/1.1 200 OK
  24. Server: Apache/1.3.27 (Darwin) PHP/4.1.2
  25. Content-Type: text/html; charset=iso-8859-1
  26. Content-Length: 23
  27. This IS the real page!
  28. </data1000>
  29. <datacheck>
  30. HTTP/1.1 401 Authorization Required
  31. Server: Apache/1.3.27 (Darwin) PHP/4.1.2
  32. WWW-Authenticate: Basic realm="foothis"
  33. WWW-Authenticate: Digest realm="testrealm", nonce="1053604199"
  34. Content-Type: text/html; charset=iso-8859-1
  35. Content-Length: 26
  36. HTTP/1.1 200 OK
  37. Server: Apache/1.3.27 (Darwin) PHP/4.1.2
  38. Content-Type: text/html; charset=iso-8859-1
  39. Content-Length: 23
  40. This IS the real page!
  41. </datacheck>
  42. </reply>
  43. # Client-side
  44. <client>
  45. <server>
  46. http
  47. </server>
  48. <features>
  49. crypto
  50. </features>
  51. <name>
  52. HTTP with Digest *OR* Basic authorization
  53. </name>
  54. <command>
  55. http://%HOSTIP:%HTTPPORT/72 -u testuser:testpass --anyauth
  56. </command>
  57. </client>
  58. # Verify data after the test has been "shot"
  59. <verify>
  60. <strip>
  61. ^User-Agent:.*
  62. </strip>
  63. <protocol>
  64. GET /72 HTTP/1.1
  65. User-Agent: curl/7.10.6-pre1 (i686-pc-linux-gnu) libcurl/7.10.6-pre1 OpenSSL/0.9.7a ipv6 zlib/1.1.3
  66. Host: %HOSTIP:%HTTPPORT
  67. Accept: */*
  68. GET /72 HTTP/1.1
  69. Authorization: Digest username="testuser", realm="testrealm", nonce="1053604199", uri="/72", response="9fcd1330377365a09bbcb33b2cbb25bd"
  70. User-Agent: curl/7.10.6-pre1 (i686-pc-linux-gnu) libcurl/7.10.6-pre1 OpenSSL/0.9.7a ipv6 zlib/1.1.3
  71. Host: %HOSTIP:%HTTPPORT
  72. Accept: */*
  73. </protocol>
  74. </verify>
  75. </testcase>