2
0

test155 3.8 KB

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