From 38ecc1693f50764209b8a0eff289064eef0ed881 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Sat, 21 Oct 2023 19:28:59 +0200 Subject: [PATCH] Further simplify the ARMv6 test Signed-off-by: DL6ER --- automated install/basic-install.sh | 8 ++------ test/test_any_automated_install.py | 8 ++++---- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index 019cc3e3..2d47a548 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -1878,20 +1878,16 @@ get_binary_name() { # If AArch64 is found (e.g., BCM2711 in Raspberry Pi 4) printf "%b %b Detected AArch64 (64 Bit ARM) architecture\\n" "${OVER}" "${TICK}" l_binary="pihole-FTL-arm64" - elif [[ "${cpu_arch}" == "v6"* ]]; then + elif [[ "${rev}" -eq 6 ]]; then # If ARMv6 is found (e.g., BCM2835 in Raspberry Pi 1 and Zero) printf "%b %b Detected ARMv6 architecture\\n" "${OVER}" "${TICK}" l_binary="pihole-FTL-armv6" - elif [[ "${cpu_arch}" == "v7"* || "${rev}" -ge 7 ]]; then + elif [[ "${rev}" -ge 7 ]]; then # If ARMv7 or higher is found (e.g., BCM2836 in Raspberry PI 2 Mod. B) # This path is also used for ARMv8 when the OS is in 32bit mode # (e.g., BCM2837 in Raspberry Pi Model 3B, or BCM2711 in Raspberry Pi 4) printf "%b %b Detected ARMv7 (or newer) architecture (%s)\\n" "${OVER}" "${TICK}" "${cpu_arch}" l_binary="pihole-FTL-armv7" - elif [[ "${rev}" -gt 6 ]]; then - # Otherwise, if ARMv7 is found (e.g., BCM2836 in Raspberry Pi Model 2) - printf "%b %b Detected ARMv7 architecture (%s)\\n" "${OVER}" "${TICK}" "${cpu_arch}" - l_binary="pihole-FTL-armv6" else # Otherwise, Pi-hole does not support this architecture printf "%b %b This processor architecture is not supported by Pi-hole (%s)\\n" "${OVER}" "${CROSS}" "${cpu_arch}" diff --git a/test/test_any_automated_install.py b/test/test_any_automated_install.py index 1980f0b6..7d9d15f6 100644 --- a/test/test_any_automated_install.py +++ b/test/test_any_automated_install.py @@ -269,8 +269,8 @@ def test_FTL_detect_armv6_no_errors(host): mock_command_2( "readelf", { - "-A /bin/sh": ("Tag_CPU_arch: armv6KZ", "0"), - "-A /usr/bin/sh": ("Tag_CPU_arch: armv6KZ", "0"), + "-A /bin/sh": ("Tag_CPU_arch: armv6", "0"), + "-A /usr/bin/sh": ("Tag_CPU_arch: armv6", "0"), }, host, ) @@ -319,7 +319,7 @@ def test_FTL_detect_armv7l_no_errors(host): ) expected_stdout = info_box + " FTL Checks..." assert expected_stdout in detectPlatform.stdout - expected_stdout = tick_box + (" Detected ARMv7 architecture (armv7l)") + expected_stdout = tick_box + (" Detected ARMv7 (or newer) architecture") assert expected_stdout in detectPlatform.stdout expected_stdout = tick_box + " Downloading and Installing FTL" assert expected_stdout in detectPlatform.stdout @@ -352,7 +352,7 @@ def test_FTL_detect_armv7_no_errors(host): ) expected_stdout = info_box + " FTL Checks..." assert expected_stdout in detectPlatform.stdout - expected_stdout = tick_box + (" Detected ARMv7 architecture (armv7)") + expected_stdout = tick_box + (" Detected ARMv7 (or newer) architecture") assert expected_stdout in detectPlatform.stdout expected_stdout = tick_box + " Downloading and Installing FTL" assert expected_stdout in detectPlatform.stdout