]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fix support for test-suite/squidconf directive parameter files (#2458)
authorAlex Rousskov <rousskov@measurement-factory.com>
Sun, 12 Jul 2026 21:38:04 +0000 (21:38 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Sun, 12 Jul 2026 21:38:12 +0000 (21:38 +0000)
Those files were never found. 2022 commit d37a3744 probably missed this
bug because the corresponding `squid -k parse` failures (quoted below)
do not result in non-zero exit status code. That failure handling
problem deserves a dedicated fix.

    ERROR: Can not open file empty.conf for reading
        configuration context: ./squidconf/regressions-3.4.0.1.conf(27)

test-suite/test-squid-conf.sh

index 40d25dc5f18071eaa3941f275b6a7bc0ba06a1ea..7d88ea56a02b5e6bd21436e8354eabe78a41cbb2 100755 (executable)
@@ -243,7 +243,11 @@ fi
 
 errorLog="squid-stderr.log"
 
-$sbindir/squid -k parse -f $configFile 2> $errorLog
+# Start `$sbindir/squid` from $configFile's directory, so that Squid can find files included by $configFile.
+# If we decide to support relative `$sbindir` paths, we will add a portable realpath replacement.
+configFileDirName=`dirname $configFile`
+configFileBaseName=`basename $configFile`
+(cd $configFileDirName && $sbindir/squid -k parse -f $configFileBaseName) 2> $errorLog
 result=$?
 
 # this is the value we return to our caller;