Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/pi-hole/pi-hole.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Warner <me@adamwarner.co.uk>2020-12-03 00:37:42 +0300
committerGitHub <noreply@github.com>2020-12-03 00:37:42 +0300
commit0d8ece1be249fdc5993f01a45f8d0464257df819 (patch)
tree8f09debfe45664cbad7d86157ec6b5647625aadc
parentfee1b8b736a402c8b72a68d6f2449e9061477dee (diff)
parent84432622148e8ad14430a430253775a51cf0d975 (diff)
Merge pull request #3889 from pi-hole/release/v5.2.1v5.2.1
Pi-hole Core release v5.2.1
-rw-r--r--.github/workflows/test.yml25
-rw-r--r--.travis.yml5
-rwxr-xr-xadvanced/Scripts/piholeDebug.sh4
-rwxr-xr-xadvanced/Scripts/webpage.sh38
-rwxr-xr-xautomated install/basic-install.sh10
-rwxr-xr-xautotest1
-rw-r--r--test/_centos_7.Dockerfile (renamed from test/centos_7.Dockerfile)0
-rw-r--r--test/_centos_8.Dockerfile (renamed from test/centos_8.Dockerfile)0
-rw-r--r--test/_debian_10.Dockerfile (renamed from test/debian_10.Dockerfile)0
-rw-r--r--test/_debian_9.Dockerfile (renamed from test/debian_9.Dockerfile)0
-rw-r--r--test/_fedora_31.Dockerfile (renamed from test/fedora_31.Dockerfile)0
-rw-r--r--test/_fedora_32.Dockerfile (renamed from test/fedora_32.Dockerfile)0
-rw-r--r--test/_ubuntu_16.Dockerfile (renamed from test/ubuntu_16.Dockerfile)2
-rw-r--r--test/_ubuntu_18.Dockerfile (renamed from test/ubuntu_18.Dockerfile)0
-rw-r--r--test/_ubuntu_20.Dockerfile (renamed from test/ubuntu_20.Dockerfile)0
-rw-r--r--test/conftest.py10
-rw-r--r--test/requirements.txt (renamed from requirements.txt)0
-rw-r--r--test/setup.py (renamed from setup.py)0
-rw-r--r--test/test_000_build_containers.py29
-rw-r--r--test/test_centos_7_support.py60
-rw-r--r--test/test_centos_8_support.py65
-rw-r--r--test/test_centos_common_support.py120
-rw-r--r--test/test_centos_fedora_common_support.py65
-rw-r--r--test/test_centos_fedora_support.py327
-rw-r--r--test/test_fedora_support.py15
-rw-r--r--test/test_shellcheck.py18
-rw-r--r--test/tox.centos_7.ini8
-rw-r--r--test/tox.centos_8.ini8
-rw-r--r--test/tox.debian_10.ini8
-rw-r--r--test/tox.debian_9.ini8
-rw-r--r--test/tox.fedora_31.ini8
-rw-r--r--test/tox.fedora_32.ini8
-rw-r--r--test/tox.ubuntu_16.ini8
-rw-r--r--test/tox.ubuntu_18.ini8
-rw-r--r--test/tox.ubuntu_20.ini8
-rw-r--r--tox.ini16
36 files changed, 469 insertions, 413 deletions
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
new file mode 100644
index 00000000..8e19e550
--- /dev/null
+++ b/.github/workflows/test.yml
@@ -0,0 +1,25 @@
+name: Test Supported Distributions
+
+on:
+ pull_request:
+ types: [opened, synchronize, reopened, ready_for_review]
+
+jobs:
+ distro-test:
+ if: github.event.pull_request.draft == false
+ runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ distro: [debian_9, debian_10, ubuntu_16, ubuntu_18, ubuntu_20, centos_7, centos_8, fedora_31, fedora_32]
+ env:
+ DISTRO: ${{matrix.distro}}
+ steps:
+ - uses: actions/checkout@v1
+ - name: Set up Python 3.7
+ uses: actions/setup-python@v2
+ with:
+ python-version: 3.7
+ - name: Install dependencies
+ run: pip install -r test/requirements.txt
+ - name: Test with tox
+ run: tox -c test/tox.${DISTRO}.ini
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index 3d80ab6e..00000000
--- a/.travis.yml
+++ /dev/null
@@ -1,5 +0,0 @@
-import:
- - source: pi-hole/.github:/build-configs/core.yml@main
- if: branch = master
- - source: pi-hole/.github:/build-configs/core.yml@latest
- if: branch != master
diff --git a/advanced/Scripts/piholeDebug.sh b/advanced/Scripts/piholeDebug.sh
index 5c2b5f1c..bc83d70a 100755
--- a/advanced/Scripts/piholeDebug.sh
+++ b/advanced/Scripts/piholeDebug.sh
@@ -560,7 +560,7 @@ processor_check() {
else
# Check if the architecture is currently supported for FTL
case "${PROCESSOR}" in
- "amd64") log_write "${TICK} ${COL_GREEN}${PROCESSOR}${COL_NC}"
+ "amd64" | "x86_64") log_write "${TICK} ${COL_GREEN}${PROCESSOR}${COL_NC}"
;;
"armv6l") log_write "${TICK} ${COL_GREEN}${PROCESSOR}${COL_NC}"
;;
@@ -977,7 +977,7 @@ make_array_from_file() {
# Otherwise, read the file line by line
while IFS= read -r line;do
# Othwerise, strip out comments and blank lines
- new_line=$(echo "${line}" | sed -e 's/#.*$//' -e '/^$/d')
+ new_line=$(echo "${line}" | sed -e 's/^\s*#.*$//' -e '/^$/d')
# If the line still has content (a non-zero value)
if [[ -n "${new_line}" ]]; then
# Put it into the array
diff --git a/advanced/Scripts/webpage.sh b/advanced/Scripts/webpage.sh
index 15471ad4..f26ce11d 100755
--- a/advanced/Scripts/webpage.sh
+++ b/advanced/Scripts/webpage.sh
@@ -217,6 +217,12 @@ trust-anchor=.,20326,8,2,E06D44B80B8F1D39A95C0B0D7C65D08458E880409BBC68345710423
if [[ "${CONDITIONAL_FORWARDING}" == true ]]; then
# Convert legacy "conditional forwarding" to rev-server configuration
+ # Remove any existing REV_SERVER settings
+ delete_setting "REV_SERVER"
+ delete_setting "REV_SERVER_DOMAIN"
+ delete_setting "REV_SERVER_TARGET"
+ delete_setting "REV_SERVER_CIDR"
+
REV_SERVER=true
add_setting "REV_SERVER" "true"
@@ -226,7 +232,25 @@ trust-anchor=.,20326,8,2,E06D44B80B8F1D39A95C0B0D7C65D08458E880409BBC68345710423
REV_SERVER_TARGET="${CONDITIONAL_FORWARDING_IP}"
add_setting "REV_SERVER_TARGET" "${REV_SERVER_TARGET}"
- REV_SERVER_CIDR="${CONDITIONAL_FORWARDING_REVERSE}"
+ #Convert CONDITIONAL_FORWARDING_REVERSE if necessary e.g:
+ # 1.1.168.192.in-addr.arpa to 192.168.1.1/32
+ # 1.168.192.in-addr.arpa to 192.168.1.0/24
+ # 168.192.in-addr.arpa to 192.168.0.0/16
+ # 192.in-addr.arpa to 192.0.0.0/8
+ if [[ "${CONDITIONAL_FORWARDING_REVERSE}" == *"in-addr.arpa" ]];then
+ arrRev=("${CONDITIONAL_FORWARDING_REVERSE//./ }")
+ case ${#arrRev[@]} in
+ 6 ) REV_SERVER_CIDR="${arrRev[3]}.${arrRev[2]}.${arrRev[1]}.${arrRev[0]}/32";;
+ 5 ) REV_SERVER_CIDR="${arrRev[2]}.${arrRev[1]}.${arrRev[0]}.0/24";;
+ 4 ) REV_SERVER_CIDR="${arrRev[1]}.${arrRev[0]}.0.0/16";;
+ 3 ) REV_SERVER_CIDR="${arrRev[0]}.0.0.0/8";;
+ esac
+ else
+ # Set REV_SERVER_CIDR to whatever value it was set to
+ REV_SERVER_CIDR="${CONDITIONAL_FORWARDING_REVERSE}"
+ fi
+
+ # If REV_SERVER_CIDR is not converted by the above, then use the REV_SERVER_TARGET variable to derive it
if [ -z "${REV_SERVER_CIDR}" ]; then
# Convert existing input to /24 subnet (preserves legacy behavior)
# This sed converts "192.168.1.2" to "192.168.1.0/24"
@@ -253,6 +277,13 @@ trust-anchor=.,20326,8,2,E06D44B80B8F1D39A95C0B0D7C65D08458E880409BBC68345710423
# This follows https://support.mozilla.org/en-US/kb/configuring-networks-disable-dns-over-https
# (sourced 7th September 2019)
add_dnsmasq_setting "server=/use-application-dns.net/"
+
+ # We need to process DHCP settings here as well to account for possible
+ # changes in the non-FQDN forwarding. This cannot be done in 01-pihole.conf
+ # as we don't want to delete all local=/.../ lines so it's much safer to
+ # simply rewrite the entire corresponding config file (which is what the
+ # DHCP settings subroutie is doing)
+ ProcessDHCPSettings
}
SetDNSServers() {
@@ -375,6 +406,11 @@ dhcp-leasefile=/etc/pihole/dhcp.leases
if [[ "${PIHOLE_DOMAIN}" != "none" ]]; then
echo "domain=${PIHOLE_DOMAIN}" >> "${dhcpconfig}"
+
+ # When there is a Pi-hole domain set and "Never forward non-FQDNs" is
+ # ticked, we add `local=/domain/` to tell FTL that this domain is purely
+ # local and FTL may answer queries from /etc/hosts or DHCP but should
+ # never forward queries on that domain to any upstream servers
if [[ "${DNS_FQDN_REQUIRED}" == true ]]; then
echo "local=/${PIHOLE_DOMAIN}/" >> "${dhcpconfig}"
fi
diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh
index 21e699c7..45e96354 100755
--- a/automated install/basic-install.sh
+++ b/automated install/basic-install.sh
@@ -393,7 +393,7 @@ elif is_command rpm ; then
PKG_INSTALL=("${PKG_MANAGER}" install -y)
PKG_COUNT="${PKG_MANAGER} check-update | egrep '(.i686|.x86|.noarch|.arm|.src)' | wc -l"
INSTALLER_DEPS=(git iproute newt procps-ng which chkconfig bind-utils)
- PIHOLE_DEPS=(cronie curl findutils nmap-ncat sudo unzip libidn2 psmisc sqlite libcap)
+ PIHOLE_DEPS=(cronie curl findutils nmap-ncat sudo unzip libidn2 psmisc sqlite libcap lsof)
PIHOLE_WEB_DEPS=(lighttpd lighttpd-fastcgi php-common php-cli php-pdo php-xml php-json php-intl)
LIGHTTPD_USER="lighttpd"
LIGHTTPD_GROUP="lighttpd"
@@ -528,8 +528,10 @@ make_repo() {
printf " %b %s..." "${INFO}" "${str}"
# If the directory exists,
if [[ -d "${directory}" ]]; then
- # delete everything in it so git can clone into it
- rm -rf "${directory}"
+ # Return with a 1 to exit the installer. We don't want to overwrite what could already be here in case it is not ours
+ str="Unable to clone ${remoteRepo} into ${directory} : Directory already exists"
+ printf "%b %b%s\\n" "${OVER}" "${CROSS}" "${str}"
+ return 1
fi
# Clone the repo and return the return code from this command
git clone -q --depth 20 "${remoteRepo}" "${directory}" &> /dev/null || return $?
@@ -1913,7 +1915,7 @@ finalExports() {
# If the setup variable file exists,
if [[ -e "${setupVars}" ]]; then
# update the variables in the file
- sed -i.update.bak '/PIHOLE_INTERFACE/d;/IPV4_ADDRESS/d;/IPV6_ADDRESS/d;/PIHOLE_DNS_1/d;/PIHOLE_DNS_2/d;/QUERY_LOGGING/d;/INSTALL_WEB_SERVER/d;/INSTALL_WEB_INTERFACE/d;/LIGHTTPD_ENABLED/d;/CACHE_SIZE/d;' "${setupVars}"
+ sed -i.update.bak '/PIHOLE_INTERFACE/d;/IPV4_ADDRESS/d;/IPV6_ADDRESS/d;/PIHOLE_DNS_1\b/d;/PIHOLE_DNS_2\b/d;/QUERY_LOGGING/d;/INSTALL_WEB_SERVER/d;/INSTALL_WEB_INTERFACE/d;/LIGHTTPD_ENABLED/d;/CACHE_SIZE/d;' "${setupVars}"
fi
# echo the information to the user
{
diff --git a/autotest b/autotest
deleted file mode 100755
index 3747cc0b..00000000
--- a/autotest
+++ /dev/null
@@ -1 +0,0 @@
-py.test -v -f test/
diff --git a/test/centos_7.Dockerfile b/test/_centos_7.Dockerfile
index 00543b67..00543b67 100644
--- a/test/centos_7.Dockerfile
+++ b/test/_centos_7.Dockerfile
diff --git a/test/centos_8.Dockerfile b/test/_centos_8.Dockerfile
index 7444551b..7444551b 100644
--- a/test/centos_8.Dockerfile
+++ b/test/_centos_8.Dockerfile
diff --git a/test/debian_10.Dockerfile b/test/_debian_10.Dockerfile
index 9b72fc6a..9b72fc6a 100644
--- a/test/debian_10.Dockerfile
+++ b/test/_debian_10.Dockerfile
diff --git a/test/debian_9.Dockerfile b/test/_debian_9.Dockerfile
index d6609ba3..d6609ba3 100644
--- a/test/debian_9.Dockerfile
+++ b/test/_debian_9.Dockerfile
diff --git a/test/fedora_31.Dockerfile b/test/_fedora_31.Dockerfile
index 02dcb733..02dcb733 100644
--- a/test/fedora_31.Dockerfile
+++ b/test/_fedora_31.Dockerfile
diff --git a/test/fedora_32.Dockerfile b/test/_fedora_32.Dockerfile
index 869efb2b..869efb2b 100644
--- a/test/fedora_32.Dockerfile
+++ b/test/_fedora_32.Dockerfile
diff --git a/test/ubuntu_16.Dockerfile b/test/_ubuntu_16.Dockerfile
index d1107082..a92bc6f6 100644
--- a/test/ubuntu_16.Dockerfile
+++ b/test/_ubuntu_16.Dockerfile
@@ -13,4 +13,4 @@ RUN true && \
ENV PH_TEST true
-#sed '/# Start the installer/Q' /opt/pihole/basic-install.sh > /opt/pihole/stub_basic-install.sh && \
+#sed '/# Start the installer/Q' /opt/pihole/basic-install.sh > /opt/pihole/stub_basic-install.sh && \ \ No newline at end of file
diff --git a/test/ubuntu_18.Dockerfile b/test/_ubuntu_18.Dockerfile
index 2f63ea89..2f63ea89 100644
--- a/test/ubuntu_18.Dockerfile
+++ b/test/_ubuntu_18.Dockerfile
diff --git a/test/ubuntu_20.Dockerfile b/test/_ubuntu_20.Dockerfile
index caa6261f..caa6261f 100644
--- a/test/ubuntu_20.Dockerfile
+++ b/test/_ubuntu_20.Dockerfile
diff --git a/test/conftest.py b/test/conftest.py
index cda861c1..07166ec5 100644
--- a/test/conftest.py
+++ b/test/conftest.py
@@ -70,15 +70,7 @@ def args(request):
@pytest.fixture(params=[
- 'debian_9',
- 'debian_10',
- 'centos_7',
- 'centos_8',
- 'fedora_31',
- 'fedora_32',
- 'ubuntu_16',
- 'ubuntu_18',
- 'ubuntu_20'
+ 'test_container'
])
def tag(request):
'''
diff --git a/requirements.txt b/test/requirements.txt
index 17d62ad9..17d62ad9 100644
--- a/requirements.txt
+++ b/test/requirements.txt
diff --git a/setup.py b/test/setup.py
index 0e393bc1..0e393bc1 100644
--- a/setup.py
+++ b/test/setup.py
diff --git a/test/test_000_build_containers.py b/test/test_000_build_containers.py
deleted file mode 100644
index 3033249f..00000000
--- a/test/test_000_build_containers.py
+++ /dev/null
@@ -1,29 +0,0 @@
-''' This file starts with 000 to make it run first '''
-import pytest
-import testinfra
-
-run_local = testinfra.get_backend(
- "local://"
-).get_module("Command").run
-
-
-@pytest.mark.parametrize("image,tag", [
- ('test/debian_9.Dockerfile', 'pytest_pihole:debian_9'),
- ('test/debian_10.Dockerfile', 'pytest_pihole:debian_10'),
- ('test/centos_7.Dockerfile', 'pytest_pihole:centos_7'),
- ('test/centos_8.Dockerfile', 'pytest_pihole:centos_8'),
- ('test/fedora_31.Dockerfile', 'pytest_pihole:fedora_31'),
- ('test/fedora_32.Dockerfile', 'pytest_pihole:fedora_32'),
- ('test/ubuntu_16.Dockerfile', 'pytest_pihole:ubuntu_16'),
- ('test/ubuntu_18.Dockerfile', 'pytest_pihole:ubuntu_18'),
- ('test/ubuntu_20.Dockerfile', 'pytest_pihole:ubuntu_20'),
-])
-# mark as 'build_stage' so we can ensure images are built first when tests
-# are executed in parallel. (not required when tests are executed serially)
-@pytest.mark.build_stage
-def test_build_pihole_image(image, tag):
- build_cmd = run_local('docker build -f {} -t {} .'.format(image, tag))
- if build_cmd.rc != 0:
- print(build_cmd.stdout)
- print(build_cmd.stderr)
- assert build_cmd.rc == 0
diff --git a/test/test_centos_7_support.py b/test/test_centos_7_support.py
new file mode 100644
index 00000000..2f744ab4
--- /dev/null
+++ b/test/test_centos_7_support.py
@@ -0,0 +1,60 @@
+from .conftest import (
+ tick_box,
+ info_box,
+ mock_command,
+)
+
+
+def test_php_upgrade_default_optout_centos_eq_7(Pihole):
+ '''
+ confirms the default behavior to opt-out of installing PHP7 from REMI
+ '''
+ distro_check = Pihole.run('''
+ source /opt/pihole/basic-install.sh
+ distro_check
+ ''')
+ expected_stdout = info_box + (' User opt-out of PHP 7 upgrade on CentOS. '
+ 'Deprecated PHP may be in use.')
+ assert expected_stdout in distro_check.stdout
+ remi_package = Pihole.package('remi-release')
+ assert not remi_package.is_installed
+
+
+def test_php_upgrade_user_optout_centos_eq_7(Pihole):
+ '''
+ confirms installer behavior when user opt-out of installing PHP7 from REMI
+ (php not currently installed)
+ '''
+ # Whiptail dialog returns Cancel for user prompt
+ mock_command('whiptail', {'*': ('', '1')}, Pihole)
+ distro_check = Pihole.run('''
+ source /opt/pihole/basic-install.sh
+ distro_check
+ ''')
+ expected_stdout = info_box + (' User opt-out of PHP 7 upgrade on CentOS. '
+ 'Deprecated PHP may be in use.')
+ assert expected_stdout in distro_check.stdout
+ remi_package = Pihole.package('remi-release')
+ assert not remi_package.is_installed
+
+
+def test_php_upgrade_user_optin_centos_eq_7(Pihole):
+ '''
+ confirms installer behavior when user opt-in to installing PHP7 from REMI
+ (php not currently installed)
+ '''
+ # Whiptail dialog returns Continue for user prompt
+ mock_command('whiptail', {'*': ('', '0')}, Pihole)
+ distro_check = Pihole.run('''
+ source /opt/pihole/basic-install.sh
+ distro_check
+ ''')
+ assert 'opt-out' not in distro_check.stdout
+ expected_stdout = info_box + (' Enabling Remi\'s RPM repository '
+ '(https://rpms.remirepo.net)')
+ assert expected_stdout in distro_check.stdout
+ expected_stdout = tick_box + (' Remi\'s RPM repository has '
+ 'been enabled for PHP7')
+ assert expected_stdout in distro_check.stdout
+ remi_package = Pihole.package('remi-release')
+ assert remi_package.is_installed
diff --git a/test/test_centos_8_support.py b/test/test_centos_8_support.py
new file mode 100644
index 00000000..d3e83658
--- /dev/null
+++ b/test/test_centos_8_support.py
@@ -0,0 +1,65 @@
+from .conftest import (
+ tick_box,
+ info_box,
+ mock_command,
+)
+
+
+def test_php_upgrade_default_continue_centos_gte_8(Pihole):
+ '''
+ confirms the latest version of CentOS continues / does not optout
+ (should trigger on CentOS7 only)
+ '''
+ distro_check = Pihole.run('''
+ source /opt/pihole/basic-install.sh
+ distro_check
+ ''')
+ unexpected_stdout = info_box + (' User opt-out of PHP 7 upgrade on CentOS.'
+ ' Deprecated PHP may be in use.')
+ assert unexpected_stdout not in distro_check.stdout
+ # ensure remi was not installed on latest CentOS
+ remi_package = Pihole.package('remi-release')
+ assert not remi_package.is_installed
+
+
+def test_php_upgrade_user_optout_skipped_centos_gte_8(Pihole):
+ '''
+ confirms installer skips user opt-out of installing PHP7 from REMI on
+ latest CentOS (should trigger on CentOS7 only)
+ (php not currently installed)
+ '''
+ # Whiptail dialog returns Cancel for user prompt
+ mock_command('whiptail', {'*': ('', '1')}, Pihole)
+ distro_check = Pihole.run('''
+ source /opt/pihole/basic-install.sh
+ distro_check
+ ''')
+ unexpected_stdout = info_box + (' User opt-out of PHP 7 upgrade on CentOS.'
+ ' Deprecated PHP may be in use.')
+ assert unexpected_stdout not in distro_check.stdout
+ # ensure remi was not installed on latest CentOS
+ remi_package = Pihole.package('remi-release')
+ assert not remi_package.is_installed
+
+
+def test_php_upgrade_user_optin_skipped_centos_gte_8(Pihole):
+ '''
+ confirms installer skips user opt-in to installing PHP7 from REMI on
+ latest CentOS (should trigger on CentOS7 only)
+ (php not currently installed)
+ '''
+ # Whiptail dialog returns Continue for user prompt
+ mock_command('whiptail', {'*': ('', '0')}, Pihole)
+ distro_check = Pihole.run('''
+ source /opt/pihole/basic-install.sh
+ distro_check
+ ''')
+ assert 'opt-out' not in distro_check.stdout
+ unexpected_stdout = info_box + (' Enabling Remi\'s RPM repository '
+ '(https://rpms.remirepo.net)')
+ assert unexpected_stdout not in distro_check.stdout
+ unexpected_stdout = tick_box + (' Remi\'s RPM repository has '
+ 'been enabled for PHP7')
+ assert unexpected_stdout not in distro_check.stdout
+ remi_package = Pihole.package('remi-release')
+ assert not remi_package.is_installed
diff --git a/test/test_centos_common_support.py b/test/test_centos_common_support.py
new file mode 100644
index 00000000..fdf43cba
--- /dev/null
+++ b/test/test_centos_common_support.py
@@ -0,0 +1,120 @@
+import pytest
+from .conftest import (
+ tick_box,
+ info_box,
+ cross_box,
+ mock_command,
+)
+
+
+def test_release_supported_version_check_centos(Pihole):
+ '''
+ confirms installer exits on unsupported releases of CentOS
+ '''
+ # modify /etc/redhat-release to mock an unsupported CentOS release
+ Pihole.run('echo "CentOS Linux release 6.9" > /etc/redhat-release')
+ distro_check = Pihole.run('''
+ source /opt/pihole/basic-install.sh
+ distro_check
+ ''')
+ expected_stdout = cross_box + (' CentOS 6 is not supported.')
+ assert expected_stdout in distro_check.stdout
+ expected_stdout = 'Please update to CentOS release 7 or later'
+ assert expected_stdout in distro_check.stdout
+
+
+def test_enable_epel_repository_centos(Pihole):
+ '''
+ confirms the EPEL package repository is enabled when installed on CentOS
+ '''
+ distro_check = Pihole.run('''
+ source /opt/pihole/basic-install.sh
+ distro_check
+ ''')
+ expected_stdout = info_box + (' Enabling EPEL package repository '
+ '(https://fedoraproject.org/wiki/EPEL)')
+ assert expected_stdout in distro_check.stdout
+ expected_stdout = tick_box + ' Installed epel-release'
+ assert expected_stdout in distro_check.stdout
+ epel_package = Pihole.package('epel-release')
+ assert epel_package.is_installed
+
+
+def test_php_version_lt_7_detected_upgrade_default_optout_centos(Pihole):
+ '''
+ confirms the default behavior to opt-out of upgrading to PHP7 from REMI
+ '''
+ # first we will install the default php version to test installer behavior
+ php_install = Pihole.run('yum install -y php')
+ assert php_install.rc == 0
+ php_package = Pihole.package('php')
+ default_centos_php_version = php_package.version.split('.')[0]
+ if int(default_centos_php_version) >= 7: # PHP7 is supported/recommended
+ pytest.skip("Test deprecated . Detected default PHP version >= 7")
+ distro_check = Pihole.run('''
+ source /opt/pihole/basic-install.sh
+ distro_check
+ ''')
+ expected_stdout = info_box + (' User opt-out of PHP 7 upgrade on CentOS. '
+ 'Deprecated PHP may be in use.')
+ assert expected_stdout in distro_check.stdout
+ remi_package = Pihole.package('remi-release')
+ assert not remi_package.is_installed
+
+
+def test_php_version_lt_7_detected_upgrade_user_optout_centos(Pihole):
+ '''
+ confirms installer behavior when user opt-out to upgrade to PHP7 via REMI
+ '''
+ # first we will install the default php version to test installer behavior
+ php_install = Pihole.run('yum install -y php')
+ assert php_install.rc == 0
+ php_package = Pihole.package('php')
+ default_centos_php_version = php_package.version.split('.')[0]
+ if int(default_centos_php_version) >= 7: # PHP7 is supported/recommended
+ pytest.skip("Test deprecated . Detected default PHP version >= 7")
+ # Whiptail dialog returns Cancel for user prompt
+ mock_command('whiptail', {'*': ('', '1')}, Pihole)
+ distro_check = Pihole.run('''
+ source /opt/pihole/basic-install.sh
+ distro_check
+ ''')
+ expected_stdout = info_box + (' User opt-out of PHP 7 upgrade on CentOS. '
+ 'Deprecated PHP may be in use.')
+ assert expected_stdout in distro_check.stdout
+ remi_package = Pihole.package('remi-release')
+ assert not remi_package.is_installed
+
+
+def test_php_version_lt_7_detected_upgrade_user_optin_centos(Pihole):
+ '''
+ confirms installer behavior when user opt-in to upgrade to PHP7 via REMI
+ '''
+ # first we will install the default php version to test installer behavior
+ php_install = Pihole.run('yum install -y php')
+ assert php_install.rc == 0
+ php_package = Pihole.package('php')
+ default_centos_php_version = php_package.version.split('.')[0]
+ if int(default_centos_php_version) >= 7: # PHP7 is supported/recommended
+ pytest.skip("Test deprecated . Detected default PHP version >= 7")
+ # Whiptail dialog returns Continue for user prompt
+ mock_command('whiptail', {'*': ('', '0')}, Pihole)
+ distro_check = Pihole.run('''
+ source /opt/pihole/basic-install.sh
+ distro_check
+ install_dependent_packages PIHOLE_WEB_DEPS[@]
+ ''')
+ expected_stdout = info_box + (' User opt-out of PHP 7 upgrade on CentOS. '
+ 'Deprecated PHP may be in use.')
+ assert expected_stdout not in distro_check.stdout
+ expected_stdout = info_box + (' Enabling Remi\'s RPM repository '
+ '(https://rpms.remirepo.net)')
+ assert expected_stdout in distro_check.stdout
+ expected_stdout = tick_box + (' Remi\'s RPM repository has '
+ 'been enabled for PHP7')
+ assert expected_stdout in distro_check.stdout
+ remi_package = Pihole.package('remi-release')
+ assert remi_package.is_installed
+ updated_php_package = Pihole.package('php')
+ updated_php_version = updated_php_package.version.split('.')[0]
+ assert int(updated_php_version) == 7
diff --git a/test/test_centos_fedora_common_support.py b/test/test_centos_fedora_common_support.py
new file mode 100644
index 00000000..21ae6d1d
--- /dev/null
+++ b/test/test_centos_fedora_common_support.py
@@ -0,0 +1,65 @@
+from .conftest import (
+ tick_box,
+ cross_box,
+ mock_command,
+)
+
+
+def mock_selinux_config(state, Pihole):
+ '''
+ Creates a mock SELinux config file with expected content
+ '''
+ # validate state string
+ valid_states = ['enforcing', 'permissive', 'disabled']
+ assert state in valid_states
+ # getenforce returns the running state of SELinux
+ mock_command('getenforce', {'*': (state.capitalize(), '0')}, Pihole)
+ # create mock configuration with desired content
+ Pihole.run('''
+ mkdir /etc/selinux
+ echo "SELINUX={state}" > /etc/selinux/config
+ '''.format(state=state.lower()))
+
+
+def test_selinux_enforcing_exit(Pihole):
+ '''
+ confirms installer prompts to exit when SELinux is Enforcing by default
+ '''
+ mock_selinux_config("enforcing", Pihole)
+ check_selinux = Pihole.run('''
+ source /opt/pihole/basic-install.sh
+ checkSelinux
+ ''')
+ expected_stdout = cross_box + ' Current SELinux: Enforcing'
+ assert expected_stdout in check_selinux.stdout
+ expected_stdout = 'SELinux Enforcing detected, exiting installer'
+ assert expected_stdout in check_selinux.stdout
+ assert check_selinux.rc == 1
+
+
+def test_selinux_permissive(Pihole):
+ '''
+ confirms installer continues when SELinux is Permissive
+ '''
+ mock_selinux_config("permissive", Pihole)
+ check_selinux = Pihole.run('''
+ source /opt/pihole/basic-install.sh
+ checkSelinux
+ ''')
+ expected_stdout = tick_box + ' Current SELinux: Permissive'
+ assert expected_stdout in check_selinux.stdout
+ assert check_selinux.rc == 0
+
+
+def test_selinux_disabled(Pihole):
+ '''
+ confirms installer continues when SELinux is Disabled
+ '''
+ mock_selinux_config("disabled", Pihole)
+ check_selinux = Pihole.run('''
+ source /opt/pihole/basic-install.sh
+ checkSelinux
+ ''')
+ expected_stdout = tick_box + ' Current SELinux: Disabled'
+ assert expected_stdout in check_selinux.stdout
+ assert check_selinux.rc == 0
diff --git a/test/test_centos_fedora_support.py b/test/test_centos_fedora_support.py
deleted file mode 100644
index 8dd0ee5f..00000000
--- a/test/test_centos_fedora_support.py
+++ /dev/null
@@ -1,327 +0,0 @@
-import pytest
-from .conftest import (
- tick_box,
- info_box,
- cross_box,
- mock_command,
-)
-
-
-def mock_selinux_config(state, Pihole):
- '''
- Creates a mock SELinux config file with expected content
- '''
- # validate state string
- valid_states = ['enforcing', 'permissive', 'disabled']
- assert state in valid_states
- # getenforce returns the running state of SELinux
- mock_command('getenforce', {'*': (state.capitalize(), '0')}, Pihole)
- # create mock configuration with desired content
- Pihole.run('''
- mkdir /etc/selinux
- echo "SELINUX={state}" > /etc/selinux/config
- '''.format(state=state.lower()))
-
-
-@pytest.mark.parametrize("tag", [('centos_7'), ('centos_8'), ('fedora_31'), ('fedora_32'), ])
-def test_selinux_enforcing_exit(Pihole):
- '''
- confirms installer prompts to exit when SELinux is Enforcing by default
- '''
- mock_selinux_config("enforcing", Pihole)
- check_selinux = Pihole.run('''
- source /opt/pihole/basic-install.sh
- checkSelinux
- ''')
- expected_stdout = cross_box + ' Current SELinux: Enforcing'
- assert expected_stdout in check_selinux.stdout
- expected_stdout = 'SELinux Enforcing detected, exiting installer'
- assert expected_stdout in check_selinux.stdout
- assert check_selinux.rc == 1
-
-
-@pytest.mark.parametrize("tag", [('centos_7'), ('centos_8'), ('fedora_31'), ('fedora_32'), ])
-def test_selinux_permissive(Pihole):
- '''
- confirms installer continues when SELinux is Permissive
- '''
- mock_selinux_config("permissive", Pihole)
- check_selinux = Pihole.run('''
- source /opt/pihole/basic-install.sh
- checkSelinux
- ''')
- expected_stdout = tick_box + ' Current SELinux: Permissive'
- assert expected_stdout in check_selinux.stdout
- assert check_selinux.rc == 0
-
-
-@pytest.mark.parametrize("tag", [('centos_7'), ('centos_8'), ('fedora_31'), ('fedora_32'), ])
-def test_selinux_disabled(Pihole):
- '''
- confirms installer continues when SELinux is Disabled
- '''
- mock_selinux_config("disabled", Pihole)
- check_selinux = Pihole.run('''
- source /opt/pihole/basic-install.sh
- checkSelinux
- ''')
- expected_stdout = tick_box + ' Current SELinux: Disabled'
- assert expected_stdout in check_selinux.stdout
- assert check_selinux.rc == 0
-
-
-@pytest.mark.parametrize("tag", [('fedora_31'), ('fedora_32'), ])
-def test_epel_and_remi_not_installed_fedora(Pihole):
- '''
- confirms installer does not attempt to install EPEL/REMI repositories
- on Fedora
- '''
- distro_check = Pihole.run('''
- source /opt/pihole/basic-install.sh
- distro_check
- ''')
- assert distro_check.stdout == ''
-
- epel_package = Pihole.package('epel-release')
- assert not epel_package.is_installed
- remi_package = Pihole.package('remi-release')
- assert not remi_package.is_installed
-
-
-@pytest.mark.parametrize("tag", [('centos_7'), ('centos_8'), ])
-def test_release_supported_version_check_centos(Pihole):
- '''
- confirms installer exits on unsupported releases of CentOS
- '''
- # modify /etc/redhat-release to mock an unsupported CentOS release
- Pihole.run('echo "CentOS Linux release 6.9" > /etc/redhat-release')
- distro_check = Pihole.run('''
- source /opt/pihole/basic-install.sh
- distro_check
- ''')
- expected_stdout = cross_box + (' CentOS 6 is not supported.')
- assert expected_stdout in distro_check.stdout
- expected_stdout = 'Please update to CentOS release 7 or later'
- assert expected_stdout in distro_check.stdout
-
-
-@pytest.mark.parametrize("tag", [('centos_7'), ('centos_8'), ])
-def test_enable_epel_repository_centos(Pihole):
- '''
- confirms the EPEL package repository is enabled when installed on CentOS
- '''
- distro_check = Pihole.run('''
- source /opt/pihole/basic-install.sh
- distro_check
- ''')
- expected_stdout = info_box + (' Enabling EPEL package repository '
- '(https://fedoraproject.org/wiki/EPEL)')
- assert expected_stdout in distro_check.stdout
- expected_stdout = tick_box + ' Installed epel-release'
- assert expected_stdout in distro_check.stdout
- epel_package = Pihole.package('epel-release')
- assert epel_package.is_installed
-
-
-@pytest.mark.parametrize("tag", [('centos_7'), ])
-def test_php_upgrade_default_optout_centos_eq_7(Pihole):
- '''
- confirms the default behavior to opt-out of installing PHP7 from REMI
- '''
- distro_check = Pihole.run('''
- source /opt/pihole/basic-install.sh
- distro_check
- ''')
- expected_stdout = info_box + (' User opt-out of PHP 7 upgrade on CentOS. '
- 'Deprecated PHP may be in use.')
- assert expected_stdout in distro_check.stdout
- remi_package = Pihole.package('remi-release')
- assert not remi_package.is_installed
-
-
-@pytest.mark.parametrize("tag", [('centos_8'), ])
-def test_php_upgrade_default_continue_centos_gte_8(Pihole):
- '''
- confirms the latest version of CentOS continues / does not optout
- (should trigger on CentOS7 only)
- '''
- distro_check = Pihole.run('''
- source /opt/pihole/basic-install.sh
- distro_check
- ''')
- unexpected_stdout = info_box + (' User opt-out of PHP 7 upgrade on CentOS.'
- ' Deprecated PHP may be in use.')
- assert unexpected_stdout not in distro_check.stdout
- # ensure remi was not installed on latest CentOS
- remi_package = Pihole.package('remi-release')
- assert not remi_package.is_installed
-
-
-@pytest.mark.parametrize("tag", [('centos_7'), ])
-def test_php_upgrade_user_optout_centos_eq_7(Pihole):
- '''
- confirms installer behavior when user opt-out of installing PHP7 from REMI
- (php not currently installed)
- '''
- # Whiptail dialog returns Cancel for user prompt
- mock_command('whiptail', {'*': ('', '1')}, Pihole)
- distro_check = Pihole.run('''
- source /opt/pihole/basic-install.sh
- distro_check
- ''')
- expected_stdout = info_box + (' User opt-out of PHP 7 upgrade on CentOS. '
- 'Deprecated PHP may be in use.')
- assert expected_stdout in distro_check.stdout
- remi_package = Pihole.package('remi-release')
- assert not remi_package.is_installed
-
-
-@pytest.mark.parametrize("tag", [('centos_8'), ])
-def test_php_upgrade_user_optout_skipped_centos_gte_8(Pihole):
- '''
- confirms installer skips user opt-out of installing PHP7 from REMI on
- latest CentOS (should trigger on CentOS7 only)
- (php not currently installed)
- '''
- # Whiptail dialog returns Cancel for user prompt
- mock_command('whiptail', {'*': ('', '1')}, Pihole)
- distro_check = Pihole.run('''
- source /opt/pihole/basic-install.sh
- distro_check
- ''')
- unexpected_stdout = info_box + (' User opt-out of PHP 7 upgrade on CentOS.'
- ' Deprecated PHP may be in use.')
- assert unexpected_stdout not in distro_check.stdout
- # ensure remi was not installed on latest CentOS
- remi_package = Pihole.package('remi-release')
- assert not remi_package.is_installed
-
-
-@pytest.mark.parametrize("tag", [('centos_7'), ])
-def test_php_upgrade_user_optin_centos_eq_7(Pihole):
- '''
- confirms installer behavior when user opt-in to installing PHP7 from REMI
- (php not currently installed)
- '''
- # Whiptail dialog returns Continue for user prompt
- mock_command('whiptail', {'*': ('', '0')}, Pihole)
- distro_check = Pihole.run('''
- source /opt/pihole/basic-install.sh
- distro_check
- ''')
- assert 'opt-out' not in distro_check.stdout
- expected_stdout = info_box + (' Enabling Remi\'s RPM repository '
- '(https://rpms.remirepo.net)')
- assert expected_stdout in distro_check.stdout
- expected_stdout = tick_box + (' Remi\'s RPM repository has '
- 'been enabled for PHP7')
- assert expected_stdout in distro_check.stdout
- remi_package = Pihole.package('remi-release')
- assert remi_package.is_installed
-
-
-@pytest.mark.parametrize("tag", [('centos_8'), ])
-def test_php_upgrade_user_optin_skipped_centos_gte_8(Pihole):
- '''
- confirms installer skips user opt-in to installing PHP7 from REMI on
- latest CentOS (should trigger on CentOS7 only)
- (php not currently installed)
- '''
- # Whiptail dialog returns Continue for user prompt
- mock_command('whiptail', {'*': ('', '0')}, Pihole)
- distro_check = Pihole.run('''
- source /opt/pihole/basic-install.sh
- distro_check
- ''')
- assert 'opt-out' not in distro_check.stdout
- unexpected_stdout = info_box + (' Enabling Remi\'s RPM repository '
- '(https://rpms.remirepo.net)')
- assert unexpected_stdout not in distro_check.stdout
- unexpected_stdout = tick_box + (' Remi\'s RPM repository has '
- 'been enabled for PHP7')
- assert unexpected_stdout not in distro_check.stdout
- remi_package = Pihole.package('remi-release')
- assert not remi_package.is_installed
-
-
-@pytest.mark.parametrize("tag", [('centos_7'), ('centos_8'), ])
-def test_php_version_lt_7_detected_upgrade_default_optout_centos(Pihole):
- '''
- confirms the default behavior to opt-out of upgrading to PHP7 from REMI
- '''
- # first we will install the default php version to test installer behavior
- php_install = Pihole.run('yum install -y php')
- assert php_install.rc == 0
- php_package = Pihole.package('php')
- default_centos_php_version = php_package.version.split('.')[0]
- if int(default_centos_php_version) >= 7: # PHP7 is supported/recommended
- pytest.skip("Test deprecated . Detected default PHP version >= 7")
- distro_check = Pihole.run('''
- source /opt/pihole/basic-install.sh
- distro_check
- ''')
- expected_stdout = info_box + (' User opt-out of PHP 7 upgrade on CentOS. '
- 'Deprecated PHP may be in use.')
- assert expected_stdout in distro_check.stdout
- remi_package = Pihole.package('remi-release')
- assert not remi_package.is_installed
-
-
-@pytest.mark.parametrize("tag", [('centos_7'), ('centos_8'), ])
-def test_php_version_lt_7_detected_upgrade_user_optout_centos(Pihole):
- '''
- confirms installer behavior when user opt-out to upgrade to PHP7 via REMI
- '''
- # first we will install the default php version to test installer behavior
- php_install = Pihole.run('yum install -y php')
- assert php_install.rc == 0
- php_package = Pihole.package('php')
- default_centos_php_version = php_package.version.split('.')[0]
- if int(default_centos_php_version) >= 7: # PHP7 is supported/recommended
- pytest.skip("Test deprecated . Detected default PHP version >= 7")
- # Whiptail dialog returns Cancel for user prompt
- mock_command('whiptail', {'*': ('', '1')}, Pihole)
- distro_check = Pihole.run('''
- source /opt/pihole/basic-install.sh
- distro_check
- ''')
- expected_stdout = info_box + (' User opt-out of PHP 7 upgrade on CentOS. '
- 'Deprecated PHP may be in use.')
- assert expected_stdout in distro_check.stdout
- remi_package = Pihole.package('remi-release')
- assert not remi_package.is_installed
-
-
-@pytest.mark.parametrize("tag", [('centos_7'), ('centos_8'), ])
-def test_php_version_lt_7_detected_upgrade_user_optin_centos(Pihole):
- '''
- confirms installer behavior when user opt-in to upgrade to PHP7 via REMI
- '''
- # first we will install the default php version to test installer behavior
- php_install = Pihole.run('yum install -y php')
- assert php_install.rc == 0
- php_package = Pihole.package('php')
- default_centos_php_version = php_package.version.split('.')[0]
- if int(default_centos_php_version) >= 7: # PHP7 is supported/recommended
- pytest.skip("Test deprecated . Detected default PHP version >= 7")
- # Whiptail dialog returns Continue for user prompt
- mock_command('whiptail', {'*': ('', '0')}, Pihole)
- distro_check = Pihole.run('''
- source /opt/pihole/basic-install.sh
- distro_check
- install_dependent_packages PIHOLE_WEB_DEPS[@]
- ''')
- expected_stdout = info_box + (' User opt-out of PHP 7 upgrade on CentOS. '
- 'Deprecated PHP may be in use.')
- assert expected_stdout not in distro_check.stdout
- expected_stdout = info_box + (' Enabling Remi\'s RPM repository '
- '(https://rpms.remirepo.net)')
- assert expected_stdout in distro_check.stdout
- expected_stdout = tick_box + (' Remi\'s RPM repository has '
- 'been enabled for PHP7')
- assert expected_stdout in distro_check.stdout
- remi_package = Pihole.package('remi-release')
- assert remi_package.is_installed
- updated_php_package = Pihole.package('php')
- updated_php_version = updated_php_package.version.split('.')[0]
- assert int(updated_php_version) == 7
diff --git a/test/test_fedora_support.py b/test/test_fedora_support.py
new file mode 100644
index 00000000..473b2e96
--- /dev/null
+++ b/test/test_fedora_support.py
@@ -0,0 +1,15 @@
+def test_epel_and_remi_not_installed_fedora(Pihole):
+ '''
+ confirms installer does not attempt to install EPEL/REMI repositories
+ on Fedora
+ '''
+ distro_check = Pihole.run('''
+ source /opt/pihole/basic-install.sh
+ distro_check
+ ''')
+ assert distro_check.stdout == ''
+
+ epel_package = Pihole.package('epel-release')
+ assert not epel_package.is_installed
+ remi_package = Pihole.package('remi-release')
+ assert not remi_package.is_installed
diff --git a/test/test_shellcheck.py b/test/test_shellcheck.py
deleted file mode 100644
index 919ad2b9..00000000
--- a/test/test_shellcheck.py
+++ /dev/null
@@ -1,18 +0,0 @@
-import testinfra
-
-run_local = testinfra.get_backend(
- "local://"
-).get_module("Command").run
-
-
-def test_scripts_pass_shellcheck():
- '''
- Make sure shellcheck does not find anything wrong with our shell scripts
- '''
- shellcheck = ("find . -type f -name 'update.sh' "
- "| while read file; do "
- "shellcheck -x \"$file\" -e SC1090,SC1091; "
- "done;")
- results = run_local(shellcheck)
- print(results.stdout)
- assert '' == results.stdout
diff --git a/test/tox.centos_7.ini b/test/tox.centos_7.ini
new file mode 100644
index 00000000..c2752698
--- /dev/null
+++ b/test/tox.centos_7.ini
@@ -0,0 +1,8 @@
+[tox]
+envlist = py37
+
+[testenv]
+whitelist_externals = docker
+deps = -rrequirements.txt
+commands = docker build -f _centos_7.Dockerfile -t pytest_pihole:test_container ../
+ pytest {posargs:-vv -n auto} ./test_automated_install.py ./test_centos_fedora_common_support.py ./test_centos_common_support.py ./test_centos_7_support.py
diff --git a/test/tox.centos_8.ini b/test/tox.centos_8.ini
new file mode 100644
index 00000000..c8852bae
--- /dev/null
+++ b/test/tox.centos_8.ini
@@ -0,0 +1,8 @@
+[tox]
+envlist = py37
+
+[testenv]
+whitelist_externals = docker
+deps = -rrequirements.txt
+commands = docker build -f _centos_8.Dockerfile -t pytest_pihole:test_container ../
+ pytest {posargs:-vv -n auto} ./test_automated_install.py ./test_centos_fedora_common_support.py ./test_centos_common_support.py ./test_centos_8_support.py
diff --git a/test/tox.debian_10.ini b/test/tox.debian_10.ini
new file mode 100644
index 00000000..e8c5d746
--- /dev/null
+++ b/test/tox.debian_10.ini
@@ -0,0 +1,8 @@
+[tox]
+envlist = py37
+
+[testenv]
+whitelist_externals = docker
+deps = -rrequirements.txt
+commands = docker build -f _debian_10.Dockerfile -t pytest_pihole:test_container ../
+ pytest {posargs:-vv -n auto} ./test_automated_install.py
diff --git a/test/tox.debian_9.ini b/test/tox.debian_9.ini
new file mode 100644
index 00000000..b33e9927
--- /dev/null
+++ b/test/tox.debian_9.ini
@@ -0,0 +1,8 @@
+[tox]
+envlist = py37
+
+[testenv]
+whitelist_externals = docker
+deps = -rrequirements.txt
+commands = docker build -f _debian_9.Dockerfile -t pytest_pihole:test_container ../
+ pytest {posargs:-vv -n auto} ./test_automated_install.py
diff --git a/test/tox.fedora_31.ini b/test/tox.fedora_31.ini
new file mode 100644
index 00000000..36ab10ad
--- /dev/null
+++ b/test/tox.fedora_31.ini
@@ -0,0 +1,8 @@
+[tox]
+envlist = py37
+
+[testenv]
+whitelist_externals = docker
+deps = -rrequirements.txt
+commands = docker build -f _fedora_31.Dockerfile -t pytest_pihole:test_container ../
+ pytest {posargs:-vv -n auto} ./test_automated_install.py ./test_centos_fedora_common_support.py ./test_fedora_support.py
diff --git a/test/tox.fedora_32.ini b/test/tox.fedora_32.ini
new file mode 100644
index 00000000..c68e0757
--- /dev/null
+++ b/test/tox.fedora_32.ini
@@ -0,0 +1,8 @@
+[tox]
+envlist = py37
+
+[testenv]
+whitelist_externals = docker
+deps = -rrequirements.txt
+commands = docker build -f _fedora_32.Dockerfile -t pytest_pihole:test_container ../
+ pytest {posargs:-vv -n auto} ./test_automated_install.py ./test_centos_fedora_common_support.py ./test_fedora_support.py
diff --git a/test/tox.ubuntu_16.ini b/test/tox.ubuntu_16.ini
new file mode 100644
index 00000000..6f484b6b
--- /dev/null
+++ b/test/tox.ubuntu_16.ini
@@ -0,0 +1,8 @@
+[tox]
+envlist = py37
+
+[testenv]
+whitelist_externals = docker
+deps = -rrequirements.txt
+commands = docker build -f _ubuntu_16.Dockerfile -t pytest_pihole:test_container ../
+ pytest {posargs:-vv -n auto} ./test_automated_install.py
diff --git a/test/tox.ubuntu_18.ini b/test/tox.ubuntu_18.ini
new file mode 100644
index 00000000..10d4ac09
--- /dev/null
+++ b/test/tox.ubuntu_18.ini
@@ -0,0 +1,8 @@
+[tox]
+envlist = py37
+
+[testenv]
+whitelist_externals = docker
+deps = -rrequirements.txt
+commands = docker build -f _ubuntu_18.Dockerfile -t pytest_pihole:test_container ../
+ pytest {posargs:-vv -n auto} ./test_automated_install.py
diff --git a/test/tox.ubuntu_20.ini b/test/tox.ubuntu_20.ini
new file mode 100644
index 00000000..8b405b28
--- /dev/null
+++ b/test/tox.ubuntu_20.ini
@@ -0,0 +1,8 @@
+[tox]
+envlist = py37
+
+[testenv]
+whitelist_externals = docker
+deps = -rrequirements.txt
+commands = docker build -f _ubuntu_20.Dockerfile -t pytest_pihole:test_container ../
+ pytest {posargs:-vv -n auto} ./test_automated_install.py
diff --git a/tox.ini b/tox.ini
deleted file mode 100644
index 1142aea8..00000000
--- a/tox.ini
+++ /dev/null
@@ -1,16 +0,0 @@
-[tox]
-envlist = py37
-
-[testenv]
-whitelist_externals = docker
-deps = -rrequirements.txt
-commands = docker build -f test/debian_9.Dockerfile -t pytest_pihole:debian_9 .
- docker build -f test/debian_10.Dockerfile -t pytest_pihole:debian_10 .
- docker build -f test/centos_7.Dockerfile -t pytest_pihole:centos_7 .
- docker build -f test/centos_8.Dockerfile -t pytest_pihole:centos_8 .
- docker build -f test/fedora_31.Dockerfile -t pytest_pihole:fedora_31 .
- docker build -f test/fedora_32.Dockerfile -t pytest_pihole:fedora_32 .
- docker build -f test/ubuntu_16.Dockerfile -t pytest_pihole:ubuntu_16 .
- docker build -f test/ubuntu_18.Dockerfile -t pytest_pihole:ubuntu_18 .
- docker build -f test/ubuntu_20.Dockerfile -t pytest_pihole:ubuntu_20 .
- pytest {posargs:-vv -n auto} -m "not build_stage" ./test/