1<testcase>
2<info>
3<keywords>
4HTTP
5HTTP GET
6followlocation
7FTP
8PASV
9FILE
10</keywords>
11</info>
12
13#
14# Server-side
15<reply>
16<data1>
17HTTP/1.1 302 OK
18Date: Thu, 09 Nov 2010 14:49:00 GMT
19Server: test-server/fake swsclose
20Content-Type: text/html
21Funny-head: yesyes
22Location: ftp://127.0.0.1:8992/10280002
23Content-Length: 0
24Connection: close
25
26</data1>
27<data2>
28data
29    to
30      see
31that FTP
32works
33  so does it?
34</data2>
35</reply>
36
37#
38# Client-side
39<client>
40<server>
41http
42ftp
43</server>
44 <name>
45HTTP Location: redirect to FTP URL
46 </name>
47 <command>
48http://%HOSTIP:%HTTPPORT/10280001 -L
49</command>
50# The data section doesn't do variable substitution, so we must assert this
51<precheck>
52perl -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>
63GET /10280001 HTTP/1.1
64Host: %HOSTIP:%HTTPPORT
65Accept: */*
66
67USER anonymous
68PASS ftp@example.com
69PWD
70EPSV
71TYPE I
72SIZE 10280002
73RETR 10280002
74QUIT
75</protocol>
76<stdout>
77HTTP/1.1 302 OK
78Date: Thu, 09 Nov 2010 14:49:00 GMT
79Server: test-server/fake swsclose
80Content-Type: text/html
81Funny-head: yesyes
82Location: ftp://%HOSTIP:%FTPPORT/10280002
83Content-Length: 0
84Connection: close
85
86data
87    to
88      see
89that FTP
90works
91  so does it?
92</stdout>
93</verify>
94</testcase>
95