From 3128d14d1f7eaaf0241d0e1d5e56d0492e54a996 Mon Sep 17 00:00:00 2001
From: pvogt09 <50047961+pvogt09@users.noreply.github.com>
Date: Tue, 27 Oct 2020 11:48:42 +0100
Subject: [PATCH] update images to versions supported by pi-hole 5

Signed-off-by: pvogt09 <50047961+pvogt09@users.noreply.github.com>
---
 test/conftest.py                                 |  2 +-
 ...fedora_28.Dockerfile => fedora_31.Dockerfile} |  2 +-
 ...fedora_29.Dockerfile => fedora_32.Dockerfile} |  2 +-
 test/test_000_build_containers.py                |  5 +++--
 test/ubuntu_20.Dockerfile                        | 16 ++++++++++++++++
 tox.ini                                          |  5 +++--
 6 files changed, 25 insertions(+), 7 deletions(-)
 rename test/{fedora_28.Dockerfile => fedora_31.Dockerfile} (96%)
 rename test/{fedora_29.Dockerfile => fedora_32.Dockerfile} (96%)
 create mode 100644 test/ubuntu_20.Dockerfile

diff --git a/test/conftest.py b/test/conftest.py
index 2be67ee4..ade1c674 100644
--- a/test/conftest.py
+++ b/test/conftest.py
@@ -69,7 +69,7 @@ def args(request):
     return '-t -d'
 
 
-@pytest.fixture(params=['debian', 'debian_9', 'debian_10', 'centos7', 'centos', 'fedora', 'ubuntu_16', 'ubuntu_18'])
+@pytest.fixture(params=['debian', 'debian_9', 'debian_10', 'centos7', 'centos', 'fedora', 'fedora_31', 'fedora_32', 'ubuntu_16', 'ubuntu_18', 'ubuntu_20'])
 def tag(request):
     '''
     consumed by image to make the test matrix
diff --git a/test/fedora_28.Dockerfile b/test/fedora_31.Dockerfile
similarity index 96%
rename from test/fedora_28.Dockerfile
rename to test/fedora_31.Dockerfile
index 76b40318..02dcb733 100644
--- a/test/fedora_28.Dockerfile
+++ b/test/fedora_31.Dockerfile
@@ -1,4 +1,4 @@
-FROM fedora:28
+FROM fedora:31
 
 ENV GITDIR /etc/.pihole
 ENV SCRIPTDIR /opt/pihole
diff --git a/test/fedora_29.Dockerfile b/test/fedora_32.Dockerfile
similarity index 96%
rename from test/fedora_29.Dockerfile
rename to test/fedora_32.Dockerfile
index 8c27bbcc..869efb2b 100644
--- a/test/fedora_29.Dockerfile
+++ b/test/fedora_32.Dockerfile
@@ -1,4 +1,4 @@
-FROM fedora:29
+FROM fedora:32
 
 ENV GITDIR /etc/.pihole
 ENV SCRIPTDIR /opt/pihole
diff --git a/test/test_000_build_containers.py b/test/test_000_build_containers.py
index e2044b67..dfaba1ac 100644
--- a/test/test_000_build_containers.py
+++ b/test/test_000_build_containers.py
@@ -14,10 +14,11 @@ run_local = testinfra.get_backend(
     ('test/centos7.Dockerfile', 'pytest_pihole:centos7'),
     ('test/centos.Dockerfile', 'pytest_pihole:centos'),
     ('test/fedora.Dockerfile', 'pytest_pihole:fedora'),
-    ('test/fedora_28.Dockerfile', 'pytest_pihole:fedora_28'),
-    ('test/fedora_29.Dockerfile', 'pytest_pihole:fedora_29'),
+    ('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)
diff --git a/test/ubuntu_20.Dockerfile b/test/ubuntu_20.Dockerfile
new file mode 100644
index 00000000..c071fcd9
--- /dev/null
+++ b/test/ubuntu_20.Dockerfile
@@ -0,0 +1,16 @@
+FROM buildpack-deps:focal-scm
+
+ENV GITDIR /etc/.pihole
+ENV SCRIPTDIR /opt/pihole
+
+RUN mkdir -p $GITDIR $SCRIPTDIR /etc/pihole
+ADD . $GITDIR
+RUN cp $GITDIR/advanced/Scripts/*.sh $GITDIR/gravity.sh $GITDIR/pihole $GITDIR/automated\ install/*.sh $SCRIPTDIR/
+ENV PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$SCRIPTDIR
+
+RUN true && \
+    chmod +x $SCRIPTDIR/*
+
+ENV PH_TEST true
+
+#sed '/# Start the installer/Q' /opt/pihole/basic-install.sh > /opt/pihole/stub_basic-install.sh && \
diff --git a/tox.ini b/tox.ini
index f17877b8..17d19052 100644
--- a/tox.ini
+++ b/tox.ini
@@ -10,8 +10,9 @@ commands = docker build -f test/debian.Dockerfile -t pytest_pihole:debian .
            docker build -f test/centos7.Dockerfile -t pytest_pihole:centos7 .
            docker build -f test/centos.Dockerfile -t pytest_pihole:centos .
            docker build -f test/fedora.Dockerfile -t pytest_pihole:fedora .
-           docker build -f test/fedora_28.Dockerfile -t pytest_pihole:fedora_28 .
-           docker build -f test/fedora_29.Dockerfile -t pytest_pihole:fedora_29 .
+           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/