aboutsummaryrefslogtreecommitdiff
path: root/test/tftptest.lua
diff options
context:
space:
mode:
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")