test155 3.7 KB

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