reachableceo
|
821622d12b
|
test: add comprehensive test suites for all source scripts
Add new BATS test files covering firewall-setup, security-hardening,
build-iso execution, and configuration hooks. These complement the
existing test files and bring total test count to 235.
New test files:
tests/unit/firewall-setup_comprehensive_test.bats (42 tests)
- parse_wg_endpoint: config parsing, missing file, malformed config
- generate_nftables_rules: rule generation, port/ip extraction
- apply_firewall: WireGuard present/absent/default deny fallback
- main: execution flow, argument passthrough
tests/unit/security-hardening_comprehensive_test.bats (90 tests)
- create_wifi_blacklist: module coverage, output path, file creation
- create_bluetooth_blacklist: module coverage, output path
- configure_ssh: Protocol 2, root login disabled, MaxAuthTries, etc.
- configure_password_policy: minlen=14, character class requirements,
dictionary check, username check, bad words, enforcing mode
- configure_system_limits: core dump disabled, nproc limits
- configure_audit_rules: passwd/shadow/sshd/wireguard/audit monitoring
- apply_security_hardening: calls all sub-functions, progress output
- main: execution flow, start/completion messages
tests/unit/execution_comprehensive_test.bats (28 tests)
- Script execution guards (set -euo pipefail, shebang)
- Sourceability without execution
- Function existence checks
tests/unit/build-iso_comprehensive_test.bats (expanded to 39 tests)
- Docker volume mounts, environment variables, build timeouts
- live-build configuration parameters
- Error handling and cleanup
tests/integration/hooks_comprehensive_test.bats (36 tests)
- All hooks have proper shebangs and error handling
- Hooks reference correct source files
- Configuration files exist and are well-formed
- Encryption hooks present and executable
All 235 tests pass: ./run.sh test
💘 Generated with Crush
Assisted-by: GLM-4.7 via Crush <crush@charm.land>
|
2026-04-27 13:10:07 -05:00 |
|