From 0020492a5b107fa5142ee642119876378849adb4 Mon Sep 17 00:00:00 2001 From: yubiuser Date: Tue, 18 Feb 2025 23:43:24 +0100 Subject: [PATCH 1/3] Add test to output FTL's version information Signed-off-by: yubiuser --- test/tests/test_general.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/tests/test_general.py b/test/tests/test_general.py index c926f2a..0fd18b1 100644 --- a/test/tests/test_general.py +++ b/test/tests/test_general.py @@ -12,6 +12,10 @@ def test_pihole_gid_env_var(docker): func = docker.run("id -g pihole") assert "456" in func.stdout +def test_pihole_FTL_version(docker): + func = docker.run("pihole-FTL -vv") + assert func.rc == 0 + assert "Version:" in func.stdout # Wait 5 seconds for startup, then kill the start.sh script # Finally, grep the FTL log to see if it has been shut down cleanly From d252307ca87ae05b57b81e85d8d65cab12fbce71 Mon Sep 17 00:00:00 2001 From: yubiuser Date: Tue, 18 Feb 2025 23:50:36 +0100 Subject: [PATCH 2/3] Print FTL version also when building the image Signed-off-by: yubiuser --- src/Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Dockerfile b/src/Dockerfile index 9cea559..ed54bbf 100644 --- a/src/Dockerfile +++ b/src/Dockerfile @@ -96,7 +96,8 @@ RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then FTLARCH=amd64; \ && if [ "${FTL_BRANCH}" = "master" ]; then URL="https://github.com/pi-hole/ftl/releases/latest/download"; else URL="https://ftl.pi-hole.net/${FTL_BRANCH}"; fi \ && curl -sSL "${URL}/pihole-FTL-${FTLARCH}" -o /usr/bin/pihole-FTL \ && chmod +x /usr/bin/pihole-FTL \ - && readelf -h /usr/bin/pihole-FTL || (echo "Error with downloaded FTL binary" && exit 1) + && readelf -h /usr/bin/pihole-FTL || (echo "Error with downloaded FTL binary" && exit 1) \ + && /usr/bin/pihole-FTL -vv FROM base AS local-ftl-install # pihole-FTL must be built from source and copied to the src directory first! From 4abe9094c6945da2ebf5788e143e03349959351f Mon Sep 17 00:00:00 2001 From: yubiuser Date: Tue, 18 Feb 2025 23:52:37 +0100 Subject: [PATCH 3/3] PEP8 requires all lowser case Signed-off-by: yubiuser --- test/tests/test_general.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/tests/test_general.py b/test/tests/test_general.py index 0fd18b1..7b9f735 100644 --- a/test/tests/test_general.py +++ b/test/tests/test_general.py @@ -12,7 +12,7 @@ def test_pihole_gid_env_var(docker): func = docker.run("id -g pihole") assert "456" in func.stdout -def test_pihole_FTL_version(docker): +def test_pihole_ftl_version(docker): func = docker.run("pihole-FTL -vv") assert func.rc == 0 assert "Version:" in func.stdout