fix(suppression): preserve access to Rosetta configuration

This commit is contained in:
2026-10-30 03:56:14 -03:00
parent 82188e8731
commit c7bb2d6dc9
3 changed files with 19 additions and 2 deletions
+19
View File
@@ -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
}