Merge pull request #1898 from pi-hole/wait-for

Use FTL's build-in wait-for command for checking the logs
This commit is contained in:
Adam Warner
2025-09-30 18:42:36 +01:00
committed by GitHub
2 changed files with 8 additions and 5 deletions

View File

@@ -75,10 +75,13 @@ start() {
sleep 0.5
done
# Wait until the FTL log contains the "FTL started" message before continuing
while ! grep -q '########## FTL started' /var/log/pihole/FTL.log; do
sleep 0.5
done
# Wait until the FTL log contains the "FTL started" message before continuing, timeout after 10 seconds
# exit if we do not find it
pihole-FTL wait-for '########## FTL started' /var/log/pihole/FTL.log 10 "0 > /dev/null"
if [ $? -ne 0 ]; then
echo " [✗] FTL did not start - stopping container"
exit 1
fi
pihole updatechecker
local versionsOutput

View File

@@ -50,7 +50,7 @@ def test_pihole_ftl_architecture(docker):
# Wait 5 seconds for startup, then kill the start.sh script
# Finally, grep the FTL log to see if it has been shut down cleanly
# Finally, check the FTL log to see if it has been shut down cleanly
def test_pihole_ftl_clean_shutdown(docker):
func = docker.run(
"""