fix(profiles): keep preflight queries read-only and numeric

This commit is contained in:
2026-10-30 11:10:22 -03:00
parent 7f0aecf073
commit 9f95353074
5 changed files with 20 additions and 4 deletions
+6
View File
@@ -19,3 +19,9 @@ setup() {
run run_preformat_check 2>/dev/null || true
echo "$output" | grep -qiE "safe|mdm"
}
@test "pre-format checks handle zero profiles without arithmetic diagnostics" {
run run_preformat_check
[ "$status" -eq 0 ]
[[ "$output" != *"integer expression expected"* ]]
}
+8
View File
@@ -20,3 +20,11 @@ setup() {
run harden_status 2>/dev/null || true
[ "$status" -eq 0 ]
}
@test "hardening keeps profile queries on stdout" {
local calls="$BATS_TEST_TMPDIR/profile-calls"
profiles() { printf '%s\n' "$*" > "$calls"; echo '<plist><array/></plist>'; }
run harden_live_os "$BATS_TEST_TMPDIR"
[ "$status" -eq 0 ]
[ "$(cat "$calls")" = '-C -output stdout-xml' ]
}