mirror of
https://github.com/schoebel/mars
synced 2024-12-17 04:05:03 +00:00
test_suite: add parameter
This commit is contained in:
parent
e487d8f128
commit
64e157e0be
@ -40,7 +40,7 @@ function apply_fetch_run
|
||||
resource_clear_data_device $primary_host $res
|
||||
|
||||
lib_rw_start_writing_data_device $primary_host "writer_pid" \
|
||||
"writer_script" 2 2 $res
|
||||
"writer_script" 2 2 $res ""
|
||||
|
||||
marsadm_pause_cmd "apply" $secondary_host $res
|
||||
|
||||
|
@ -36,7 +36,7 @@ function crash_run
|
||||
resource_clear_data_device $primary_host $res
|
||||
|
||||
lib_rw_start_writing_data_device $primary_host "writer_pid" \
|
||||
"writer_script" 0 0 $res
|
||||
"writer_script" 0 0 $res ""
|
||||
|
||||
lib_vmsg " sleep $crash_time_from_write_start_to_reboot seconds"
|
||||
sleep $crash_time_from_write_start_to_reboot
|
||||
@ -101,7 +101,7 @@ function crash_write_data_device_and_calculate_checksums
|
||||
mount_mount_data_device $primary_host $res
|
||||
resource_clear_data_device $primary_host $res
|
||||
lib_rw_start_writing_data_device $primary_host "writer_pid" \
|
||||
"writer_script" 0 0 $res
|
||||
"writer_script" 0 0 $res ""
|
||||
lib_rw_stop_writing_data_device $primary_host $writer_script "write_count"
|
||||
main_error_recovery_functions["lib_rw_stop_scripts"]=
|
||||
lib_wait_until_action_stops "replay" $secondary_host $res \
|
||||
|
@ -40,7 +40,7 @@ function file_destroy_run
|
||||
|
||||
|
||||
lib_rw_start_writing_data_device $primary_host "writer_pid" \
|
||||
"writer_script" 0 2 $res
|
||||
"writer_script" 0 2 $res ""
|
||||
|
||||
file_destroy_down_secondary $secondary_host $res
|
||||
marsadm_do_cmd $secondary_host "connect" $res || lib_exit 1
|
||||
|
@ -1,5 +1,5 @@
|
||||
#!/bin/bash
|
||||
# Copyright 2010-2013 Frank Liepold / 1&1 Internet AG
|
||||
# Copyright 2010-2014 Frank Liepold / 1&1 Internet AG
|
||||
#
|
||||
# Email: frank.liepold@1und1.de
|
||||
#
|
||||
@ -25,13 +25,14 @@
|
||||
# the name of the started script will be returned in the variable named by $5
|
||||
function lib_rw_write_and_delete_loop
|
||||
{
|
||||
[ $# -eq 8 ] || lib_exit 1 "wrong number $# of arguments (args = $*)"
|
||||
[ $# -eq 9 ] || lib_exit 1 "wrong number $# of arguments (args = $*)"
|
||||
local host=$1 target_file=$2 file_size_in_gb=$3 part_of_size_to_write=$4
|
||||
local varname_pid=$5 varname_script=$6 no_of_loops=$7 sleeptime=$8
|
||||
local postfix_script_name="$9"
|
||||
local bs=1024
|
||||
local dd_count=$(($file_size_in_gb * 1024 * 1024 / $part_of_size_to_write))
|
||||
local dir="$(dirname $target_file)"
|
||||
local script=$lib_rw_write_and_delete_script
|
||||
local script=$lib_rw_write_and_delete_script${postfix_script_name:+.$postfix_script_name}
|
||||
lib_vmsg " checking directory of $host:$target_file"
|
||||
dir="$(dirname $target_file)"
|
||||
lib_remote_idfile $host "test -d $dir " || \
|
||||
@ -106,14 +107,15 @@ function lib_rw_stop_one_script
|
||||
|
||||
function lib_rw_start_writing_data_device
|
||||
{
|
||||
[ $# -eq 6 ] || lib_exit 1 "wrong number $# of arguments (args = $*)"
|
||||
[ $# -eq 7 ] || lib_exit 1 "wrong number $# of arguments (args = $*)"
|
||||
local host=$1 varname_pid=$2 varname_script=$3 no_of_loops=$4 sleeptime=$5
|
||||
local res=$6
|
||||
local res=$6 postfix_script_name="$9"
|
||||
lib_rw_write_and_delete_loop $host \
|
||||
${resource_mount_point_list[$res]}/$lib_rw_file_to_write \
|
||||
$(lv_config_get_lv_size_from_name ${resource_name_list[0]}) \
|
||||
$lib_rw_part_of_device_size_written_per_loop \
|
||||
$varname_pid $varname_script $no_of_loops $sleeptime
|
||||
$varname_pid $varname_script $no_of_loops $sleeptime \
|
||||
"$postfix_script_name"
|
||||
}
|
||||
|
||||
function lib_rw_stop_writing_data_device
|
||||
|
@ -30,7 +30,7 @@ function logrotate_run
|
||||
|
||||
|
||||
lib_rw_start_writing_data_device $primary_host "writer_pid" \
|
||||
"writer_script" 0 0 $res
|
||||
"writer_script" 0 0 $res ""
|
||||
|
||||
logrotate_loop $primary_host $res $logrotate_number_of_rotate_loops \
|
||||
$logrotate_sleep_time_between_rotates
|
||||
|
@ -7,7 +7,6 @@ function marsadm_do_cmd
|
||||
lib_vmsg " executing $marscmd on $host"
|
||||
lib_remote_idfile $host $marscmd
|
||||
rc=$?
|
||||
marsview_get $host lv-1-2 >/dev/null
|
||||
if [ $rc -ne 0 ]; then
|
||||
return $rc
|
||||
fi
|
||||
|
@ -35,7 +35,7 @@ function net_run
|
||||
resource_clear_data_device $primary_host $res
|
||||
|
||||
lib_rw_start_writing_data_device $primary_host "writer_pid" \
|
||||
"writer_script" 0 1 $res
|
||||
"writer_script" 0 1 $res ""
|
||||
|
||||
sleep $net_time_data_dev_writer
|
||||
|
||||
|
@ -176,7 +176,7 @@ function perftest_do_write
|
||||
local writer_rate
|
||||
writer_start=$(date +'%s')
|
||||
lib_rw_start_writing_data_device $primary_host "writer_pid" \
|
||||
"writer_script" 0 0 $res
|
||||
"writer_script" 0 0 $res ""
|
||||
lib_vmsg " sleep $perftest_write_time"
|
||||
sleep $perftest_write_time
|
||||
lib_rw_stop_writing_data_device $primary_host $writer_script "write_count"
|
||||
@ -227,7 +227,7 @@ function perftest_start_parallel_writer
|
||||
mount_mount_data_device $host $res
|
||||
eval $varname_writer_start=$(date +'%s')
|
||||
lib_rw_start_writing_data_device $host $varname_writer_pid \
|
||||
$varname_writer_script 0 0 $res
|
||||
$varname_writer_script 0 0 $res ""
|
||||
}
|
||||
|
||||
function perftest_finish_parallel_writer
|
||||
|
@ -35,7 +35,7 @@ function remote_dev_run
|
||||
cluster_create_debugfiles $primary_host
|
||||
|
||||
lib_rw_start_writing_data_device $primary_host "writer_pid" \
|
||||
"writer_script" 0 0 $res
|
||||
"writer_script" 0 0 $res ""
|
||||
|
||||
for action in "rotate" "delete"; do
|
||||
local sleep_time pid_varname script_varname
|
||||
|
@ -83,7 +83,7 @@ function resize_run
|
||||
resource_clear_data_device $primary_host $res
|
||||
|
||||
lib_rw_start_writing_data_device $primary_host "writer_pid" \
|
||||
"writer_script" 0 1 $res
|
||||
"writer_script" 0 1 $res ""
|
||||
|
||||
resize_do_resize $primary_host $secondary_host $res $dev \
|
||||
$data_lv_size_new $mars_data_dev_size_new
|
||||
|
@ -251,7 +251,7 @@ function resource_fill_mars_dir
|
||||
resource_check_low_space_error $primary_host $res "sequence_hole"
|
||||
else
|
||||
lib_rw_start_writing_data_device $primary_host "writer_pid" \
|
||||
"writer_script" 0 2 $res
|
||||
"writer_script" 0 2 $res ""
|
||||
resource_write_file_until_mars_dir_full $primary_host \
|
||||
$global_mars_directory \
|
||||
$mars_dev_size \
|
||||
@ -271,7 +271,7 @@ function resource_fill_mars_dir
|
||||
resource_resize_mars_dir $primary_host $mars_dev $(($mars_dev_size + 10))
|
||||
|
||||
lib_rw_start_writing_data_device $primary_host "writer_pid" \
|
||||
"writer_script" 0 3 $res
|
||||
"writer_script" 0 3 $res ""
|
||||
|
||||
local procfile=/proc/sys/mars/logger_resume
|
||||
lib_vmsg " setting $primary_host:$procfile to 1"
|
||||
@ -558,7 +558,7 @@ function resource_write_and_check
|
||||
resource_clear_data_device $primary_host $res
|
||||
|
||||
lib_rw_start_writing_data_device $primary_host "writer_pid" \
|
||||
"writer_script" 0 1 $res
|
||||
"writer_script" 0 1 $res ""
|
||||
sleep 15
|
||||
lib_rw_stop_writing_data_device $primary_host $writer_script "write_count"
|
||||
main_error_recovery_functions["lib_rw_stop_scripts"]=
|
||||
|
@ -39,7 +39,7 @@ function switch2primary_run
|
||||
resource_clear_data_device $primary_host $res
|
||||
|
||||
lib_rw_start_writing_data_device $primary_host "writer_pid" \
|
||||
"writer_script" 0 0 $res
|
||||
"writer_script" 0 0 $res ""
|
||||
|
||||
if [ $switch2primary_force -eq 1 ]; then
|
||||
switch2primary_force $primary_host $secondary_host $res $writer_script
|
||||
|
Loading…
Reference in New Issue
Block a user