e38c0e0d73e453b4b5b784964ee29731ddf48fa4
[platform/upstream/curl.git] / tests / data / test1100
1 <testcase>
2 <info>
3 <keywords>
4 HTTP
5 HTTP POST
6 HTTP NTLM auth
7 </keywords>
8 </info>
9 # Server-side
10 <reply>
11
12 <data>
13 HTTP/1.1 200 Thanks for this! swsclose\r
14 Content-Length: 25\r
15 \r
16 This is the final page !
17 </data>
18
19 <data1001>
20 HTTP/1.1 401 Now gimme that second request of crap\r
21 Server: Microsoft-IIS/5.0\r
22 Content-Type: text/html; charset=iso-8859-1\r
23 Content-Length: 34\r
24 WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAAAGgoEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA==\r
25 \r
26 This is not the real page either!
27 </data1001>
28
29 # This is supposed to be returned when the server gets the second
30 # Authorization: NTLM line passed-in from the client
31 <data1002>
32 HTTP/1.1 302 Thanks for this, but we want to redir you!\r
33 Server: Microsoft-IIS/5.0\r
34 Content-Type: text/html; charset=iso-8859-1\r
35 Location: /1100\r
36 Content-Length: 34\r
37 \r
38 This is not the real page either!
39 </data1002>
40
41 <datacheck>
42 HTTP/1.1 401 Now gimme that second request of crap\r
43 Server: Microsoft-IIS/5.0\r
44 Content-Type: text/html; charset=iso-8859-1\r
45 Content-Length: 34\r
46 WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAgACADAAAAAGgoEAc51AYVDgyNcAAAAAAAAAAG4AbgAyAAAAQ0MCAAQAQwBDAAEAEgBFAEwASQBTAEEAQgBFAFQASAAEABgAYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAwAsAGUAbABpAHMAYQBiAGUAdABoAC4AYwBjAC4AaQBjAGUAZABlAHYALgBuAHUAAAAAAA==\r
47 \r
48 HTTP/1.1 302 Thanks for this, but we want to redir you!\r
49 Server: Microsoft-IIS/5.0\r
50 Content-Type: text/html; charset=iso-8859-1\r
51 Location: /1100\r
52 Content-Length: 34\r
53 \r
54 HTTP/1.1 200 Thanks for this! swsclose\r
55 Content-Length: 25\r
56 \r
57 This is the final page !
58 </datacheck>
59
60 </reply>
61
62 # Client-side
63 <client>
64 <features>
65 NTLM
66 </features>
67 <server>
68 http
69 </server>
70  <name>
71 HTTP POST with NTLM authorization and following a 302 redirect
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/1100 -u testuser:testpass --ntlm -L -d "stuff to send away" 
81 </command>
82 <precheck>
83 chkhostname curlhost
84 </precheck>
85 </client>
86
87 # Verify data after the test has been "shot"
88 <verify>
89 <strip>
90 ^User-Agent:.*
91 </strip>
92 <protocol>
93 POST /1100 HTTP/1.1\r
94 Authorization: NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA=\r
95 User-Agent: curl/7.10.6-pre1 (i686-pc-linux-gnu) libcurl/7.10.6-pre1 OpenSSL/0.9.7a ipv6 zlib/1.1.3\r
96 Host: %HOSTIP:%HTTPPORT\r
97 Accept: */*\r
98 Content-Length: 0\r
99 Content-Type: application/x-www-form-urlencoded\r
100 \r
101 POST /1100 HTTP/1.1\r
102 Authorization: NTLM TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAAAAABwAAAACAAIAHAAAAAIAAgAeAAAAAAAAAAAAAAABoKBAFpkQwKRCZFMhjj0tw47wEjKHRHlvzfxQamFcheMuv8v+xeqphEO5V41xRd7R9deOXRlc3R1c2VyY3VybGhvc3Q=\r
103 User-Agent: curl/7.10.6-pre1 (i686-pc-linux-gnu) libcurl/7.10.6-pre1 OpenSSL/0.9.7a ipv6 zlib/1.1.3\r
104 Host: %HOSTIP:%HTTPPORT\r
105 Accept: */*\r
106 Content-Length: 18\r
107 Content-Type: application/x-www-form-urlencoded\r
108 \r
109 stuff to send awayGET /1100 HTTP/1.1\r
110 User-Agent: curl/7.19.5-CVS (i686-pc-linux-gnu) libcurl/7.19.5-CVS GnuTLS/2.6.6 zlib/1.2.3.3 c-ares/1.6.1-CVS libidn/1.14 libssh2/1.1\r
111 Host: %HOSTIP:%HTTPPORT\r
112 Accept: */*\r
113 \r
114 </protocol>
115 </verify>
116 </testcase>