From 22b6dc7dae8742de00244d22df72c0f99c281e01 Mon Sep 17 00:00:00 2001 From: Adam Warner Date: Sun, 29 Dec 2024 12:22:35 +0000 Subject: [PATCH 1/4] Add test scripts for fed 41 for v5 Signed-off-by: Adam Warner --- .github/workflows/test.yml | 1 + test/_fedora_41.Dockerfile | 18 ++++++++++++++++++ test/tox.fedora_41.ini | 8 ++++++++ 3 files changed, 27 insertions(+) create mode 100644 test/_fedora_41.Dockerfile create mode 100644 test/tox.fedora_41.ini diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ec2b5728..a3d49fc5 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -59,6 +59,7 @@ jobs: centos_9, fedora_39, fedora_40, + fedora_41, ] env: DISTRO: ${{matrix.distro}} diff --git a/test/_fedora_41.Dockerfile b/test/_fedora_41.Dockerfile new file mode 100644 index 00000000..5297e2a8 --- /dev/null +++ b/test/_fedora_41.Dockerfile @@ -0,0 +1,18 @@ +FROM fedora:41 +RUN dnf install -y git initscripts + +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 SKIP_INSTALL true +ENV OS_CHECK_DOMAIN_NAME dev-supportedos.pi-hole.net + +#sed '/# Start the installer/Q' /opt/pihole/basic-install.sh > /opt/pihole/stub_basic-install.sh && \ diff --git a/test/tox.fedora_41.ini b/test/tox.fedora_41.ini new file mode 100644 index 00000000..2b95a670 --- /dev/null +++ b/test/tox.fedora_41.ini @@ -0,0 +1,8 @@ +[tox] +envlist = py3 + +[testenv] +allowlist_externals = docker +deps = -rrequirements.txt +commands = docker buildx build --load --progress plain -f _fedora_41.Dockerfile -t pytest_pihole:test_container ../ + pytest {posargs:-vv -n auto} ./test_any_automated_install.py ./test_any_utils.py ./test_centos_fedora_common_support.py ./test_fedora_support.py From d972ffa53afd9d0603b33d76aa165fd8d6963678 Mon Sep 17 00:00:00 2001 From: Adam Warner Date: Sun, 29 Dec 2024 12:35:32 +0000 Subject: [PATCH 2/4] while v6 is still not released, update tests in master to NOT use development branch of FTL Signed-off-by: Adam Warner --- test/test_any_automated_install.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/test_any_automated_install.py b/test/test_any_automated_install.py index c1b91664..a5038d3c 100644 --- a/test/test_any_automated_install.py +++ b/test/test_any_automated_install.py @@ -179,7 +179,7 @@ def test_installPihole_fresh_install_readableFiles(host): # Install FTL's development branch to get the latest features host.run( """ - echo "development" > /etc/pihole/ftlbranch + echo "master" > /etc/pihole/ftlbranch """ ) install = host.run( @@ -440,7 +440,7 @@ def test_installPihole_fresh_install_readableBlockpage(host, test_webpage): # Install FTL's development branch to get the latest features host.run( """ - echo "development" > /etc/pihole/ftlbranch + echo "master" > /etc/pihole/ftlbranch """ ) installWeb = host.run( @@ -893,7 +893,7 @@ def test_FTL_binary_installed_and_responsive_no_errors(host): source /opt/pihole/basic-install.sh create_pihole_user funcOutput=$(get_binary_name) - echo "development" > /etc/pihole/ftlbranch + echo "master" > /etc/pihole/ftlbranch binary="pihole-FTL${funcOutput##*pihole-FTL}" theRest="${funcOutput%pihole-FTL*}" FTLdetect "${binary}" "${theRest}" From dff0c0105d8228fa6ce1c7648d76f853659f7a0d Mon Sep 17 00:00:00 2001 From: Adam Warner Date: Sun, 29 Dec 2024 12:43:08 +0000 Subject: [PATCH 3/4] remove EOL OS from test suite Signed-off-by: Adam Warner --- .github/workflows/test.yml | 3 --- test/_debian_10.Dockerfile | 17 ----------------- test/_fedora_39.Dockerfile | 18 ------------------ test/_ubuntu_23.Dockerfile | 18 ------------------ test/tox.debian_10.ini | 8 -------- test/tox.fedora_39.ini | 8 -------- test/tox.ubuntu_23.ini | 8 -------- 7 files changed, 80 deletions(-) delete mode 100644 test/_debian_10.Dockerfile delete mode 100644 test/_fedora_39.Dockerfile delete mode 100644 test/_ubuntu_23.Dockerfile delete mode 100644 test/tox.debian_10.ini delete mode 100644 test/tox.fedora_39.ini delete mode 100644 test/tox.ubuntu_23.ini diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a3d49fc5..19a89f1b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -49,15 +49,12 @@ jobs: matrix: distro: [ - debian_10, debian_11, debian_12, ubuntu_20, ubuntu_22, - ubuntu_23, ubuntu_24, centos_9, - fedora_39, fedora_40, fedora_41, ] diff --git a/test/_debian_10.Dockerfile b/test/_debian_10.Dockerfile deleted file mode 100644 index 3b177cc8..00000000 --- a/test/_debian_10.Dockerfile +++ /dev/null @@ -1,17 +0,0 @@ -FROM buildpack-deps:buster-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 SKIP_INSTALL true -ENV OS_CHECK_DOMAIN_NAME dev-supportedos.pi-hole.net - -#sed '/# Start the installer/Q' /opt/pihole/basic-install.sh > /opt/pihole/stub_basic-install.sh && \ diff --git a/test/_fedora_39.Dockerfile b/test/_fedora_39.Dockerfile deleted file mode 100644 index 1727a3aa..00000000 --- a/test/_fedora_39.Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -FROM fedora:39 -RUN dnf install -y git initscripts - -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 SKIP_INSTALL true -ENV OS_CHECK_DOMAIN_NAME dev-supportedos.pi-hole.net - -#sed '/# Start the installer/Q' /opt/pihole/basic-install.sh > /opt/pihole/stub_basic-install.sh && \ diff --git a/test/_ubuntu_23.Dockerfile b/test/_ubuntu_23.Dockerfile deleted file mode 100644 index f9b3910b..00000000 --- a/test/_ubuntu_23.Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -FROM buildpack-deps:lunar-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 -ENV DEBIAN_FRONTEND=noninteractive - -RUN true && \ - chmod +x $SCRIPTDIR/* - -ENV SKIP_INSTALL true -ENV OS_CHECK_DOMAIN_NAME dev-supportedos.pi-hole.net - -#sed '/# Start the installer/Q' /opt/pihole/basic-install.sh > /opt/pihole/stub_basic-install.sh && \ diff --git a/test/tox.debian_10.ini b/test/tox.debian_10.ini deleted file mode 100644 index f107300f..00000000 --- a/test/tox.debian_10.ini +++ /dev/null @@ -1,8 +0,0 @@ -[tox] -envlist = py3 - -[testenv:py3] -allowlist_externals = docker -deps = -rrequirements.txt -commands = docker buildx build --load --progress plain -f _debian_10.Dockerfile -t pytest_pihole:test_container ../ - pytest {posargs:-vv -n auto} ./test_any_automated_install.py ./test_any_utils.py diff --git a/test/tox.fedora_39.ini b/test/tox.fedora_39.ini deleted file mode 100644 index 7a538371..00000000 --- a/test/tox.fedora_39.ini +++ /dev/null @@ -1,8 +0,0 @@ -[tox] -envlist = py3 - -[testenv] -allowlist_externals = docker -deps = -rrequirements.txt -commands = docker buildx build --load --progress plain -f _fedora_39.Dockerfile -t pytest_pihole:test_container ../ - pytest {posargs:-vv -n auto} ./test_any_automated_install.py ./test_any_utils.py ./test_centos_fedora_common_support.py ./test_fedora_support.py diff --git a/test/tox.ubuntu_23.ini b/test/tox.ubuntu_23.ini deleted file mode 100644 index 767ed9ef..00000000 --- a/test/tox.ubuntu_23.ini +++ /dev/null @@ -1,8 +0,0 @@ -[tox] -envlist = py3 - -[testenv:py3] -allowlist_externals = docker -deps = -rrequirements.txt -commands = docker buildx build --load --progress plain -f _ubuntu_23.Dockerfile -t pytest_pihole:test_container ../ - pytest {posargs:-vv -n auto} ./test_any_automated_install.py ./test_any_utils.py From a1ccee6694a9648347098d66e19572b0fc0a9cc7 Mon Sep 17 00:00:00 2001 From: Adam Warner Date: Sun, 29 Dec 2024 13:32:07 +0000 Subject: [PATCH 4/4] use rpm -q to check if packages are already installed, this is due to a change in the behaviour of dnf in Fedora 41 Signed-off-by: Adam Warner --- automated install/basic-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index daa35a70..6c84369e 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -1698,7 +1698,7 @@ install_dependent_packages() { for i in "$@"; do # For each package, check if it's already installed (and if so, don't add it to the installArray) printf " %b Checking for %s..." "${INFO}" "${i}" - if "${PKG_MANAGER}" -q list installed "${i}" &> /dev/null; then + if rpm -q "${i}" &> /dev/null; then printf "%b %b Checking for %s\\n" "${OVER}" "${TICK}" "${i}" else printf "%b %b Checking for %s (will be installed)\\n" "${OVER}" "${INFO}" "${i}"