Skip to content

Commit 91090de

Browse files
committed
Use wait-for function also in tests
Signed-off-by: yubiuser <github@yubiuser.dev>
1 parent 47b02d3 commit 91090de

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

src/start.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ start() {
7777

7878
# Wait until the FTL log contains the "FTL started" message before continuing, timeout after 10 seconds
7979
logsize_before=$(stat -c%s /var/log/pihole/FTL.log)
80-
/usr/bin/pihole-FTL wait-for '########## FTL started' /var/log/pihole/FTL.log 10 "${logsize_before}"
80+
pihole-FTL wait-for '########## FTL started' /var/log/pihole/FTL.log 10 "${logsize_before}" > /dev/null
8181

8282
pihole updatechecker
8383
local versionsOutput

test/tests/test_general.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,17 +50,19 @@ def test_pihole_ftl_architecture(docker):
5050

5151

5252
# Wait 5 seconds for startup, then kill the start.sh script
53-
# Finally, grep the FTL log to see if it has been shut down cleanly
53+
# Finally, check the FTL log to see if it has been shut down cleanly
5454
def test_pihole_ftl_clean_shutdown(docker):
5555
func = docker.run(
5656
"""
5757
sleep 5
5858
killall --signal 15 start.sh
59-
sleep 5
60-
grep 'terminated' /var/log/pihole/FTL.log
59+
pihole-FTL wait-for '########## FTL terminated after' /var/log/pihole/FTL.log 10
6160
"""
6261
)
63-
assert "INFO: ########## FTL terminated after" in func.stdout
62+
assert (
63+
'Found string "########## FTL terminated after" in file /var/log/pihole/FTL.log'
64+
in func.stdout
65+
)
6466
assert "(code 0)" in func.stdout
6567

6668

0 commit comments

Comments
 (0)