diff options
Diffstat (limited to 'test/tftptest.lua')
-rw-r--r-- | test/tftptest.lua | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/test/tftptest.lua b/test/tftptest.lua index a435ad4..a478ed8 100644 --- a/test/tftptest.lua +++ b/test/tftptest.lua | |||
@@ -1,5 +1,5 @@ | |||
1 | -- load tftpclnt.lua | 1 | -- load tftpclnt.lua |
2 | dofile("tftpclnt.lua") | 2 | dofile("tftp.lua") |
3 | 3 | ||
4 | -- needs tftp server running on localhost, with root pointing to | 4 | -- needs tftp server running on localhost, with root pointing to |
5 | -- a directory with index.html in it | 5 | -- a directory with index.html in it |
@@ -13,11 +13,8 @@ function readfile(file) | |||
13 | end | 13 | end |
14 | 14 | ||
15 | host = host or "localhost" | 15 | host = host or "localhost" |
16 | print("downloading") | 16 | retrieved, err = socket.tftp.get("tftp://" .. host .."/index.html") |
17 | err = tftp_get(host, 69, "index.html", "index.got") | ||
18 | assert(not err, err) | 17 | assert(not err, err) |
19 | original = readfile("test/index.html") | 18 | original = readfile("test/index.html") |
20 | retrieved = readfile("index.got") | ||
21 | os.remove("index.got") | ||
22 | assert(original == retrieved, "files differ!") | 19 | assert(original == retrieved, "files differ!") |
23 | print("passed") | 20 | print("passed") |