feat: tests, demo, JSON output, VPN kill-switch, more issue responses

- tests/: bats test suite for 8 modules (suppress, heal, firewall, detect,
  validate, colors, dscl, backup)
- demo: simulated full bypass flow for showcasing (no real changes)
- --json flag for report and audit commands (machine-readable output)
- vpn-kill: pf-based kill-switch that blocks MDM outside VPN tunnel
- vpn-kill-remove / vpn-kill-status: manage the kill-switch
- Responded to 5 more bypass-mdm issues
- CI now includes all new lib files in ShellCheck
- Bump 1.4.0 -> 1.5.0
This commit is contained in:
2026-06-20 13:07:03 -03:00
parent 33e83f8d63
commit 1791f6d321
16 changed files with 1001 additions and 10 deletions
+51
View File
@@ -0,0 +1,51 @@
#!/usr/bin/env bats
# Tests for validate.sh - run with: bats tests/test_validate.bats
setup() {
load '../lib/colors.sh'
load '../lib/validate.sh'
}
@test "validate_username accepts valid usernames" {
run validate_username "apple"
[ "$status" -eq 0 ]
run validate_username "test-user"
[ "$status" -eq 0 ]
run validate_username "test_user"
[ "$status" -eq 0 ]
}
@test "validate_username rejects empty" {
run validate_username ""
[ "$status" -eq 1 ]
}
@test "validate_username rejects long names" {
local long="aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
run validate_username "$long"
[ "$status" -eq 1 ]
}
@test "validate_username rejects special chars" {
run validate_username "user name"
[ "$status" -eq 1 ]
run validate_username "user.name"
[ "$status" -eq 1 ]
}
@test "validate_password accepts valid passwords" {
run validate_password "1234"
[ "$status" -eq 0 ]
run validate_password "correct horse battery staple"
[ "$status" -eq 0 ]
}
@test "validate_password rejects empty" {
run validate_password ""
[ "$status" -eq 1 ]
}
@test "validate_password rejects short" {
run validate_password "ab"
[ "$status" -eq 1 ]
}