mirror of
https://github.com/octoleo/lsyncd.git
synced 2024-12-12 22:27:50 +00:00
bfc604a591
In this mode, multiple tunnel processes are started and connection a load balanced on the pool of connections. Example config: ... sync { default.rsync, tunnel = tunnel { command = {"ssh", "-N", "-L", "localhost:${localport}:localhost:873", "user@testmachine"}, mode = "pool", parallel = 2, }, target = "rsync://localhost:${localport}/test", ... }
27 lines
843 B
Lua
27 lines
843 B
Lua
dofile( 'tests/testlib.lua' )
|
|
|
|
cwriteln( '****************************************************************' )
|
|
cwriteln( ' Testing Utils Functions ' )
|
|
cwriteln( '****************************************************************' )
|
|
|
|
assert(isTableEqual(
|
|
splitQuotedString("-p 22 -i '/home/test/bla blu/id_rsa'"),
|
|
{"-p", "22", "-i", "/home/test/bla blu/id_rsa"}
|
|
))
|
|
|
|
-- test string replacement
|
|
local testData = {
|
|
localPort = 1234,
|
|
localHost = "localhorst"
|
|
}
|
|
assert(substitudeCommands("echo ssh ${localHost}:${localPort}", testData) ==
|
|
"echo ssh localhorst:1234")
|
|
|
|
assert(isTableEqual(
|
|
substitudeCommands({"-p${doesNotExist}", "2${localHost}2", "-i '${localPort}'"}, testData),
|
|
{"-p", "2localhorst2", "-i '1234'"}
|
|
))
|
|
|
|
assert(type(lsyncd.get_free_port()) == "number")
|
|
|
|
os.exit(0) |