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