From 7ca3d4f2d47b7a5d737b80f1326a139d3428de0f Mon Sep 17 00:00:00 2001 From: ruihan Date: Fri, 30 Oct 2026 03:56:14 -0300 Subject: [PATCH] fix(suppression): preserve access to Rosetta configuration --- lib/suppress.sh | 1 - tests/test_rosetta.bats | 19 +++++++++++++++++++ unleash-standalone.sh | 1 - 3 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 tests/test_rosetta.bats diff --git a/lib/suppress.sh b/lib/suppress.sh index 2c513f5..223d54d 100644 --- a/lib/suppress.sh +++ b/lib/suppress.sh @@ -50,7 +50,6 @@ suppress_enrollment() { gdmf.apple.com ax.init-content.apple.com init-content.apple.com - configuration.apple.com xp.apple.com gs.apple.com tb.apple.com diff --git a/tests/test_rosetta.bats b/tests/test_rosetta.bats new file mode 100644 index 0000000..1403de8 --- /dev/null +++ b/tests/test_rosetta.bats @@ -0,0 +1,19 @@ +#!/usr/bin/env bats + +@test "suppression does not add hosts blocks for Rosetta configuration" { + local entrypoint + for entrypoint in unleash unleash-standalone.sh; do + local script="$BATS_TEST_DIRNAME/../$entrypoint" + local target="$BATS_TEST_TMPDIR/$entrypoint" + mkdir -p "$target/private/etc" + printf '127.0.0.1 localhost\n' > "$target/private/etc/hosts" + run bash -u -c ' + source <(sed '\''/^main "\$@"$/d'\'' "$1") + PB=: + suppress_enrollment "$2" + ' "$script" "$script" "$target" + [ "$status" -eq 0 ] + ! grep -q 'configuration[.]apple[.]com' "$target/private/etc/hosts" + grep -q '^127.0.0.1 localhost$' "$target/private/etc/hosts" + done +} diff --git a/unleash-standalone.sh b/unleash-standalone.sh index 347311c..ea129e0 100755 --- a/unleash-standalone.sh +++ b/unleash-standalone.sh @@ -459,7 +459,6 @@ suppress_enrollment() { gdmf.apple.com ax.init-content.apple.com init-content.apple.com - configuration.apple.com xp.apple.com gs.apple.com tb.apple.com