From 2f1082a2906de275271c14c4e7991a0381be2a8a Mon Sep 17 00:00:00 2001 From: downtownallday Date: Wed, 10 Jun 2020 00:19:59 -0400 Subject: [PATCH] More debug output --- .../system-setup/remote-nextcloud-docker.sh | 14 ++++++++++++-- tests/assets/system-setup/setup-funcs.sh | 19 ++++++++++--------- tests/suites/_mail-functions.sh | 6 +++--- 3 files changed, 25 insertions(+), 14 deletions(-) diff --git a/tests/assets/system-setup/remote-nextcloud-docker.sh b/tests/assets/system-setup/remote-nextcloud-docker.sh index c4fd47bc..07d91c0c 100755 --- a/tests/assets/system-setup/remote-nextcloud-docker.sh +++ b/tests/assets/system-setup/remote-nextcloud-docker.sh @@ -99,14 +99,24 @@ before_miab_install() { } +debug_output_conf_files() { + dump_log "/etc/mailinabox.conf" + dump_log "/etc/nsd/nsd.conf" + dump_log "/etc/postfix/main.cf" +} + miab_install() { H1 "MIAB-LDAP INSTALL" if ! setup/start.sh; then + H1 "OUTPUT OF SELECT FILES" dump_log "/var/log/syslog" 100 - dump_log "/etc/mailinabox.conf" - [ "$TRAVIS" == "true" ] && dump_log "/etc/nsd/nsd.conf" + debug_output_conf_files + H2; H2 "End"; H2 die "setup/start.sh failed!" fi + H1 "OUTPUT OF SELECT FILES" + debug_output_conf_files + H2; H2 "End"; H2 } diff --git a/tests/assets/system-setup/setup-funcs.sh b/tests/assets/system-setup/setup-funcs.sh index 2627285e..96f2d19d 100755 --- a/tests/assets/system-setup/setup-funcs.sh +++ b/tests/assets/system-setup/setup-funcs.sh @@ -1,8 +1,4 @@ -# ansi escapes for hilighting text -F_DIMTEXT=$(echo -e "\037[31m") -F_RESET=$(echo -e "\033[39m") - die() { local msg="$1" @@ -26,16 +22,21 @@ dump_log() { local log_file="$1" local lines="$2" local title="DUMP OF $log_file" - echo -n "$F_DIMTEXT" + echo "" + echo "--------" + echo -n "-------- $log_file" + if [ -z "$lines" ]; then + echo " (last $line lines)" + else + echo "" + fi + echo "--------" + if [ ! -z "$lines" ]; then - H1 "$title (last $lines lines)" tail -$lines "$log_file" else - H1 "$title" cat "$log_file" fi - H1 "END $title" - echo -n "$F_RESET" } install_qa_prerequisites() { diff --git a/tests/suites/_mail-functions.sh b/tests/suites/_mail-functions.sh index 37c33661..302b240d 100644 --- a/tests/suites/_mail-functions.sh +++ b/tests/suites/_mail-functions.sh @@ -168,11 +168,11 @@ detect_slapd_log_error() { record "$F_DANGER[ERROR] $line$F_RESET" elif [ $r -eq 2 ]; then let wc+=1 - record "$F_WARN[WARN ] $line$F_RESET" + record "$F_WARN[ WARN] $line$F_RESET" elif [ $r -eq 3 ]; then let ignored+=1 else - record "[OK ] $line" + record "[ OK] $line" fi done record "$ignored unreported/ignored log lines" @@ -214,7 +214,7 @@ detect_dovecot_log_error() { elif [ $r -eq 2 ]; then let ignored+=1 else - record "[ OK] $line" + record "[ OK] $line" fi done record "$ignored unreported/ignored log lines"