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:
@@ -0,0 +1,25 @@
|
||||
#!/usr/bin/env bats
|
||||
# Tests for dscl.sh - run with: bats tests/test_dscl.bats
|
||||
|
||||
setup() {
|
||||
load '../lib/colors.sh'
|
||||
load '../lib/dscl.sh'
|
||||
TEST_DIR=$(mktemp -d)
|
||||
mkdir -p "$TEST_DIR/private/var/db/dslocal/nodes/Default"
|
||||
}
|
||||
|
||||
teardown() {
|
||||
rm -rf "$TEST_DIR"
|
||||
}
|
||||
|
||||
@test "dscl_node returns correct path" {
|
||||
run dscl_node "$TEST_DIR"
|
||||
[ "$output" = "$TEST_DIR/private/var/db/dslocal/nodes/Default" ]
|
||||
}
|
||||
|
||||
@test "find_available_uid returns 501 for empty node" {
|
||||
local node
|
||||
node=$(dscl_node "$TEST_DIR")
|
||||
run find_available_uid "$node"
|
||||
[ "$output" = "501" ]
|
||||
}
|
||||
Reference in New Issue
Block a user