From 2717970c723eeba7d2d9cf71d5261aa3672992fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bojan=20=C4=8Cekrli=C4=87?= Date: Mon, 28 Mar 2022 20:15:20 +0200 Subject: [PATCH] Fix: Fix issues found after integration tests --- integration-tests.sh | 9 ++++++++- scripts/common-run.sh | 11 ++++++----- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/integration-tests.sh b/integration-tests.sh index f743e57..cf6f384 100755 --- a/integration-tests.sh +++ b/integration-tests.sh @@ -2,6 +2,13 @@ set -e cd integration-tests +FIND="$(which find)" + +# Support running on macOS with GNU installed under "g*" prefix +if command -v gfind > /dev/null 2>&1; then + FIND="$(which gfind)" +fi + run_test() { local exit_code echo @@ -28,7 +35,7 @@ if [[ $# -gt 0 ]]; then shift done else - for i in `find -maxdepth 1 -type d | grep -Ev "^./(tester|xoauth2)" | sort`; do + for i in `${FIND} -maxdepth 1 -type d | grep -Ev "^./(tester|xoauth2)" | sort`; do i="$(basename "$i")" if [ "$i" == "." ] || [ "$i" == ".." ]; then continue diff --git a/scripts/common-run.sh b/scripts/common-run.sh index c3776ee..62e721b 100755 --- a/scripts/common-run.sh +++ b/scripts/common-run.sh @@ -45,7 +45,7 @@ anon_email_log() { } ' /etc/rsyslog.conf else - info "Emails in the logs will not be anonymized. Set ${emphasis}ANONYMIZE_EMAILS${reset} to enable this feature." + notice "Emails in the logs will not be anonymized. Set ${emphasis}ANONYMIZE_EMAILS${reset} to enable this feature." fi } @@ -72,24 +72,25 @@ setup_conf() { reown_folders() { mkdir -p /var/spool/postfix/pid /var/spool/postfix/dev /var/spool/postfix/private /var/spool/postfix/public - if [[ "${SKIP_ROOT_SPOOL_CHOWN}" == "1" ]; then + if [[ "${SKIP_ROOT_SPOOL_CHOWN}" == "1" ]]; then warn "${emphasis}SKIP_ROOT_SPOOL_CHOWN${reset} is set. Script will not chown ${emphasis}/var/spool/postfix/${reset}. Make sure you know what you're doing." else - debug "Reowing ${emphasis}/var/spool/postfix/${reset}" + debug "Reowing ${emphasis}root: /var/spool/postfix/${reset}" if ! chown root: /var/spool/postfix/; then warn "Cannot reown ${emphasis}root:${reset} for ${emphasis}/var/spool/postfix/${reset}. Your installation might be broken." fi + debug "Reowing ${emphasis}root: /var/spool/postfix/pid/${reset}" if ! chown root: /var/spool/postfix/pid; then warn "Cannot reown ${emphasis}root:${reset} for ${emphasis}/var/spool/postfix/pid/${reset}. Your installation might be broken." fi fi - debug "Reowing ${emphasis}/var/spool/postfix/private/${reset}" + debug "Reowing ${emphasis}postfix:postdrop /var/spool/postfix/private/${reset}" if ! chown -R postfix:postdrop /var/spool/postfix/private; then warn "Cannot reown ${emphasis}postfix:postdrop${reset} for ${emphasis}/var/spool/postfix/private${reset}. Your installation might be broken." fi - debug "Reowing ${emphasis}/var/spool/postfix/public/${reset}" + debug "Reowing ${emphasis}postfix:postdrop /var/spool/postfix/public/${reset}" if ! chown -R postfix:postdrop /var/spool/postfix/public; then warn "Cannot reown ${emphasis}postfix:postdrop${reset} for ${emphasis}/var/spool/postfix/public${reset}. Your installation might be broken." fi