test2040 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <testcase>
  2. <info>
  3. <keywords>
  4. HTTP
  5. HTTP GET
  6. HTTP Basic auth
  7. </keywords>
  8. </info>
  9. # Server-side
  10. <reply>
  11. <!-- First request has Basic auth, right password -->
  12. <data100>
  13. HTTP/1.1 200 Things are fine in server land
  14. Server: Microsoft-IIS/5.0
  15. Content-Type: text/html; charset=iso-8859-1
  16. Content-Length: 32
  17. Finally, this is the real page!
  18. </data100>
  19. <!-- Second request with Basic auth disabled -->
  20. <data200>
  21. HTTP/1.1 401 Sorry wrong password (2)
  22. Server: Microsoft-IIS/5.0
  23. Content-Type: text/html; charset=iso-8859-1
  24. Content-Length: 29
  25. WWW-Authenticate: Basic realm="testrealm"
  26. This is a bad password page!
  27. </data200>
  28. </reply>
  29. # Client-side
  30. <client>
  31. <server>
  32. http
  33. </server>
  34. <name>
  35. HTTP Basic authorization, then without authorization
  36. </name>
  37. <command option="no-output,no-include">
  38. -u testuser:testpass http://%HOSTIP:%HTTPPORT/%TESTNUMBER0100 --next --no-basic http://%HOSTIP:%HTTPPORT/%TESTNUMBER0200
  39. </command>
  40. </client>
  41. # Verify data after the test has been "shot"
  42. <verify>
  43. <protocol>
  44. GET /%TESTNUMBER0100 HTTP/1.1
  45. Host: %HOSTIP:%HTTPPORT
  46. Authorization: Basic dGVzdHVzZXI6dGVzdHBhc3M=
  47. User-Agent: curl/%VERSION
  48. Accept: */*
  49. GET /%TESTNUMBER0200 HTTP/1.1
  50. Host: %HOSTIP:%HTTPPORT
  51. User-Agent: curl/%VERSION
  52. Accept: */*
  53. </protocol>
  54. <stdout>
  55. Finally, this is the real page!
  56. This is a bad password page!
  57. </stdout>
  58. </verify>
  59. </testcase>