fixing test

This commit is contained in:
Axel Kittenberger 2011-01-26 10:25:57 +00:00
parent 71bd7a2905
commit b457351133

View File

@ -14,21 +14,21 @@ local log = {"-log", "all"}
writefile(cfgfile, [[ writefile(cfgfile, [[
settings = { settings = {
.logfile = "]]..logfile..[[", logfile = "]]..logfile..[[",
.nodaemon = true, nodaemon = true,
.delay = 3, delay = 3,
} }
rsync { sync {
defaults.rsync, default.rsync,
source = "]]..srcdir..[[", source = "]]..srcdir..[[",
target = "]]..trgdir..[[", target = "]]..trgdir..[[",
exclude = { exclude = {
"erf, "erf",
"/eaf", "/eaf",
"erd/", "erd/",
"/ead", "/ead",
} },
}]]); }]]);
-- writes all files -- writes all files
@ -48,11 +48,11 @@ end
local function testfile(filename, expect) local function testfile(filename, expect)
local stat, err = posix.stat(filename) local stat, err = posix.stat(filename)
if stat and not expect then if stat and not expect then
cwriteln("failure: " .. filename " .. should be excluded"); cwriteln("failure: ",filename," should be excluded");
os.exit(1); os.exit(1);
end end
if not stat and expect then if not stat and expect then
cwriteln("failure: " .. filename " .. should not be excluded"); cwriteln("failure: ",filename," should not be excluded");
os.exit(1); os.exit(1);
end end
end end
@ -73,7 +73,7 @@ end
cwriteln("testing startup excludes"); cwriteln("testing startup excludes");
writefiles(); writefiles();
cwriteln("starting Lsyncd"); cwriteln("starting Lsyncd");
local pid = spawn("./lsyncd"); local pid = spawn("./lsyncd", cfgfile);
cwriteln("waiting for Lsyncd to start"); cwriteln("waiting for Lsyncd to start");
posix.sleep(3) posix.sleep(3)
cwriteln("testing excludes after startup"); cwriteln("testing excludes after startup");