mirror of
https://github.com/octoleo/lsyncd.git
synced 2024-05-31 23:40:51 +00:00
Use sshopts for rsyncssh tests
This commit is contained in:
parent
deb425a075
commit
3e8aad3b2e
20
lsyncd.lua
20
lsyncd.lua
|
@ -4645,6 +4645,7 @@ OPTIONS:
|
||||||
-nodaemon Does not detach and logs to stdout/stderr
|
-nodaemon Does not detach and logs to stdout/stderr
|
||||||
-pidfile FILE Writes Lsyncds PID into FILE
|
-pidfile FILE Writes Lsyncds PID into FILE
|
||||||
-runner FILE Loads Lsyncds lua part from FILE
|
-runner FILE Loads Lsyncds lua part from FILE
|
||||||
|
-script FILE Script to load before execting runner (ADVANCED)
|
||||||
-sshopts Additional ssh command options when using rsyncssh
|
-sshopts Additional ssh command options when using rsyncssh
|
||||||
-version Prints versions and exits
|
-version Prints versions and exits
|
||||||
|
|
||||||
|
@ -4781,6 +4782,18 @@ function runner.configure( args, monitors )
|
||||||
end
|
end
|
||||||
},
|
},
|
||||||
|
|
||||||
|
script =
|
||||||
|
{
|
||||||
|
1,
|
||||||
|
function
|
||||||
|
(
|
||||||
|
file
|
||||||
|
)
|
||||||
|
clSettings.scripts = clSettings.scripts or {}
|
||||||
|
table.insert(clSettings.scripts, file)
|
||||||
|
end
|
||||||
|
},
|
||||||
|
|
||||||
rsync =
|
rsync =
|
||||||
{
|
{
|
||||||
2,
|
2,
|
||||||
|
@ -4898,6 +4911,13 @@ function runner.configure( args, monitors )
|
||||||
i = i + 1
|
i = i + 1
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if clSettings.scripts then
|
||||||
|
for _, file in ipairs(clSettings.scripts) do
|
||||||
|
log( 'Info', 'Run addition script: ' .. file )
|
||||||
|
dofile(file)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
if clSettings.syncs
|
if clSettings.syncs
|
||||||
then
|
then
|
||||||
if #nonopts ~= 0
|
if #nonopts ~= 0
|
||||||
|
|
|
@ -8,8 +8,6 @@ dofile( 'tests/testlib.lua' )
|
||||||
cwriteln( '****************************************************************' )
|
cwriteln( '****************************************************************' )
|
||||||
cwriteln( ' Testing default.rsyncssh with random data activity ' )
|
cwriteln( ' Testing default.rsyncssh with random data activity ' )
|
||||||
cwriteln( '****************************************************************' )
|
cwriteln( '****************************************************************' )
|
||||||
cwriteln( '( this test needs passwordless ssh localhost access )' )
|
|
||||||
cwriteln( '( for current user )' )
|
|
||||||
|
|
||||||
local tdir, srcdir, trgdir = mktemps()
|
local tdir, srcdir, trgdir = mktemps()
|
||||||
|
|
||||||
|
@ -24,6 +22,8 @@ local pid = spawn(
|
||||||
'-nodaemon',
|
'-nodaemon',
|
||||||
'-delay',
|
'-delay',
|
||||||
'5',
|
'5',
|
||||||
|
'-sshopts',
|
||||||
|
'-i tests/ssh/id_rsa -p 2468 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null',
|
||||||
'-rsyncssh',
|
'-rsyncssh',
|
||||||
srcdir,
|
srcdir,
|
||||||
'localhost',
|
'localhost',
|
||||||
|
|
|
@ -114,11 +114,20 @@ function startSshd()
|
||||||
cwriteln(script_path() .. "ssh/sshd_config")
|
cwriteln(script_path() .. "ssh/sshd_config")
|
||||||
|
|
||||||
local sshdPath = script_path() .. "/ssh/"
|
local sshdPath = script_path() .. "/ssh/"
|
||||||
|
|
||||||
|
if posix.stat( sshdPath ) == nil then
|
||||||
|
cwriteln("setup ssh server in " .. sshdPath)
|
||||||
|
posix.mkdir(sshdPath)
|
||||||
|
os.execute("ssh-keygen -t rsa -N '' -f" .. sshdPath .. "id_rsa")
|
||||||
|
os.execute("cp ".. sshdPath .. "id_rsa.pub ".. sshdPath .. "authorized_keys")
|
||||||
|
os.execute("ssh-keygen -t rsa -N '' -f ".. sshdPath .. "ssh_host_rsa_key")
|
||||||
|
cwriteln("done")
|
||||||
|
end
|
||||||
|
|
||||||
local f = io.open( sshdPath .. "sshd_config", 'w')
|
local f = io.open( sshdPath .. "sshd_config", 'w')
|
||||||
f:write([[
|
f:write([[
|
||||||
Port 2468
|
Port 2468
|
||||||
HostKey ]] .. sshdPath .. [[ssh_host_rsa_key
|
HostKey ]] .. sshdPath .. [[ssh_host_rsa_key
|
||||||
HostKey ]] .. sshdPath .. [[ssh_host_dsa_key
|
|
||||||
AuthorizedKeysFile ]] .. sshdPath .. [[authorized_keys
|
AuthorizedKeysFile ]] .. sshdPath .. [[authorized_keys
|
||||||
ChallengeResponseAuthentication no
|
ChallengeResponseAuthentication no
|
||||||
UsePAM no
|
UsePAM no
|
||||||
|
|
Loading…
Reference in New Issue
Block a user