commit
26e1c82fd0
|
@ -37,7 +37,7 @@ os_base_vars = {
|
|||
}
|
||||
|
||||
images = {
|
||||
'v4.1': [
|
||||
'v4.1.1': [
|
||||
{
|
||||
'base': 'pihole/debian-base:latest',
|
||||
'arch': 'amd64'
|
||||
|
@ -95,7 +95,7 @@ def build_dockerfiles(args):
|
|||
if arch == 'armel':
|
||||
print "Skipping armel, incompatible upstream binaries/broken"
|
||||
continue
|
||||
build('pihole', 'v4.1', arch, args)
|
||||
build('pihole', 'v4.1.1', arch, args)
|
||||
|
||||
|
||||
def build(docker_repo, version, arch, args):
|
||||
|
|
|
@ -31,11 +31,11 @@ ENV S6_KEEP_ENV 1
|
|||
ENV S6_BEHAVIOUR_IF_STAGE2_FAILS 2
|
||||
ENV FTL_CMD debug
|
||||
|
||||
ENV VERSION v4.1
|
||||
ENV VERSION v4.1.1
|
||||
ENV ARCH amd64
|
||||
ENV PATH /opt/pihole:${PATH}
|
||||
|
||||
LABEL image="pihole/pihole:v4.1_amd64"
|
||||
LABEL image="pihole/pihole:v4.1.1_amd64"
|
||||
LABEL maintainer="adam@diginc.us"
|
||||
LABEL url="https://www.github.com/pi-hole/docker-pi-hole"
|
||||
|
||||
|
|
10
install.sh
10
install.sh
|
@ -3,8 +3,8 @@
|
|||
mkdir -p /etc/pihole/
|
||||
mkdir -p /var/run/pihole
|
||||
# Production tags with valid web footers
|
||||
export CORE_TAG='v4.1'
|
||||
export WEB_TAG='v4.1'
|
||||
export CORE_TAG='v4.1.1'
|
||||
export WEB_TAG='v4.1.1'
|
||||
# Only use for pre-production / testing
|
||||
export USE_CUSTOM_BRANCHES=false
|
||||
|
||||
|
@ -14,7 +14,7 @@ curl -L -s $S6OVERLAY_RELEASE | tar xvzf - -C /
|
|||
mv /init /s6-init
|
||||
|
||||
if [[ $USE_CUSTOM_BRANCHES == true ]] ; then
|
||||
CORE_TAG='release/v4.1'
|
||||
CORE_TAG='release/vx.y.z'
|
||||
fi
|
||||
|
||||
# debconf-apt-progress seems to hang so get rid of it too
|
||||
|
@ -81,9 +81,9 @@ fi
|
|||
|
||||
sed -i 's/readonly //g' /opt/pihole/webpage.sh
|
||||
|
||||
# Replace the call to `updatePiholeFunc` in arg parse with new `unsupportedFunc`
|
||||
sed -i $'s/helpFunc() {/unsupportedFunc() {\\\n echo "Function not supported in Docker images"\\\n exit 0\\\n}\\\n\\\nhelpFunc() {/g' /usr/local/bin/pihole
|
||||
# Replace references to `updatePiholeFunc` with new `unsupportedFunc`
|
||||
sed -i $'s/updatePiholeFunc;;/unsupportedFunc;;/g' /usr/local/bin/pihole
|
||||
sed -i $'s/)\s*updatePiholeFunc/) unsupportedFunc/g' /usr/local/bin/pihole
|
||||
|
||||
touch /.piholeFirstBoot
|
||||
|
||||
|
|
|
@ -67,7 +67,7 @@ def arch(request):
|
|||
@pytest.fixture()
|
||||
def version(request):
|
||||
''' TODO: include from external .py that can be shared with Dockerfile.py / Tests / deploy scripts '''
|
||||
return 'v4.1'
|
||||
return 'v4.1.1'
|
||||
|
||||
@pytest.fixture()
|
||||
def tag(request, version, arch):
|
||||
|
@ -95,7 +95,7 @@ def persist_arch(request):
|
|||
@pytest.fixture(scope='module')
|
||||
def persist_version(request):
|
||||
''' TODO: include from external .py that can be shared with Dockerfile.py / Tests / deploy scripts '''
|
||||
return 'v4.1'
|
||||
return 'v4.1.1'
|
||||
|
||||
@pytest.fixture(scope='module')
|
||||
def persist_args(request):
|
||||
|
|
|
@ -1,14 +1,18 @@
|
|||
import pytest
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def start_cmd():
|
||||
''' broken by default, required override '''
|
||||
return None
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def RunningPiHole(DockerPersist, Slow, persist_webserver, persist_tag, start_cmd):
|
||||
''' Override the RunningPiHole to run and check for success of a
|
||||
pihole-FTL start based `pihole` script command '''
|
||||
pihole-FTL start based `pihole` script command
|
||||
|
||||
Individual tests all must override start_cmd'''
|
||||
#print DockerPersist.run('ps -ef').stdout
|
||||
assert DockerPersist.dig.run('ping -c 1 test_pihole').rc == 0
|
||||
Slow(lambda: DockerPersist.run('pgrep pihole-FTL').rc == 0)
|
||||
|
@ -26,16 +30,12 @@ def RunningPiHole(DockerPersist, Slow, persist_webserver, persist_tag, start_cmd
|
|||
DockerPersist.cmd = cmd
|
||||
return DockerPersist
|
||||
|
||||
@pytest.mark.parametrize('start_cmd', ['start_cmd'])
|
||||
def test_pihole_start_cmd(RunningPiHole, start_cmd, persist_tag):
|
||||
''' the start_cmd tests are all built into the RunningPiHole fixture in this file '''
|
||||
assert RunningPiHole.cmd.stdout == START_DNS_STDOUT[persist_tag]
|
||||
|
||||
@pytest.mark.parametrize('start_cmd,hostname,expected_ip, expected_messages', [
|
||||
('enable', 'pi.hole', '127.0.0.1', ['Enabling blocking','Pi-hole Enabled']),
|
||||
('disable', 'pi.hole', '127.0.0.1', ['Disabling blocking','Pi-hole Disabled']),
|
||||
])
|
||||
def test_pihole_start_cmd(RunningPiHole, Dig, persist_tag, start_cmd, hostname, expected_ip, expected_messages):
|
||||
def test_pihole_enable_disable_command(RunningPiHole, Dig, persist_tag, start_cmd, hostname, expected_ip, expected_messages):
|
||||
''' the start_cmd tests are all built into the RunningPiHole fixture in this file '''
|
||||
dig_cmd = "dig +time=1 +noall +answer {} @test_pihole".format(hostname)
|
||||
lookup = RunningPiHole.dig.run(dig_cmd)
|
||||
|
@ -45,3 +45,10 @@ def test_pihole_start_cmd(RunningPiHole, Dig, persist_tag, start_cmd, hostname,
|
|||
|
||||
for part_of_output in expected_messages:
|
||||
assert part_of_output in RunningPiHole.cmd.stdout
|
||||
|
||||
@pytest.mark.parametrize('start_cmd,expected_message', [
|
||||
('-up', 'Function not supported in Docker images')
|
||||
])
|
||||
def test_pihole_update_command(RunningPiHole, start_cmd, expected_message):
|
||||
assert RunningPiHole.cmd.stdout.strip() == expected_message
|
||||
|
||||
|
|
Loading…
Reference in New Issue