From 802d96cd8d18ed5f4990a12e25ecc5dc06405f66 Mon Sep 17 00:00:00 2001 From: Frank Liepold Date: Tue, 11 Mar 2014 13:51:28 +0100 Subject: [PATCH] test_suite: increase size of /mars to 25GB --- test_suite/mars/default-lv_config.conf | 2 +- test_suite/mars/modules/resource.sh | 36 +++++++++++++------ .../test_cases/hardcore/mars_dir_full.conf | 2 +- .../hardcore/per_resource_emergency.conf | 4 +-- 4 files changed, 29 insertions(+), 15 deletions(-) diff --git a/test_suite/mars/default-lv_config.conf b/test_suite/mars/default-lv_config.conf index 63bfa378..4be1aec8 100644 --- a/test_suite/mars/default-lv_config.conf +++ b/test_suite/mars/default-lv_config.conf @@ -46,7 +46,7 @@ lv_config_vg_recreatable_list=(\ ## be recreated. ## the names are built due to the pattern lv-- -lv_config_lv_name_list=(lv-1-2 lv-2-2 lv-3-2 lv-4-2 lv-5-10 lv-6-100) +lv_config_lv_name_list=(lv-1-2 lv-2-2 lv-3-2 lv-4-2 lv-5-25 lv-6-100) ## host indexed list of partitions to be used for the logical volumes declare -g -A lv_config_partition_list diff --git a/test_suite/mars/modules/resource.sh b/test_suite/mars/modules/resource.sh index 86c06f8e..30317583 100644 --- a/test_suite/mars/modules/resource.sh +++ b/test_suite/mars/modules/resource.sh @@ -849,9 +849,7 @@ function resource_test_emergency_on_all_resources { [ $# -eq 4 ] || lib_exit 1 "wrong number $# of arguments (args = $*)" local primary_host=$1 secondary_host=$2 mars_lv_name=$3 mars_dev_size_mb=$4 - local res - local fill_size_mb time_waited - local marsadm_out host list_cmd res_list sort_opt="" + local res list_cmd res_list sort_opt="" for res in ${resource_name_list[@]}; do local p=${resource_emergency_percentage[$res]} @@ -876,7 +874,15 @@ function resource_test_emergency_on_all_resources sort_opt="r" eval res_list='($('$list_cmd'))' for res in ${res_list[@]}; do - : # TODO + # TODO + local trunc_size_mb=$((($mars_dev_size_mb \ + * ${resource_emergency_percentage[$res]}) / 100 )) + lib_vmsg " removing $primary_host:$resource_big_file" + lib_remote_idfile $primary_host "rm -f $resource_big_file" || lib_exit 1 + + lib_rw_stop_writing_data_device $primary_host $writer_script "write_count" + + resource_correct_emergency $primary_host $secondary_host $res done } @@ -903,14 +909,8 @@ function resource_test_emergency_on_one_resource lib_rw_stop_writing_data_device $primary_host $writer_script "write_count" - marsadm_do_cmd $secondary_host "invalidate" $res + resource_correct_emergency $primary_host $secondary_host $res - 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_resource_running $primary_host $secondary_host $res } function resource_check_logfile_change @@ -949,6 +949,7 @@ function resource_put_resource_to_emergency_mode [ $# -eq 4 ] || lib_exit 1 "wrong number $# of arguments (args = $*)" local host=$1 res=$2 mars_dev_size_mb=$3 emergency_percentage=$4 local fill_size_mb marsadm_out + fill_size_mb=$(( ($mars_dev_size_mb * $emergency_percentage) / 100 )) lib_vmsg " creating $resource_big_file with $fill_size_mb MB to put $res in emerg. mode on $host" @@ -997,3 +998,16 @@ function resource_check_resource_running $res $dev 0 } +function resource_correct_emergency +{ + local primary_host=$1 secondary_host=$2 res=$3 + + marsadm_do_cmd $secondary_host "invalidate" $res + + 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_resource_running $primary_host $secondary_host $res +} diff --git a/test_suite/mars/test_cases/hardcore/mars_dir_full.conf b/test_suite/mars/test_cases/hardcore/mars_dir_full.conf index 61f52e1d..22b3734f 100644 --- a/test_suite/mars/test_cases/hardcore/mars_dir_full.conf +++ b/test_suite/mars/test_cases/hardcore/mars_dir_full.conf @@ -27,6 +27,6 @@ resource_fs_on_data_device_necessary=0 mars_dir_full_maxtime_state_constant=60 -cluster_mars_dir_lv_name_list=([${global_host_list[0]}]=lv-5-10 [${global_host_list[1]}]=lv-6-100) +cluster_mars_dir_lv_name_list=([${global_host_list[0]}]=lv-5-25 [${global_host_list[1]}]=lv-6-100) run_list="resource_prepare resource_run_first resource_fill_mars_dir lib_general_mars_checks_after_every_test" diff --git a/test_suite/mars/test_cases/hardcore/per_resource_emergency.conf b/test_suite/mars/test_cases/hardcore/per_resource_emergency.conf index 49d0faf8..0c26b5f6 100644 --- a/test_suite/mars/test_cases/hardcore/per_resource_emergency.conf +++ b/test_suite/mars/test_cases/hardcore/per_resource_emergency.conf @@ -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 # @@ -30,7 +30,7 @@ lib_rw_part_of_device_size_written_per_loop=$((10 * 1024 * 1024)) mars_dir_full_maxtime_state_constant=60 -cluster_mars_dir_lv_name_list=([${global_host_list[0]}]=lv-5-10 [${global_host_list[1]}]=lv-6-100) +cluster_mars_dir_lv_name_list=([${global_host_list[0]}]=lv-5-25 [${global_host_list[1]}]=lv-6-100) resource_name_list=( lv-1-2