1<testcase> 2<info> 3<keywords> 4FTP 5RETR 6-J 7</keywords> 8</info> 9 10# Server-side 11<reply> 12# file%TESTNUMBER contents... 13<data nocheck="yes"> 14HTTP/1.1 200 OK 15Date: Tue, 09 Nov 2010 14:49:00 GMT 16Server: test-server/fake 17Content-Length: 6 18Connection: close 19Content-Type: text/html 20Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange 21 22MOOOO 23</data> 24</reply> 25 26# Client-side 27<client> 28# this relies on the debug feature to allow us to set directory to store the 29# -O output in, using the CURL_TESTDIR variable 30<features> 31Debug 32</features> 33<server> 34ftp 35</server> 36<name> 37FTP download, file with C-D inside, using -O -J -D file 38</name> 39<setenv> 40CURL_TESTDIR=%LOGDIR 41</setenv> 42<command option="no-output,no-include"> 43ftp://%HOSTIP:%FTPPORT/path/file%TESTNUMBER -O -J -D %LOGDIR/heads%TESTNUMBER 44</command> 45</client> 46 47# Verify data after the test has been "shot" 48<verify> 49<strip> 50QUIT 51</strip> 52<protocol> 53USER anonymous 54PASS ftp@example.com 55PWD 56CWD path 57EPSV 58TYPE I 59SIZE file%TESTNUMBER 60RETR file%TESTNUMBER 61QUIT 62</protocol> 63 64<file1 name="%LOGDIR/file%TESTNUMBER"> 65HTTP/1.1 200 OK 66Date: Tue, 09 Nov 2010 14:49:00 GMT 67Server: test-server/fake 68Content-Length: 6 69Connection: close 70Content-Type: text/html 71Content-Disposition: filename=name%TESTNUMBER; charset=funny; option=strange 72 73MOOOO 74</file1> 75 76<file2 name="%LOGDIR/heads%TESTNUMBER"> 77220- _ _ ____ _ 78220- ___| | | | _ \| | 79220- / __| | | | |_) | | 80220- | (__| |_| | _ {| |___ 81220 \___|\___/|_| \_\_____| 82331 We are happy you popped in! 83230 Welcome you silly person 84257 "/" is current directory 85250 CWD command successful. 86229 Entering Passive Mode (stripped) 87200 I modify TYPE as you wanted 88213 214 89150 Binary data connection for %TESTNUMBER () (214 bytes). 90226 File transfer complete 91</file2> 92<stripfile2> 93s/^(229 Entering Passive Mode \().*(\).*)/${1}stripped${2}/ 94</stripfile2> 95 96<file3 name="%LOGDIR/stdout%TESTNUMBER"> 97</file3> 98 99<notexists> 100%LOGDIR/name%TESTNUMBER 101</notexists> 102</verify> 103</testcase> 104