test_suite: new test cases

This commit is contained in:
Frank Liepold 2014-01-20 13:31:26 +01:00
parent cfb005508b
commit 33c776e7b6
11 changed files with 142 additions and 8 deletions

View File

@ -150,3 +150,6 @@ perftest_nttcp_start_cmd="nttcp -p $perftest_nttcp_port -r -i"
## type of result of tests
perftest_result_type="time"
## proc file to switch sync modus
perftest_sync_mode_proc_file='/proc/sys/mars/do_fast_fullsync'

View File

@ -131,3 +131,7 @@ resource_msgfile_list=([err]='3.error.status' [warn]='2.warn.status')
resource_proc_sys_mars_reset_emergency_file="/proc/sys/mars/mars_reset_emergency"
resource_mars_dir_full_warn_pattern_list[0]='EMERGENCY: the space on '$main_mars_directory'/ is very low.'
## flag to indicate whether the network connection should be cut while
## synching (e.g. after join-resource or invalidate)
resource_cut_network_connection_while_sync=0

View File

@ -149,6 +149,8 @@ tests_to_execute=(\
"test_cases/admin/logrotate:test_cases/admin"
"test_cases/admin/logdelete:test_cases/admin"
"test_cases/bugs/memleak:test_cases/bugs"
"test_cases/admin/leave_resource_while_sync/cut_network_connection_while_sync:test_cases/admin"
"test_cases/admin/leave_resource_while_sync/dont_cut_network_connection_while_sync:test_cases/admin"
"test_cases/admin/switch2primary:test_cases/admin"
"test_cases/admin/switch2primary_force/not_connected/data_dev_in_use/orig_prim_becomes_prim/hardcore_method:test_cases/admin"
"test_cases/admin/switch2primary_force/not_connected/data_dev_in_use/orig_prim_becomes_prim/usual_method:test_cases/admin"
@ -235,7 +237,6 @@ tests_to_execute=(\
"test_cases/perf:"
)
tests_to_execute=
set_env
execute_tests

View File

@ -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
#
@ -686,6 +686,71 @@ function resource_check_replication
fi
done
lib_wait_for_secondary_to_become_uptodate_and_cmp_cksums "resource" \
$new_secondary $primary_host \
$secondary_host $primary_host \
$res $data_dev 0
}
function resource_leave_while_sync
{
local primary_host=${main_host_list[0]}
local secondary_host=${main_host_list[1]}
local res=${resource_name_list[0]}
local dev="$(lv_config_get_lv_device $res)"
local time_waited
lib_wait_for_initial_end_of_sync $primary_host $secondary_host $res \
$resource_maxtime_initial_sync \
$switch2primary_time_constant_initial_sync \
"time_waited"
lib_vmsg " ${FUNCNAME[0]}: sync time: $time_waited"
# prevent too fast sync
perftest_sysctrl_sync_modus "no_fast_sync" $secondary_host
marsadm_do_cmd $secondary_host "invalidate" $res || lib_exit 1
sleep 2
resource_check_sync $secondary_host $primary_host $res "running"
if [ $resource_cut_network_connection_while_sync -eq 1 ]; then
net_do_impact_cmd $secondary_host "on" "remote_host=$primary_host"
fi
perftest_sysctrl_sync_modus "fast_sync" $secondary_host
marsadm_do_cmd $secondary_host "down" $res || lib_exit 1
marsadm_do_cmd $secondary_host "leave-resource" $res || lib_exit 1
if [ $resource_cut_network_connection_while_sync -eq 1 ]; then
net_do_impact_cmd $secondary_host "off" "remote_host=$primary_host"
fi
marsadm_do_cmd $secondary_host "join-resource" "$res $dev" || lib_exit 1
lib_wait_for_initial_end_of_sync $primary_host $secondary_host $res \
$resource_maxtime_initial_sync \
$resource_time_constant_initial_sync \
"time_waited"
resource_check_replication $primary_host $secondary_host $res
}
function resource_check_sync
{
[ $# -eq 4 ] || lib_exit 1 "wrong number $# of arguments (args = $*)"
local secondary_host=$1 primary_host=$2 res=$3 mode_req="$4"
lib_vmsg " check whether sync has mode $mode_req on $secondary_host"
case "$mode_req" in # ((
running)
local i host link_primary link_secondary
local link_val_primary link_val_secondary
for i in "primary" "secondary"; do
eval host='$'$i'_host'
eval link_$i="$(lib_linktree_get_res_host_linkname $host $res \
syncstatus)"
eval link_val_$i='$(lib_remote_idfile $host "readlink $link'_$i'")' || lib_exit 1
done
if [ "$link_val_primary" = "$link_val_secondary" ]; then
lib_exit 1 "no sync running. Links $link_primary and $link_secondary has same value $link_val_primary"
fi
;;
*) lib_exit 1 "wrong mode $mode_req"
;;
esac
}

View File

@ -256,7 +256,6 @@ for test_dir in $(find . -type d | eval "$ignore_cmd" | eval "$sort_cmd"); do
else
set_host_locks
echo "================= Starting $(pwd) $(date) ======================================"
local test_rc
eval "$to_start"
test_rc=$?
release_host_locks

View File

@ -0,0 +1,21 @@
#!/bin/bash
# Copyright 2010-2014 Frank Liepold / 1&1 Internet AG
#
# Email: frank.liepold@1und1.de
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#####################################################################
resource_cut_network_connection_while_sync=1

View File

@ -0,0 +1,21 @@
#!/bin/bash
# Copyright 2010-2014 Frank Liepold / 1&1 Internet AG
#
# Email: frank.liepold@1und1.de
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#####################################################################
resource_cut_network_connection_while_sync=0

View File

@ -0,0 +1,24 @@
#!/bin/bash
# Copyright 2010-2014 Frank Liepold / 1&1 Internet AG
#
# Email: frank.liepold@1und1.de
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#####################################################################
run_list="resource_quick_prepare_first_resource resource_leave_while_sync lib_general_checks_after_every_test"

View File

@ -27,10 +27,6 @@ perftest_number_of_patches_list=(10 10 4 2)
## must correspond to perftest_number_of_patches_list
perftest_patch_length_list=(1 50000 500000 1000000)
## proc file to switch sync modus
perftest_sync_mode_proc_file='/proc/sys/mars/do_fast_fullsync'
## data file to user for rsync
perftest_data_file=$main_mars_directory/file_to_sync