mirror of
https://github.com/pi-hole/docker-pi-hole.git
synced 2025-12-20 02:18:51 +00:00
add test: check if cronfile has a valid syntax
Signed-off-by: casperklein <casperklein@users.noreply.github.com>
This commit is contained in:
@@ -12,11 +12,13 @@ def test_pihole_gid_env_var(docker):
|
|||||||
func = docker.run("id -g pihole")
|
func = docker.run("id -g pihole")
|
||||||
assert "456" in func.stdout
|
assert "456" in func.stdout
|
||||||
|
|
||||||
|
|
||||||
def test_pihole_ftl_version(docker):
|
def test_pihole_ftl_version(docker):
|
||||||
func = docker.run("pihole-FTL -vv")
|
func = docker.run("pihole-FTL -vv")
|
||||||
assert func.rc == 0
|
assert func.rc == 0
|
||||||
assert "Version:" in func.stdout
|
assert "Version:" in func.stdout
|
||||||
|
|
||||||
|
|
||||||
# Wait 5 seconds for startup, then kill the start.sh script
|
# 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, grep the FTL log to see if it has been shut down cleanly
|
||||||
def test_pihole_ftl_clean_shutdown(docker):
|
def test_pihole_ftl_clean_shutdown(docker):
|
||||||
@@ -30,3 +32,14 @@ def test_pihole_ftl_clean_shutdown(docker):
|
|||||||
)
|
)
|
||||||
assert "INFO: ########## FTL terminated after" in func.stdout
|
assert "INFO: ########## FTL terminated after" in func.stdout
|
||||||
assert "(code 0)" in func.stdout
|
assert "(code 0)" in func.stdout
|
||||||
|
|
||||||
|
|
||||||
|
def test_cronfile_valid(docker):
|
||||||
|
func = docker.run(
|
||||||
|
"""
|
||||||
|
/usr/bin/crontab /crontab.txt
|
||||||
|
crond -d 8 -L /cron.log
|
||||||
|
grep 'parse error' /cron.log
|
||||||
|
"""
|
||||||
|
)
|
||||||
|
assert "parse error" not in func.stdout
|
||||||
|
|||||||
Reference in New Issue
Block a user