aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/ftptest.lua14
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
48io.write("testing anonymous file upload: ") 48io.write("testing anonymous file upload: ")
49os.remove("/var/ftp/pub/index.up.html") 49os.remove("/var/ftp/pub/index.up.html")
50err = socket.ftp.put("ftp://localhost/pub/index.up.html;type=i", index) 50ret, err = socket.ftp.put("ftp://localhost/pub/index.up.html;type=i", index)
51saved = readfile("/var/ftp/pub/index.up.html") 51saved = readfile("/var/ftp/pub/index.up.html")
52check(not err and saved == index, err) 52check(ret and not err and saved == index, err)
53 53
54io.write("testing anonymous file download: ") 54io.write("testing anonymous file download: ")
55back, err = socket.ftp.get("ftp://localhost/pub/index.up.html;type=i") 55back, 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
66io.write("testing authenticated upload: ") 66io.write("testing authenticated upload: ")
67os.remove("/home/luasocket/index.up.html") 67os.remove("/home/luasocket/index.up.html")
68err = socket.ftp.put("ftp://luasocket:password@localhost/index.up.html;type=i", index) 68ret, err = socket.ftp.put("ftp://luasocket:password@localhost/index.up.html;type=i", index)
69saved = readfile("/home/luasocket/index.up.html") 69saved = readfile("/home/luasocket/index.up.html")
70check(not err and saved == index, err) 70check(ret and not err and saved == index, err)
71 71
72io.write("testing authenticated download: ") 72io.write("testing authenticated download: ")
73back, err = socket.ftp.get("ftp://luasocket:password@localhost/index.up.html;type=i") 73back, 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")
97check(similar(back, expected)) 97check(similar(back, expected))
98 98
99io.write("testing upload denial: ") 99io.write("testing upload denial: ")
100err = socket.ftp.put("ftp://localhost/index.up.html;type=a", index) 100ret, err = socket.ftp.put("ftp://localhost/index.up.html;type=a", index)
101check(err, err) 101check(err, err)
102 102
103io.write("testing authentication failure: ") 103io.write("testing authentication failure: ")
104err = socket.ftp.put("ftp://luasocket:wrong@localhost/index.html;type=a", index) 104ret, err = socket.ftp.put("ftp://luasocket:wrong@localhost/index.html;type=a", index)
105print(err) 105print(err)
106check(err, err) 106check(not ret and err, err)
107 107
108io.write("testing wrong file: ") 108io.write("testing wrong file: ")
109back, err = socket.ftp.get("ftp://localhost/index.wrong.html;type=a") 109back, err = socket.ftp.get("ftp://localhost/index.wrong.html;type=a")