aboutsummaryrefslogtreecommitdiff
path: root/test/tftptest.lua
diff options
context:
space:
mode:
authorDiego Nehab <diego@tecgraf.puc-rio.br>2001-01-25 21:59:39 +0000
committerDiego Nehab <diego@tecgraf.puc-rio.br>2001-01-25 21:59:39 +0000
commit7096b8df82eebfe857e0043bc8a853353bd78480 (patch)
treef5cdc12138e9526896ff5f8fe9e3ffaa0c47fc0c /test/tftptest.lua
parent68f51243b38bf1e32d471e9cc9ddf12a25110e80 (diff)
downloadluasocket-7096b8df82eebfe857e0043bc8a853353bd78480.tar.gz
luasocket-7096b8df82eebfe857e0043bc8a853353bd78480.tar.bz2
luasocket-7096b8df82eebfe857e0043bc8a853353bd78480.zip
Initial revision
Diffstat (limited to 'test/tftptest.lua')
-rw-r--r--test/tftptest.lua16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/tftptest.lua b/test/tftptest.lua
new file mode 100644
index 0000000..7fb8253
--- /dev/null
+++ b/test/tftptest.lua
@@ -0,0 +1,16 @@
1-- load tftpclng.lua
2assert(dofile("../examples/tftpclnt.lua"))
3assert(dofile("auxiliar.lua"))
4
5-- needs tftp server running on localhost, with root pointing to
6-- /home/i/diego/public/html/luasocket/test
7
8host = host or "localhost"
9print("downloading")
10err = tftp_get(host, 69, "test/index.html")
11assert(not err, err)
12original = readfile("/home/i/diego/public/html/luasocket/test/index.html")
13retrieved = readfile("index.html")
14remove("index.html")
15assert(original == retrieved, "files differ!")
16print("passed")