mirror of
https://github.com/pi-hole/docker-pi-hole.git
synced 2025-12-20 02:18:51 +00:00
Major overhaul of the test suite
Signed-off-by: yubiuser <github@yubiuser.dev>
This commit is contained in:
@@ -1,17 +1,33 @@
|
||||
import pytest
|
||||
|
||||
|
||||
@pytest.mark.parametrize("test_args", ['-e "FTLCONF_webserver_port=999"'])
|
||||
# Adding 5 seconds sleep to give the emulated architecture time to run
|
||||
@pytest.mark.parametrize("docker", ["FTLCONF_webserver_port=999"], indirect=True)
|
||||
def test_ftlconf_webserver_port(docker):
|
||||
func = docker.run("pihole-FTL --config webserver.port")
|
||||
func = docker.run("echo ${FTLCONF_webserver_port}")
|
||||
assert "999" in func.stdout
|
||||
func = docker.run(
|
||||
"""
|
||||
sleep 5
|
||||
pihole-FTL --config webserver.port
|
||||
"""
|
||||
)
|
||||
assert "999" in func.stdout
|
||||
|
||||
|
||||
# Adding 5 seconds sleep to give the emulated architecture time to run
|
||||
@pytest.mark.parametrize(
|
||||
"test_args", ['-e "FTLCONF_dns_upstreams=1.2.3.4;5.6.7.8#1234"']
|
||||
"docker", ["FTLCONF_dns_upstreams=1.2.3.4;5.6.7.8#1234"], indirect=True
|
||||
)
|
||||
def test_ftlconf_dns_upstreams(docker):
|
||||
func = docker.run("pihole-FTL --config dns.upstreams")
|
||||
func = docker.run("echo ${FTLCONF_dns_upstreams}")
|
||||
assert "1.2.3.4;5.6.7.8#1234" in func.stdout
|
||||
func = docker.run(
|
||||
"""
|
||||
sleep 5
|
||||
pihole-FTL --config dns.upstreams
|
||||
"""
|
||||
)
|
||||
assert "[ 1.2.3.4, 5.6.7.8#1234 ]" in func.stdout
|
||||
|
||||
|
||||
@@ -24,7 +40,7 @@ def test_random_password_assigned_fresh_start(docker):
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"test_args", ['-e "FTLCONF_webserver_api_password=1234567890"']
|
||||
"docker", ["FTLCONF_webserver_api_password=1234567890"], indirect=True
|
||||
)
|
||||
def test_password_set_by_envvar(docker):
|
||||
func = docker.run(CMD_SETUP_WEB_PASSWORD)
|
||||
|
||||
Reference in New Issue
Block a user