Starting to use RCS in princeton again. Not behind a firewall anymore.

This commit is contained in:
Diego Nehab 2003-08-31 00:58:07 +00:00
parent c51d4acf1c
commit 6789b83ff5
6 changed files with 58 additions and 60 deletions

View file

@ -47,9 +47,9 @@ check(not back and err == e, err)
io.write("testing anonymous file upload: ")
os.remove("/var/ftp/pub/index.up.html")
err = socket.ftp.put("ftp://localhost/pub/index.up.html;type=i", index)
ret, err = socket.ftp.put("ftp://localhost/pub/index.up.html;type=i", index)
saved = readfile("/var/ftp/pub/index.up.html")
check(not err and saved == index, err)
check(ret and not err and saved == index, err)
io.write("testing anonymous file download: ")
back, err = socket.ftp.get("ftp://localhost/pub/index.up.html;type=i")
@ -65,9 +65,9 @@ check(not err and back == index, err)
io.write("testing authenticated upload: ")
os.remove("/home/luasocket/index.up.html")
err = socket.ftp.put("ftp://luasocket:password@localhost/index.up.html;type=i", index)
ret, err = socket.ftp.put("ftp://luasocket:password@localhost/index.up.html;type=i", index)
saved = readfile("/home/luasocket/index.up.html")
check(not err and saved == index, err)
check(ret and not err and saved == index, err)
io.write("testing authenticated download: ")
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")
check(similar(back, expected))
io.write("testing upload denial: ")
err = socket.ftp.put("ftp://localhost/index.up.html;type=a", index)
ret, err = socket.ftp.put("ftp://localhost/index.up.html;type=a", index)
check(err, err)
io.write("testing authentication failure: ")
err = socket.ftp.put("ftp://luasocket:wrong@localhost/index.html;type=a", index)
ret, err = socket.ftp.put("ftp://luasocket:wrong@localhost/index.html;type=a", index)
print(err)
check(err, err)
check(not ret and err, err)
io.write("testing wrong file: ")
back, err = socket.ftp.get("ftp://localhost/index.wrong.html;type=a")