diff options
| author | Diego Nehab <diego@tecgraf.puc-rio.br> | 2001-01-25 21:59:39 +0000 |
|---|---|---|
| committer | Diego Nehab <diego@tecgraf.puc-rio.br> | 2001-01-25 21:59:39 +0000 |
| commit | 7096b8df82eebfe857e0043bc8a853353bd78480 (patch) | |
| tree | f5cdc12138e9526896ff5f8fe9e3ffaa0c47fc0c /test/tftptest.lua | |
| parent | 68f51243b38bf1e32d471e9cc9ddf12a25110e80 (diff) | |
| download | luasocket-7096b8df82eebfe857e0043bc8a853353bd78480.tar.gz luasocket-7096b8df82eebfe857e0043bc8a853353bd78480.tar.bz2 luasocket-7096b8df82eebfe857e0043bc8a853353bd78480.zip | |
Initial revision
Diffstat (limited to 'test/tftptest.lua')
| -rw-r--r-- | test/tftptest.lua | 16 |
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 | ||
| 2 | assert(dofile("../examples/tftpclnt.lua")) | ||
| 3 | assert(dofile("auxiliar.lua")) | ||
| 4 | |||
| 5 | -- needs tftp server running on localhost, with root pointing to | ||
| 6 | -- /home/i/diego/public/html/luasocket/test | ||
| 7 | |||
| 8 | host = host or "localhost" | ||
| 9 | print("downloading") | ||
| 10 | err = tftp_get(host, 69, "test/index.html") | ||
| 11 | assert(not err, err) | ||
| 12 | original = readfile("/home/i/diego/public/html/luasocket/test/index.html") | ||
| 13 | retrieved = readfile("index.html") | ||
| 14 | remove("index.html") | ||
| 15 | assert(original == retrieved, "files differ!") | ||
| 16 | print("passed") | ||
