fix ipv6 test

This commit is contained in:
diginc 2018-01-04 22:30:40 -06:00
parent c4dc16685a
commit 3bcdd27cb9
8 changed files with 14 additions and 13 deletions

View File

@ -27,7 +27,7 @@ THIS_DIR = os.path.dirname(os.path.abspath(__file__))
base_vars = {
'name': 'diginc/pi-hole',
'maintainer' : 'adam@diginc.us',
's6_version' : 'v1.21.2.1',
's6_version' : 'v1.21.2.2',
}
os_base_vars = {

View File

@ -11,7 +11,7 @@ ENV PATH /opt/pihole:${PATH}
COPY install.sh /usr/local/bin/docker-install.sh
ENV setupVars /etc/pihole/setupVars.conf
ENV PIHOLE_INSTALL /tmp/ph_install.sh
ENV S6OVERLAY_RELEASE https://github.com/just-containers/s6-overlay/releases/download/v1.21.2.1/s6-overlay-aarch64.tar.gz
ENV S6OVERLAY_RELEASE https://github.com/just-containers/s6-overlay/releases/download/v1.21.2.2/s6-overlay-aarch64.tar.gz
RUN apt-get update && \
apt-get install -y wget curl net-tools cron && \

View File

@ -11,7 +11,7 @@ ENV PATH /opt/pihole:${PATH}
COPY install.sh /usr/local/bin/docker-install.sh
ENV setupVars /etc/pihole/setupVars.conf
ENV PIHOLE_INSTALL /tmp/ph_install.sh
ENV S6OVERLAY_RELEASE https://github.com/just-containers/s6-overlay/releases/download/v1.21.2.1/s6-overlay-amd64.tar.gz
ENV S6OVERLAY_RELEASE https://github.com/just-containers/s6-overlay/releases/download/v1.21.2.2/s6-overlay-amd64.tar.gz
RUN apt-get update && \
apt-get install -y wget curl net-tools cron && \

View File

@ -11,7 +11,7 @@ ENV PATH /opt/pihole:${PATH}
COPY install.sh /usr/local/bin/docker-install.sh
ENV setupVars /etc/pihole/setupVars.conf
ENV PIHOLE_INSTALL /tmp/ph_install.sh
ENV S6OVERLAY_RELEASE https://github.com/just-containers/s6-overlay/releases/download/v1.21.2.1/s6-overlay-armhf.tar.gz
ENV S6OVERLAY_RELEASE https://github.com/just-containers/s6-overlay/releases/download/v1.21.2.2/s6-overlay-armhf.tar.gz
RUN apt-get update && \
apt-get install -y wget curl net-tools cron && \

View File

@ -27,9 +27,9 @@ validate_env() {
# Optional IPv6 is a valid address
if [[ -n "$ServerIPv6" ]] ; then
if [[ "$ServerIPv6" == 'kernel' ]] ; then
echo "WARNING: You passed in IPv6 with a value of 'kernel', this maybe beacuse you do not have IPv6 enabled on your network"
echo "ERROR: You passed in IPv6 with a value of 'kernel', this maybe beacuse you do not have IPv6 enabled on your network"
unset ServerIPv6
return
exit 1
fi
if nc -w 1 -z "$ServerIPv6" 53 2>&1 | grep -q "$nc_error" || ! ip route get "$ServerIPv6" > /dev/null ; then
echo "ERROR: ServerIPv6 Environment variable ($ServerIPv6) doesn't appear to be a valid IPv6 address"
@ -91,7 +91,7 @@ setup_dnsmasq() {
setup_dnsmasq_dns "$DNS1" "$DNS2"
setup_dnsmasq_interface "$INTERFACE"
ProcessDNSSettings
dnsmasq -7 /etc/dnsmasq.d --interface="${INTERFACE:-eth0}"
# dnsmasq -7 /etc/dnsmasq.d --interface="${INTERFACE:-eth0}"
}
setup_dnsmasq_hostnames() {

View File

@ -1,5 +1,5 @@
#!/usr/bin/with-contenv bash
set -e
set
bashCmd='bash -e'
if [ "${PH_VERBOSE:-0}" -gt 0 ] ; then
@ -8,3 +8,7 @@ if [ "${PH_VERBOSE:-0}" -gt 0 ] ; then
fi
$bashCmd /start.sh
dnsmasq -7 /etc/dnsmasq.d
gravity.sh
kill -9 $(pgrep dnsmasq) || true

View File

@ -34,7 +34,4 @@ test_framework_stubbing
[ -f /.piholeFirstBoot ] && rm /.piholeFirstBoot
gravity.sh
killall -9 dnsmasq
echo "::: Docker start setup complete - beginning s6 services"
echo "::: Docker start setup complete"

View File

@ -24,7 +24,7 @@ def test_ServerIP_missing_triggers_start_error(Docker):
@pytest.mark.parametrize('args,error_msg,expect_rc', [
('-e ServerIP="1.2.3.z"', "ServerIP Environment variable (1.2.3.z) doesn't appear to be a valid IPv4 address",1),
('-e ServerIP="1.2.3.4" -e ServerIPv6="1234:1234:1234:ZZZZ"', "Environment variable (1234:1234:1234:ZZZZ) doesn't appear to be a valid IPv6 address",1),
('-e ServerIP="1.2.3.4" -e ServerIPv6="kernel"', "WARNING: You passed in IPv6 with a value of 'kernel'",0),
('-e ServerIP="1.2.3.4" -e ServerIPv6="kernel"', "ERROR: You passed in IPv6 with a value of 'kernel'",1),
])
def test_ServerIP_invalid_IPs_triggers_exit_error(Docker, error_msg, expect_rc):
''' When args to docker are empty start.sh exits saying ServerIP is required '''