test155 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. <testcase>
  2. # Server-side
  3. <reply>
  4. <servercmd>
  5. auth_required
  6. </servercmd>
  7. <data>
  8. HTTP/1.1 401 NTLM Authorization Required swsclose
  9. Server: Apache/1.3.27 (Darwin) PHP/4.1.2
  10. WWW-Authenticate: Blackmagic realm="gimme all yer s3cr3ts"
  11. WWW-Authenticate: Basic realm="gimme all yer s3cr3ts"
  12. WWW-Authenticate: NTLM
  13. Content-Type: text/html; charset=iso-8859-1
  14. Connection: close
  15. moo
  16. </data>
  17. # This is supposed to be returned when the server gets a first
  18. # Authorization: NTLM line passed-in from the client
  19. <data1001>
  20. HTTP/1.1 401 Type-1 received, send back type-2
  21. Server: Microsoft-IIS/5.0
  22. Content-Length: 34
  23. Content-Type: text/html; charset=iso-8859-1
  24. WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAAAGgoEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA==
  25. This is not the real page either!
  26. </data1001>
  27. # This is supposed to be returned when the server gets the second
  28. # Authorization: NTLM line passed-in from the client
  29. <data1002>
  30. HTTP/1.1 200 Type-3 Recevied and all Things are fine swsclose
  31. Server: Microsoft-IIS/5.0
  32. Content-Type: text/html; charset=iso-8859-1
  33. Content-Length: 32
  34. Finally, this is the real page!
  35. </data1002>
  36. <datacheck>
  37. HTTP/1.1 401 NTLM Authorization Required swsclose
  38. Server: Apache/1.3.27 (Darwin) PHP/4.1.2
  39. WWW-Authenticate: Blackmagic realm="gimme all yer s3cr3ts"
  40. WWW-Authenticate: Basic realm="gimme all yer s3cr3ts"
  41. WWW-Authenticate: NTLM
  42. Content-Type: text/html; charset=iso-8859-1
  43. Connection: close
  44. HTTP/1.1 401 Type-1 received, send back type-2
  45. Server: Microsoft-IIS/5.0
  46. Content-Length: 34
  47. Content-Type: text/html; charset=iso-8859-1
  48. WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAAAGgoEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA==
  49. HTTP/1.1 200 Type-3 Recevied and all Things are fine swsclose
  50. Server: Microsoft-IIS/5.0
  51. Content-Type: text/html; charset=iso-8859-1
  52. Content-Length: 32
  53. Finally, this is the real page!
  54. </datacheck>
  55. </reply>
  56. # Client-side
  57. <client>
  58. <features>
  59. NTLM
  60. </features>
  61. <server>
  62. http
  63. </server>
  64. <name>
  65. HTTP PUT with --anyauth authorization (picking NTLM)
  66. </name>
  67. <setenv>
  68. # we force our own host name, in order to make the test machine independent
  69. CURL_GETHOSTNAME=curlhost
  70. # we try to use the LD_PRELOAD hack, if not a debug build
  71. LD_PRELOAD=%PWD/libtest/.libs/libhostname.so
  72. </setenv>
  73. <command>
  74. http://%HOSTIP:%HTTPPORT/155 -T log/put155 -u testuser:testpass --anyauth
  75. </command>
  76. <precheck>
  77. chkhostname curlhost
  78. </precheck>
  79. <file name="log/put155">
  80. This is data we upload with PUT
  81. a second line
  82. line three
  83. four is the number of lines
  84. </file>
  85. </client>
  86. # Verify data after the test has been "shot"
  87. <verify>
  88. <strip>
  89. ^User-Agent:.*
  90. </strip>
  91. <protocol>
  92. PUT /155 HTTP/1.1
  93. Host: %HOSTIP:%HTTPPORT
  94. Accept: */*
  95. Content-Length: 85
  96. Expect: 100-continue
  97. PUT /155 HTTP/1.1
  98. Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA=
  99. Host: %HOSTIP:%HTTPPORT
  100. Accept: */*
  101. Content-Length: 0
  102. Expect: 100-continue
  103. PUT /155 HTTP/1.1
  104. Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAAIAAgAeAAAAAAAAAAAAAAABoKBAFpkQwKRCZFMhjj0tw47wEjKHRHlvzfxQamFcheMuv8v+xeqphEO5V41xRd7R9deOXRlc3R1c2VyY3VybGhvc3Q=
  105. User-Agent: curl/7.10.5 (i686-pc-linux-gnu) libcurl/7.10.5 OpenSSL/0.9.7a ipv6 zlib/1.1.3
  106. Host: %HOSTIP:%HTTPPORT
  107. Accept: */*
  108. Content-Length: 85
  109. Expect: 100-continue
  110. This is data we upload with PUT
  111. a second line
  112. line three
  113. four is the number of lines
  114. </protocol>
  115. </verify>
  116. </testcase>