mirror of
https://github.com/pi-hole/docker-pi-hole.git
synced 2025-12-20 02:18:51 +00:00
Fixes to the startup, services, and dnsmasq references
This commit is contained in:
@@ -86,7 +86,7 @@ def cmd(request):
|
||||
|
||||
@pytest.fixture(scope='module', params=['amd64'])
|
||||
def persist_arch(request):
|
||||
'''amd64 only, dnsmasq will not start under qemu-user-static :('''
|
||||
'''amd64 only, dnsmasq/pihole-FTL(?untested?) will not start under qemu-user-static :('''
|
||||
return request.param
|
||||
|
||||
@pytest.fixture(scope='module', params=['debian'])
|
||||
@@ -157,6 +157,6 @@ Persistent Docker container for testing service post start.sh
|
||||
@pytest.fixture
|
||||
def RunningPiHole(DockerPersist, Slow, persist_webserver):
|
||||
''' Persist a fully started docker-pi-hole to help speed up subsequent tests '''
|
||||
Slow(lambda: DockerPersist.run('pgrep dnsmasq').rc == 0)
|
||||
Slow(lambda: DockerPersist.run('pgrep pihole-FTL').rc == 0)
|
||||
Slow(lambda: DockerPersist.run('pgrep {}'.format(persist_webserver) ).rc == 0)
|
||||
return DockerPersist
|
||||
|
||||
@@ -8,18 +8,18 @@ def start_cmd():
|
||||
@pytest.fixture
|
||||
def RunningPiHole(DockerPersist, Slow, persist_webserver, persist_tag, start_cmd):
|
||||
''' Override the RunningPiHole to run and check for success of a
|
||||
dnsmasq start based `pihole` script command '''
|
||||
pihole-FTL start based `pihole` script command '''
|
||||
#print DockerPersist.run('ps -ef').stdout
|
||||
assert DockerPersist.dig.run('ping -c 1 test_pihole').rc == 0
|
||||
Slow(lambda: DockerPersist.run('pgrep dnsmasq').rc == 0)
|
||||
Slow(lambda: DockerPersist.run('pgrep pihole-FTL').rc == 0)
|
||||
Slow(lambda: DockerPersist.run('pgrep {}'.format(persist_webserver)).rc == 0)
|
||||
oldpid = DockerPersist.run('pidof dnsmasq')
|
||||
oldpid = DockerPersist.run('pidof pihole-FTL')
|
||||
cmd = DockerPersist.run('pihole {}'.format(start_cmd))
|
||||
Slow(lambda: DockerPersist.run('pgrep dnsmasq').rc == 0)
|
||||
newpid = DockerPersist.run('pidof dnsmasq')
|
||||
Slow(lambda: DockerPersist.run('pgrep pihole-FTL').rc == 0)
|
||||
newpid = DockerPersist.run('pidof pihole-FTL')
|
||||
for pid in [oldpid, newpid]:
|
||||
assert pid != ''
|
||||
# ensure a new pid for dnsmasq appeared due to service restart
|
||||
# ensure a new pid for pihole-FTL appeared due to service restart
|
||||
assert oldpid != newpid
|
||||
assert cmd.rc == 0
|
||||
# Save out cmd result to check different stdout of start/enable/disable
|
||||
|
||||
Reference in New Issue
Block a user