From df3b0c091ac0938d3e6093a425405064924bc51e Mon Sep 17 00:00:00 2001 From: Frank Liepold Date: Thu, 9 Jan 2014 07:31:18 +0100 Subject: [PATCH] test_suite: formatting of test output --- test_suite/README | 15 +++++----- test_suite/scripts/modules/07_lib_err.sh | 4 +-- test_suite/scripts/modules/lib.sh | 4 +-- test_suite/scripts/start_test.sh | 35 ++++++++++++------------ 4 files changed, 29 insertions(+), 29 deletions(-) diff --git a/test_suite/README b/test_suite/README index c3488c7b..6e4c13a6 100644 --- a/test_suite/README +++ b/test_suite/README @@ -86,8 +86,8 @@ subdirectory (we call it start directory) as follows: leads to including of no_parallel_writer.conf -1.1 Test output ---------------- +1.1. Test output +---------------- The output fo start_test.sh consists of the following sections: @@ -102,7 +102,7 @@ The output fo start_test.sh consists of the following sections: list of ignored or skipped subdirectories - Per leaf directory: - - Line titled "Testdirectory " + - Line titled "Test directory " - List titled "Sourcing config files between and " of included *.conf files corresponding to the directory structure. @@ -112,7 +112,7 @@ The output fo start_test.sh consists of the following sections: - Section titled "Creating lock files" - - Section titled " Starting " + - Section titled "Starting " 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. @@ -125,11 +125,12 @@ The output fo start_test.sh consists of the following sections: - Subsection titled "Deleting lock files" - Subsection titled "General checks of error and log files" - - Line titled "Failure " (to stderr) in case - of failure, "Finished " (to stdout) otherwise + - Line titled "Failure " + (to stderr) in case of failure, + "Finished " (to stdout) otherwise - If all tests in all leaf directories of the start directory terminated - successfully: Line titled "Finished pwd=" + successfully: Line titled "Finished start directory " 2. Naming conventions diff --git a/test_suite/scripts/modules/07_lib_err.sh b/test_suite/scripts/modules/07_lib_err.sh index 9486a1d7..485f998f 100644 --- a/test_suite/scripts/modules/07_lib_err.sh +++ b/test_suite/scripts/modules/07_lib_err.sh @@ -66,11 +66,11 @@ function lib_check_for_kernel_oops_after_start_time function lib_general_checks_after_every_test { - echo "========================== General checks of error and log files ===============" + echo "================= General checks of error and log files ========================" lib_err_check_and_copy_global_err_files_all lib_check_proc_sys_mars_variables lib_check_for_kernel_oops_after_start_time - echo "========================== End general checks of error and log files ===========" + echo "================= End general checks of error and log files ====================" } function lib_check_proc_sys_mars_variables diff --git a/test_suite/scripts/modules/lib.sh b/test_suite/scripts/modules/lib.sh index 7c9465a2..4e95f2fb 100644 --- a/test_suite/scripts/modules/lib.sh +++ b/test_suite/scripts/modules/lib.sh @@ -35,7 +35,7 @@ mkdir -p "$download_dir" || exit -1 # general error exit function function lib_callstack { - echo "========================== Callstack ===========================================" + echo "================= Callstack ====================================================" local argv_index=0 i for i in ${!FUNCNAME[*]}; do local j args= @@ -48,7 +48,7 @@ function lib_callstack fi echo ${BASH_SOURCE[(($i + 1))]:-"stdin"}:${BASH_LINENO[$i]} ${FUNCNAME[$i]} $args done - echo "========================== End callstack =======================================" + echo "================= End callstack ================================================" } function lib_exit diff --git a/test_suite/scripts/start_test.sh b/test_suite/scripts/start_test.sh index 9bd655fc..bc91c1a2 100755 --- a/test_suite/scripts/start_test.sh +++ b/test_suite/scripts/start_test.sh @@ -32,12 +32,12 @@ shopt -s extdebug script_dir="$(cd "$(dirname "$(which "$0")")"; pwd)" lib_dir=$script_dir/modules -echo "========================== Sourcing libraries in $lib_dir ======================" +echo "================= Sourcing libraries in $lib_dir ===============================" for lib in $lib_dir/lib*.sh; do echo "Sourcing $lib" source "$lib" || start_test_exit $? done -echo "========================== End sourcing libraries ==============================" +echo "================= End sourcing libraries =======================================" to_produce="${to_produce:-replay.gz}" to_check="${to_check:-}" @@ -70,7 +70,7 @@ function set_host_locks lib_vmsg " warning: main_host_list empty" return fi - echo "========================== Creating lock files =================================" + echo "================= Creating lock files ==========================================" for host in "${main_host_list[@]}"; do local lock_file=${main_lock_file_list[$host]} if [ -z "$lock_file" ]; then @@ -83,18 +83,18 @@ function set_host_locks date > $lock_file || lib_exit 1 lib_vmsg " created lockfile $lock_file on $host" done - echo "========================== End creating lock files =============================" + echo "================= End creating lock files ======================================" } function release_host_locks { - echo "========================== Deleting lock files =================================" + echo "================= Deleting lock files ==========================================" for host in "${main_host_list[@]}"; do local lock_file=${main_lock_file_list[$host]} rm -f $lock_file || lib_exit 1 lib_vmsg " deleted lockfile $lock_file on $host" done - echo "========================== End deleting lock files =============================" + echo "================= End deleting lock files ======================================" } function source_module @@ -133,13 +133,13 @@ function print_config_environment sort -o $f $f || lib_exit 1 done - echo "========================== Configuration variables =============================" + echo "================= Configuration variables ======================================" # print lines uniq to $environ_actual and remove some not interesting # variables comm -2 -3 $environ_actual $environ_save | \ egrep -v '^(BASH_LINENO|FUNCNAME|OLDPWD|_)=' rm -f $environ_actual - echo "========================== End configuration variables =========================" + echo "================= End configuration variables ==================================" } @@ -147,11 +147,11 @@ function print_config_environment save_environment # for later use in print_config_environment shopt -s nullglob -echo "========================== Sourcing modules and default configuration ==========" +echo "================= Sourcing modules and default configuration ===================" for module in $module_dir/[0-9]*.sh; do source_module "$module" done -echo "========================== End sourcing modules and default configuration ======" +echo "================= End sourcing modules and default configuration ===============" # parse options. while [ $# -ge 1 ]; do @@ -189,7 +189,7 @@ ignore_cmd="grep -v '[/.]old' | grep -v 'ignore'" sort_cmd="while read i; do if [ -e \"\$i\"/prio-[0-9]* ]; then echo \"\$(cd \$i; ls prio-[0-9]*):\$i\"; else echo \"z:\$i\"; fi; done | sort | sed 's/^[^:]*://'" # find directories -echo "================= Scanning subdirectories of $(pwd) ============================" +echo "================= Scanning subdirectories of $start_dir ========================" for test_dir in $(find . -type d | eval "$ignore_cmd" | eval "$sort_cmd"); do (( dry_run_script )) || rm -f $test_dir/dry-run.$to_produce if [ -e "$test_dir/skip" ]; then @@ -210,7 +210,6 @@ for test_dir in $(find . -type d | eval "$ignore_cmd" | eval "$sort_cmd"); do continue fi echo "" - echo "================= Testdirectory $test_dir ======================================" if [ -e "$test_dir/stop" ] || [ -e "./stop" ]; then echo "would start $test_dir" echo "echo stopping due to stop file." @@ -218,6 +217,7 @@ for test_dir in $(find . -type d | eval "$ignore_cmd" | eval "$sort_cmd"); do fi ( cd $test_dir + echo "================= Test directory $(pwd) $date ==================================" echo "================= Sourcing config files between $config_root_dir and $(pwd) ====" # to be able to call error recovery functions in case of signals @@ -246,26 +246,25 @@ for test_dir in $(find . -type d | eval "$ignore_cmd" | eval "$sort_cmd"); do start_test_exit -1 fi done - echo "================= End sourcing config files between $config_root_dir and $(pwd)t" + echo "================= End sourcing config files between $config_root_dir and $(pwd) " print_config_environment shopt -u nullglob - export sub_prefix=$(echo $test_dir | sed 's/\//./g' | sed 's/\.\././g') if (( dry_run_script )); then echo "==> Dry Run ..." touch dry-run.$to_produce else set_host_locks - echo "========================== $(date) Starting $sub_prefix ========================" + echo "================= Starting $(pwd) $(date) ======================================" eval "$to_start" # must call exit in case of failure release_host_locks fi ) rc=$? if [ $rc -ne 0 ]; then - echo "========================== Failure $rc $(date) =================================" >&2 + echo "========================== Failure $rc $test_dir $date =========================" >&2 else - echo "========================== Finished $(date) ====================================" + echo "========================== Finished $test_dir $(date) ==========================" fi [ $rc -ne 0 ] && start_test_exit $rc done @@ -275,5 +274,5 @@ if (( dry_run_script )); then rm -f $(find . -name "dry-run.$to_produce") fi -echo "========================== Finished pwd=$(pwd) =================================" +echo "========================== Finished start directory $start_dir =================" start_test_exit 0