mirror of https://github.com/schoebel/mars
test_suite: add option whether script should be removed
This commit is contained in:
parent
6ef35d5e3f
commit
a117a2fa86
|
@ -113,7 +113,7 @@ while true; do
|
|||
sleep '"$sleep_time"'
|
||||
done' >$script
|
||||
lib_start_script_remote_bg $host $script $varname_pid \
|
||||
$varname_script
|
||||
$varname_script "rm"
|
||||
main_error_recovery_functions["lib_rw_stop_scripts"]+="$host $script "
|
||||
}
|
||||
|
||||
|
|
|
@ -59,7 +59,7 @@ while true; do
|
|||
let count+=1
|
||||
done' >$script
|
||||
lib_start_script_remote_bg $host $script $varname_pid \
|
||||
$varname_script
|
||||
$varname_script "rm"
|
||||
main_error_recovery_functions["lib_rw_stop_scripts"]+="$host $script "
|
||||
}
|
||||
|
||||
|
|
|
@ -222,7 +222,8 @@ function lib_check_access_to_remote_hosts
|
|||
# stdout resp. stderr are kept in files named <script>.out resp. <script>.err on the remote host.
|
||||
function lib_start_script_remote_bg
|
||||
{
|
||||
local host=$1 script=$2 varname_pid=$3 varname_script=$4
|
||||
[ $# -eq 5 ] || lib_exit 1 "wrong number $# of arguments (args = $*)"
|
||||
local host=$1 script=$2 varname_pid=$3 varname_script=$4 rm_opt=$5
|
||||
local ssh_opt="$main_ssh_idfile_opt"
|
||||
if [ ! -f $script ]; then
|
||||
lib_exit 1 "script file $script not found"
|
||||
|
@ -233,7 +234,9 @@ function lib_start_script_remote_bg
|
|||
lib_vmsg " copying script $script to $host:$remote_filename"
|
||||
scp $ssh_opt $script root@$host:$remote_filename || lib_exit 1
|
||||
|
||||
rm -f $script || lib_exit 1
|
||||
if [ $rm_opt = "rm" ]; then
|
||||
rm -f $script || lib_exit 1
|
||||
fi
|
||||
|
||||
local remote_pid
|
||||
local cmd="/bin/bash $remote_filename >$remote_filename.out 2>$remote_filename.err"
|
||||
|
|
Loading…
Reference in New Issue