Merge remote-tracking branch 'fliepold/WIP-test_suite' into light0.1.y

This commit is contained in:
Thomas Schoebel-Theuer 2014-04-01 07:15:36 +02:00
commit 6c13438415
11 changed files with 44 additions and 22 deletions

View File

@ -14,6 +14,7 @@ Contents
1.1. Global settings
1.2. Running a test
1.2.1. Test output
1.2.2. Help to understand a test
1.3. Programming hints and conventions
1.4. Error handling
1.5. Signal handling and unexpected termination
@ -117,17 +118,17 @@ subdirectory (we call it start directory) as follows:
Option --config_root_dir not given
leads to including of apply.conf and no_parallel_writer.conf (in
this order!) which must reside as mentioned above in the leaf
this order!) which must reside as mentioned above in the test
directory or any of it's parent directories (up to 20 levels).
2. start directory = test_cases/perf/apply/no_parallel_writer
leaf directory = test_cases/perf/apply/no_parallel_writer
test directory = test_cases/perf/apply/no_parallel_writer
Option --config_root_dir=test_cases/perf
leads to including the same *.conf files as above.
3. start directory = test_cases/perf/apply/no_parallel_writer
leaf directory = test_cases/perf/apply/no_parallel_writer
test directory = test_cases/perf/apply/no_parallel_writer
Option --config_root_dir given or not
leads to including of no_parallel_writer.conf
@ -159,10 +160,10 @@ The output consists of the following sections:
- Line titled "Scanning subdirectories of <start directory>" followed by a
list of ignored or skipped subdirectories
- Per leaf directory:
- Line titled "Test directory <leaf directory> <date and time>"
- Per test directory:
- Line titled "Test directory <test directory> <date and time>"
- List titled "Sourcing config files between <config_root_dir> and
<leaf directory>" of included *.conf files corresponding to the directory
<test directory>" of included *.conf files corresponding to the directory
structure.
- List titled "Configuration variables" of all configuration variables set
@ -170,7 +171,7 @@ The output consists of the following sections:
- Section titled "Creating lock files"
- Section titled "Starting <leaf directory> <date and time>"
- Section titled "Starting <test directory> <date and time>"
In this section lines starting with "calling ..." mark the call to one of
the functions listed in the aforementioned variables prepare_list,
setup_list, run_list, cleanup_list and finish_list.
@ -185,13 +186,22 @@ The output consists of the following sections:
- Subsection titled "Deleting lock files"
- Subsection titled "General checks of error and log files"
- Line titled "Failure <return code> <leaf directory> <date and time>"
- Line titled "Failure <return code> <test directory> <date and time>"
(to stderr) in case of failure,
"Finished <leaf directory> <date and time>" (to stdout) otherwise
"Finished <test directory> <date and time>" (to stdout) otherwise
- If all tests in all leaf directories of the start directory terminated
- If all tests in all test directories of the start directory terminated
successfully: Line titled "Finished start directory <start directory>"
1.2.2. Help to understand a test
--------------------------------------
Calling start_test.sh --help from a test directory doesn't start a test but
gives you the output mentioned in 1.2.1 without the sections produced during
real test excecution.
In particular the section "Configuration variables" is printed. So you can
determine which functions are called via the variable run_list. These functions
should be commented extensively enough to be able to understand the test's
purpose.
1.3. Programming hints and conventions
--------------------------------------
@ -199,9 +209,9 @@ The output consists of the following sections:
- all global variables should be defined and explained in a
default-<module_name>.conf file
- the names of all global variables resp. all functions should have as prefix the
module name of the default-*.conf file resp. of the *.sh file which they are
defined in.
- the names of all global variables resp. all functions should have as prefix
the module name of the default-*.conf file resp. of the *.sh file which they
are defined in.
- in case of an error certain cleanup functions may be called (e.g. if
a network connection is cut during a test case it should be restored).

View File

@ -20,6 +20,6 @@ lib_rw_write_and_delete_script="/tmp/$global_prefix_scripts-write_and_delete.sh.
## part of data device size, which is written in the dd statement in the
## script wich writes the data device
lib_rw_part_of_device_size_written_per_loop=4
lib_rw_part_of_device_size_written_per_loop=1024
lib_rw_number_of_umount_retries_after_stopped_write=4

View File

@ -174,6 +174,9 @@ start_script=$test_suite_dir/scripts/start_test.sh
# For documentation see header of this file
tests_to_execute=(
"build_test_environment/checkout/checkout_mars_from_git:build_test_environment"
"build_test_environment/make/make_mars/grub:build_test_environment"
"build_test_environment/install_mars/install_via_rsync:build_test_environment"
"build_test_environment/lv_config/lv_recreate:build_test_environment"
"build_test_environment/cluster/create_cluster:build_test_environment"
"build_test_environment/resource/create_resource:build_test_environment"

View File

@ -73,7 +73,7 @@ function lib_wait_until_fetch_stops
for var in maxtime_fetch time_constant_fetch; do
eval $var='$'${module}_${var}
eval v='$'$var
eval v=${!var}
if [ -z "$v" ]; then
lib_exit 1 "variable $var not set"
fi

View File

@ -100,7 +100,7 @@ function logrotate_loop
# log-delete-all may delete *all* logfiles generated by host if the host
# is nor the primary nor the designated primary. Thus if count > 0
# we omit the check for the last logfile in this situation.
if [ ! \( $rc_prim -eq 0 -a $rc_desig_prim -eq 0 -a count -gt 0 \) ]
if [ ! \( $rc_prim -eq 0 -a $rc_desig_prim -eq 0 -a $count -gt 0 \) ]
then
logfile=$(marsadm_get_last_logfile $host $res $host) || lib_exit 1
lib_vmsg " last logfile $host:$logfile"

View File

@ -67,7 +67,7 @@ function net_do_impact_cmd
fi
for var in pattern replace; do
local x
eval x='$'$var
x=${!var}
if [ -z "$x" ]; then
lib_exit 1 "cannot determine $var in replace_expression $replace_expression"
fi

View File

@ -392,7 +392,7 @@ function perftest_prepare_replay
"logfile" "length_logfile" "time_waited" 0 \
"net_throughput"
lib_vmsg " ${FUNCNAME[0]}: fetch time: $time_waited"
if [ $(lib_rw_round_to_gb $length_logfile) -ne $$perftest_logfile_size_in_gb ]
if [ $(lib_rw_round_to_gb $length_logfile) -ne $perftest_logfile_size_in_gb ]
then
lib_exit 1 "req. logfile length = $$perftest_logfile_size_in_gb != $(lib_rw_round_to_gb $length_logfile) = act. logfile length"
fi

View File

@ -40,7 +40,7 @@ function replay_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" 0 2 $res ""
marsadm_pause_cmd "replay" $secondary_host $res

View File

@ -384,6 +384,8 @@ function switch2primary_correct_split_brain
sleep 15
marsadm_do_cmd $new_primary "log-purge-all --force" "$res" || lib_exit 1
fi
marsadm_do_cmd $new_primary "wait-resource" "$res is-device-on" || \
lib_exit 1
lib_vmsg " $switch2primary_flow_msg_prefix: check whether new primary $new_primary works standalone"
switch2primary_check_standalone_primary $new_primary $res
if [ $network_cut -eq 1 ]; then

View File

@ -42,7 +42,7 @@ function syslog_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" 0 2 $res ""
marsadm_pause_cmd "replay" $secondary_host $res
@ -124,12 +124,12 @@ function syslog_set_logging_parameters
for param in class limit recovery_s; do
varname='syslog_flood_'$param
lib_vmsg " setting $varname on $host"
eval value='$'$varname
value=${!varname}
if [ -z "$value" ]; then
lib_exit 1 "no value found for variable $varname"
fi
filename='syslog_flood_'$param'_file'
eval file='$'$filename
file=${!filename}
lib_remote_idfile $host "ls -l $file" || lib_exit 1
lib_remote_idfile $host "echo $value > $file" || lib_exit 1
done

View File

@ -117,6 +117,9 @@ function usage
echo " Include all *.conf files belonging to subdirectories " >&2
echo " between my_dir and test directory." >&2
echo " Default: my_dir = working directory" >&2
echo " Option --doc:" >&2
echo " Show all config variables for the actual test directory.">&2
echo " The variable run_list contains the functions called in this test." >&2
exit 1
}
@ -140,6 +143,10 @@ while [ $# -ge 1 ]; do
config_root_dir="$val"
shift
;;
--doc)
dry_run_script=1
shift
;;
*)
usage
;;