Git init
[external/curl.git] / tests / data / test1028
1 <testcase>
2 <info>
3 <keywords>
4 HTTP
5 HTTP GET
6 followlocation
7 FTP
8 PASV
9 FILE
10 </keywords>
11 </info>
12
13 #
14 # Server-side
15 <reply>
16 <data1>
17 HTTP/1.1 302 OK\r
18 Date: Thu, 09 Nov 2010 14:49:00 GMT\r
19 Server: test-server/fake swsclose\r
20 Content-Type: text/html\r
21 Funny-head: yesyes\r
22 Location: ftp://127.0.0.1:8992/10280002\r
23 Content-Length: 0\r
24 Connection: close\r
25 \r
26 </data1>
27 <data2>
28 data
29     to
30       see
31 that FTP
32 works
33   so does it?
34 </data2>
35 </reply>
36
37 #
38 # Client-side
39 <client>
40 <server>
41 http
42 ftp
43 </server>
44  <name>
45 HTTP Location: redirect to FTP URL
46  </name>
47  <command>
48 http://%HOSTIP:%HTTPPORT/10280001 -L
49 </command>
50 # The data section doesn't do variable substitution, so we must assert this
51 <precheck>
52 perl -e "print 'Test requires default test server host and port' if ( '%HOSTIP' ne '127.0.0.1' || '%FTPPORT' ne '8992' );"
53 </precheck>
54 </client>
55
56 #
57 # Verify data after the test has been "shot"
58 <verify>
59 <strip>
60 ^User-Agent:.*
61 </strip>
62 <protocol>
63 GET /10280001 HTTP/1.1\r
64 Host: %HOSTIP:%HTTPPORT\r
65 Accept: */*\r
66 \r
67 USER anonymous\r
68 PASS ftp@example.com\r
69 PWD\r
70 EPSV\r
71 TYPE I\r
72 SIZE 10280002\r
73 RETR 10280002\r
74 QUIT\r
75 </protocol>
76 <stdout>
77 HTTP/1.1 302 OK\r
78 Date: Thu, 09 Nov 2010 14:49:00 GMT\r
79 Server: test-server/fake swsclose\r
80 Content-Type: text/html\r
81 Funny-head: yesyes\r
82 Location: ftp://%HOSTIP:%FTPPORT/10280002\r
83 Content-Length: 0\r
84 Connection: close\r
85 \r
86 data
87     to
88       see
89 that FTP
90 works
91   so does it?
92 </stdout>
93 </verify>
94 </testcase>