Fixes to the startup, services, and dnsmasq references

This commit is contained in:
diginc
2018-07-03 00:19:01 -05:00
parent 041ef30d42
commit ad6b4be403
9 changed files with 17 additions and 17 deletions

View File

@@ -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

View File

@@ -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