mirror of
https://github.com/lunarmodules/luasocket.git
synced 2024-12-26 20:38:22 +01:00
updated due to test location changes
This commit is contained in:
parent
9f677cdbf4
commit
b319e6a1e8
@ -1,16 +1,25 @@
|
|||||||
-- load tftpclng.lua
|
-- load tftpclng.lua
|
||||||
assert(dofile("../examples/tftpclnt.lua"))
|
assert(dofile("../examples/tftpclnt.lua"))
|
||||||
assert(dofile("auxiliar.lua"))
|
|
||||||
|
|
||||||
-- needs tftp server running on localhost, with root pointing to
|
-- needs tftp server running on localhost, with root pointing to
|
||||||
-- /home/i/diego/public/html/luasocket/test
|
-- /home/i/diego/public/html/luasocket/test
|
||||||
|
|
||||||
host = host or "localhost"
|
function readfile(file)
|
||||||
|
local f = openfile("file", "rb")
|
||||||
|
local a
|
||||||
|
if f then
|
||||||
|
a = read(f, "*a")
|
||||||
|
closefile(f)
|
||||||
|
end
|
||||||
|
return a
|
||||||
|
end
|
||||||
|
|
||||||
|
host = host or "goya"
|
||||||
print("downloading")
|
print("downloading")
|
||||||
err = tftp_get(host, 69, "test/index.html")
|
err = tftp_get(host, 69, "index.html", "index.got")
|
||||||
assert(not err, err)
|
assert(not err, err)
|
||||||
original = readfile("/home/i/diego/public/html/luasocket/test/index.html")
|
original = readfile("index.index")
|
||||||
retrieved = readfile("index.html")
|
retrieved = readfile("index.got")
|
||||||
remove("index.html")
|
remove("index.got")
|
||||||
assert(original == retrieved, "files differ!")
|
assert(original == retrieved, "files differ!")
|
||||||
print("passed")
|
print("passed")
|
||||||
|
Loading…
Reference in New Issue
Block a user