test155 3.7 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 TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA==
  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 Received 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 TlRMTVNTUAACAAAAAgACADAAAACGggEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA==
  56. HTTP/1.1 200 Type-3 Received 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. SSL
  68. !SSPI
  69. debug
  70. </features>
  71. <server>
  72. http
  73. </server>
  74. <name>
  75. HTTP PUT with --anyauth authorization (picking NTLM)
  76. </name>
  77. <setenv>
  78. # we force our own host name, in order to make the test machine independent
  79. CURL_GETHOSTNAME=curlhost
  80. # we try to use the LD_PRELOAD hack, if not a debug build
  81. LD_PRELOAD=%PWD/libtest/.libs/libhostname.so
  82. </setenv>
  83. <command>
  84. http://%HOSTIP:%HTTPPORT/%TESTNUMBER -T log/put%TESTNUMBER -u testuser:testpass --anyauth
  85. </command>
  86. <precheck>
  87. chkhostname curlhost
  88. </precheck>
  89. <file name="log/put%TESTNUMBER">
  90. This is data we upload with PUT
  91. a second line
  92. line three
  93. four is the number of lines
  94. </file>
  95. </client>
  96. # Verify data after the test has been "shot"
  97. <verify>
  98. <protocol>
  99. PUT /%TESTNUMBER HTTP/1.1
  100. Host: %HOSTIP:%HTTPPORT
  101. User-Agent: curl/%VERSION
  102. Accept: */*
  103. Content-Length: 85
  104. Expect: 100-continue
  105. PUT /%TESTNUMBER HTTP/1.1
  106. Host: %HOSTIP:%HTTPPORT
  107. Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA=
  108. User-Agent: curl/%VERSION
  109. Accept: */*
  110. Content-Length: 0
  111. PUT /%TESTNUMBER HTTP/1.1
  112. Host: %HOSTIP:%HTTPPORT
  113. Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAAIAAgAeAAAAAAAAAAAAAAAhoIBAFpkQwKRCZFMhjj0tw47wEjKHRHlvzfxQamFcheMuv8v+xeqphEO5V41xRd7R9deOXRlc3R1c2VyY3VybGhvc3Q=
  114. User-Agent: curl/%VERSION
  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>