diff options
| author | Diego Nehab <diego@tecgraf.puc-rio.br> | 2003-08-31 00:58:07 +0000 |
|---|---|---|
| committer | Diego Nehab <diego@tecgraf.puc-rio.br> | 2003-08-31 00:58:07 +0000 |
| commit | 6789b83ff5c15296267f880d3b98cf8a1800c30a (patch) | |
| tree | 9571dc81cb0147218332cda34b7ccdfed37ddbbc /test | |
| parent | c51d4acf1c2a8675a3bb043e799ff4390cef47d6 (diff) | |
| download | luasocket-6789b83ff5c15296267f880d3b98cf8a1800c30a.tar.gz luasocket-6789b83ff5c15296267f880d3b98cf8a1800c30a.tar.bz2 luasocket-6789b83ff5c15296267f880d3b98cf8a1800c30a.zip | |
Starting to use RCS in princeton again. Not behind a firewall anymore.
Diffstat (limited to 'test')
| -rw-r--r-- | test/ftptest.lua | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/test/ftptest.lua b/test/ftptest.lua index 6ba61a4..37e3edc 100644 --- a/test/ftptest.lua +++ b/test/ftptest.lua | |||
| @@ -47,9 +47,9 @@ check(not back and err == e, err) | |||
| 47 | 47 | ||
| 48 | io.write("testing anonymous file upload: ") | 48 | io.write("testing anonymous file upload: ") |
| 49 | os.remove("/var/ftp/pub/index.up.html") | 49 | os.remove("/var/ftp/pub/index.up.html") |
| 50 | err = socket.ftp.put("ftp://localhost/pub/index.up.html;type=i", index) | 50 | ret, err = socket.ftp.put("ftp://localhost/pub/index.up.html;type=i", index) |
| 51 | saved = readfile("/var/ftp/pub/index.up.html") | 51 | saved = readfile("/var/ftp/pub/index.up.html") |
| 52 | check(not err and saved == index, err) | 52 | check(ret and not err and saved == index, err) |
| 53 | 53 | ||
| 54 | io.write("testing anonymous file download: ") | 54 | io.write("testing anonymous file download: ") |
| 55 | back, err = socket.ftp.get("ftp://localhost/pub/index.up.html;type=i") | 55 | back, err = socket.ftp.get("ftp://localhost/pub/index.up.html;type=i") |
| @@ -65,9 +65,9 @@ check(not err and back == index, err) | |||
| 65 | 65 | ||
| 66 | io.write("testing authenticated upload: ") | 66 | io.write("testing authenticated upload: ") |
| 67 | os.remove("/home/luasocket/index.up.html") | 67 | os.remove("/home/luasocket/index.up.html") |
| 68 | err = socket.ftp.put("ftp://luasocket:password@localhost/index.up.html;type=i", index) | 68 | ret, err = socket.ftp.put("ftp://luasocket:password@localhost/index.up.html;type=i", index) |
| 69 | saved = readfile("/home/luasocket/index.up.html") | 69 | saved = readfile("/home/luasocket/index.up.html") |
| 70 | check(not err and saved == index, err) | 70 | check(ret and not err and saved == index, err) |
| 71 | 71 | ||
| 72 | io.write("testing authenticated download: ") | 72 | io.write("testing authenticated download: ") |
| 73 | back, err = socket.ftp.get("ftp://luasocket:password@localhost/index.up.html;type=i") | 73 | back, err = socket.ftp.get("ftp://luasocket:password@localhost/index.up.html;type=i") |
| @@ -97,13 +97,13 @@ back, err = socket.ftp.get("ftp://localhost/pub;type=d") | |||
| 97 | check(similar(back, expected)) | 97 | check(similar(back, expected)) |
| 98 | 98 | ||
| 99 | io.write("testing upload denial: ") | 99 | io.write("testing upload denial: ") |
| 100 | err = socket.ftp.put("ftp://localhost/index.up.html;type=a", index) | 100 | ret, err = socket.ftp.put("ftp://localhost/index.up.html;type=a", index) |
| 101 | check(err, err) | 101 | check(err, err) |
| 102 | 102 | ||
| 103 | io.write("testing authentication failure: ") | 103 | io.write("testing authentication failure: ") |
| 104 | err = socket.ftp.put("ftp://luasocket:wrong@localhost/index.html;type=a", index) | 104 | ret, err = socket.ftp.put("ftp://luasocket:wrong@localhost/index.html;type=a", index) |
| 105 | print(err) | 105 | print(err) |
| 106 | check(err, err) | 106 | check(not ret and err, err) |
| 107 | 107 | ||
| 108 | io.write("testing wrong file: ") | 108 | io.write("testing wrong file: ") |
| 109 | back, err = socket.ftp.get("ftp://localhost/index.wrong.html;type=a") | 109 | back, err = socket.ftp.get("ftp://localhost/index.wrong.html;type=a") |
