From d3c49d39481ef659662b1ebe564aa68429ce1436 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Sat, 31 Aug 2024 17:09:22 +0200 Subject: [PATCH] curl tests: More debug UX tweaks --- lib/tests.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/tests.sh b/lib/tests.sh index 60057c0..3054733 100644 --- a/lib/tests.sh +++ b/lib/tests.sh @@ -280,12 +280,16 @@ _VALIDATE_THAT_APP_CAN_BE_ACCESSED () { do LXC_EXEC "journalctl --no-pager --no-hostname -n 30 -u $SERVICE"; done - LXC_EXEC "tail -v -n 15 \$(find /var/log/{php*,$app_id_to_check} -mmin -3 2>/dev/null)" + LXC_EXEC "test -d /var/log/$app_id_to_check && ls -ld /var/log/$app_id_to_check && ls -l /var/log/$app_id_to_check && tail -v -n 15 \$(find /var/log/$app_id_to_check 2>/dev/null)" + if grep -qi php $package_path/manifest.toml + then + LXC_EXEC "ls -l /var/log/php* 2>/dev/null; tail -v -n 15 \$(find /var/log/php* 2>/dev/null)" + fi fi # Display nginx logs only if for non-50x errors (sor for example 404) to avoid poluting the debug log if [[ $curl_result != 5 ]] && [[ $curl_result != 0 ]] then - LXC_EXEC "tail -v -n 15 \$(find /var/log/nginx/ -mmin -3)" + LXC_EXEC "tail -v -n 15 /var/log/nginx/*$domain_to_check*" fi