aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiego Nehab <diego@tecgraf.puc-rio.br>2001-09-25 21:32:52 +0000
committerDiego Nehab <diego@tecgraf.puc-rio.br>2001-09-25 21:32:52 +0000
commitb319e6a1e86a54c23b4848c5be7c0670f349a63f (patch)
tree649f8e1bb57b363610583d39cfb0eee63d5171bb
parent9f677cdbf4dee43b7fde43e2c673073e623451d9 (diff)
downloadluasocket-b319e6a1e86a54c23b4848c5be7c0670f349a63f.tar.gz
luasocket-b319e6a1e86a54c23b4848c5be7c0670f349a63f.tar.bz2
luasocket-b319e6a1e86a54c23b4848c5be7c0670f349a63f.zip
updated due to test location changes
-rw-r--r--test/tftptest.lua21
1 files changed, 15 insertions, 6 deletions
diff --git a/test/tftptest.lua b/test/tftptest.lua
index 7fb8253..1e9e1d5 100644
--- a/test/tftptest.lua
+++ b/test/tftptest.lua
@@ -1,16 +1,25 @@
1-- load tftpclng.lua 1-- load tftpclng.lua
2assert(dofile("../examples/tftpclnt.lua")) 2assert(dofile("../examples/tftpclnt.lua"))
3assert(dofile("auxiliar.lua"))
4 3
5-- needs tftp server running on localhost, with root pointing to 4-- needs tftp server running on localhost, with root pointing to
6-- /home/i/diego/public/html/luasocket/test 5-- /home/i/diego/public/html/luasocket/test
7 6
8host = host or "localhost" 7function readfile(file)
8 local f = openfile("file", "rb")
9 local a
10 if f then
11 a = read(f, "*a")
12 closefile(f)
13 end
14 return a
15end
16
17host = host or "goya"
9print("downloading") 18print("downloading")
10err = tftp_get(host, 69, "test/index.html") 19err = tftp_get(host, 69, "index.html", "index.got")
11assert(not err, err) 20assert(not err, err)
12original = readfile("/home/i/diego/public/html/luasocket/test/index.html") 21original = readfile("index.index")
13retrieved = readfile("index.html") 22retrieved = readfile("index.got")
14remove("index.html") 23remove("index.got")
15assert(original == retrieved, "files differ!") 24assert(original == retrieved, "files differ!")
16print("passed") 25print("passed")