test1412 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. <testcase>
  2. <info>
  3. <keywords>
  4. HTTP
  5. HTTP GET
  6. HTTP Digest auth
  7. --anyauth
  8. </keywords>
  9. </info>
  10. # Server-side
  11. <reply>
  12. <servercmd>
  13. auth_required
  14. </servercmd>
  15. <data>
  16. HTTP/1.1 401 Authorization Required swsclose
  17. Server: Apache/1.3.27 (Darwin) PHP/4.1.2
  18. WWW-Authenticate: Blackmagic realm="gimme all yer s3cr3ts"
  19. WWW-Authenticate: Basic realm="gimme all yer s3cr3ts"
  20. WWW-Authenticate: Digest realm="gimme all yer s3cr3ts", nonce="11223344"
  21. Content-Type: text/html; charset=iso-8859-1
  22. Connection: close
  23. This is not the real page
  24. </data>
  25. # This is supposed to be returned when the server gets a
  26. # Authorization: Digest line passed-in from the client
  27. <data1000>
  28. HTTP/1.1 200 OK swsclose
  29. Server: Apache/1.3.27 (Darwin) PHP/4.1.2
  30. Content-Type: text/html; charset=iso-8859-1
  31. Content-Length: 23
  32. Connection: close
  33. This IS the real page!
  34. </data1000>
  35. # This is the second request
  36. <data1001>
  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. Content-Length: 23
  41. Connection: close
  42. This IS the second real page!
  43. </data1001>
  44. <datacheck>
  45. HTTP/1.1 401 Authorization Required swsclose
  46. Server: Apache/1.3.27 (Darwin) PHP/4.1.2
  47. WWW-Authenticate: Blackmagic realm="gimme all yer s3cr3ts"
  48. WWW-Authenticate: Basic realm="gimme all yer s3cr3ts"
  49. WWW-Authenticate: Digest realm="gimme all yer s3cr3ts", nonce="11223344"
  50. Content-Type: text/html; charset=iso-8859-1
  51. Connection: close
  52. HTTP/1.1 200 OK swsclose
  53. Server: Apache/1.3.27 (Darwin) PHP/4.1.2
  54. Content-Type: text/html; charset=iso-8859-1
  55. Content-Length: 23
  56. Connection: close
  57. This IS the real page!
  58. </datacheck>
  59. </reply>
  60. # Client-side
  61. <client>
  62. <server>
  63. http
  64. </server>
  65. <features>
  66. !SSPI
  67. crypto
  68. </features>
  69. <name>
  70. HTTP GET with --anyauth with two URLs (picking Digest)
  71. </name>
  72. <command>
  73. http://%HOSTIP:%HTTPPORT/1412 -u testuser:testpass --anyauth http://%HOSTIP:%HTTPPORT/14120001
  74. </command>
  75. <file name="log/put1412">
  76. This is data we upload with PUT
  77. a second line
  78. line three
  79. four is the number of lines
  80. </file>
  81. </client>
  82. # Verify data after the test has been "shot"
  83. <verify>
  84. <strip>
  85. ^User-Agent:.*
  86. </strip>
  87. <protocol>
  88. GET /1412 HTTP/1.1
  89. Host: %HOSTIP:%HTTPPORT
  90. Accept: */*
  91. GET /1412 HTTP/1.1
  92. Host: %HOSTIP:%HTTPPORT
  93. Authorization: Digest username="testuser", realm="gimme all yer s3cr3ts", nonce="11223344", uri="/1412", response="0390dbe89e31adca0413d11f91f30e7f"
  94. User-Agent: curl/7.10.5 (i686-pc-linux-gnu) libcurl/7.10.5 OpenSSL/0.9.7a ipv6 zlib/1.1.3
  95. Accept: */*
  96. GET /14120001 HTTP/1.1
  97. Host: %HOSTIP:%HTTPPORT
  98. Authorization: Digest username="testuser", realm="gimme all yer s3cr3ts", nonce="11223344", uri="/14120001", response="0085df91870374c8bf4e94415e7fbf8e"
  99. User-Agent: curl/7.10.5 (i686-pc-linux-gnu) libcurl/7.10.5 OpenSSL/0.9.7a ipv6 zlib/1.1.3
  100. Accept: */*
  101. </protocol>
  102. </verify>
  103. </testcase>