lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame^] | 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
|
| 18 | Date: Thu, 09 Nov 2010 14:49:00 GMT
|
| 19 | Server: test-server/fake swsclose
|
| 20 | Content-Type: text/html
|
| 21 | Funny-head: yesyes
|
| 22 | Location: ftp://127.0.0.1:8992/10280002
|
| 23 | Content-Length: 0
|
| 24 | Connection: close
|
| 25 |
|
| 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
|
| 64 | Host: %HOSTIP:%HTTPPORT
|
| 65 | Accept: */*
|
| 66 |
|
| 67 | USER anonymous
|
| 68 | PASS ftp@example.com
|
| 69 | PWD
|
| 70 | EPSV
|
| 71 | TYPE I
|
| 72 | SIZE 10280002
|
| 73 | RETR 10280002
|
| 74 | QUIT
|
| 75 | </protocol> |
| 76 | <stdout> |
| 77 | HTTP/1.1 302 OK
|
| 78 | Date: Thu, 09 Nov 2010 14:49:00 GMT
|
| 79 | Server: test-server/fake swsclose
|
| 80 | Content-Type: text/html
|
| 81 | Funny-head: yesyes
|
| 82 | Location: ftp://%HOSTIP:%FTPPORT/10280002
|
| 83 | Content-Length: 0
|
| 84 | Connection: close
|
| 85 |
|
| 86 | data |
| 87 | to |
| 88 | see |
| 89 | that FTP |
| 90 | works |
| 91 | so does it? |
| 92 | </stdout> |
| 93 | </verify> |
| 94 | </testcase> |