nginx-test: add log file detection for relative paths

This commit is contained in:
Kristian Schuster 2019-09-26 21:24:15 +02:00
parent e64e49a551
commit d17d30d6a7
No known key found for this signature in database
GPG Key ID: 41D9CF63A7E6A4EB

View File

@ -2181,8 +2181,9 @@
if [ ! "${VALUE}" = "" ]; then if [ ! "${VALUE}" = "" ]; then
# If multiple values follow, select first one # If multiple values follow, select first one
VALUE=$(echo ${VALUE} | awk '{ print $1 }') VALUE=$(echo ${VALUE} | awk '{ print $1 }')
if [ ! -f ${VALUE} ]; then # Find both, log files provided with full or relative path
LogText "Result: could not find referenced log file ${VALUE} in nginx configuration" if [ ! -f ${VALUE} -a ! -f "${CONFIG_FILE%nginx.conf}${VALUE}" ]; then
LogText "Result: could not find log file ${VALUE} referenced in nginx configuration"
NGINX_ACCESS_LOG_MISSING=1 NGINX_ACCESS_LOG_MISSING=1
fi fi
fi fi
@ -2218,7 +2219,8 @@
# Check if log file exists # Check if log file exists
FILE=$(echo ${VALUE} | awk '{ print $1 }') FILE=$(echo ${VALUE} | awk '{ print $1 }')
if [ ! "${FILE}" = "" ]; then if [ ! "${FILE}" = "" ]; then
if [ ! -f ${FILE} ]; then # Find both, log files provided with full or relative path
if [ ! -f ${FILE} -a ! -f "${CONFIG_FILE%nginx.conf}${FILE}" ]; then
NGINX_ERROR_LOG_MISSING=1 NGINX_ERROR_LOG_MISSING=1
fi fi
else else