Files
football/tests/unit/security_test.bats
T
mrcharles c1d8c5def6 chore: clean up root directory and consolidate documentation
Remove obsolete documentation files and consolidate into docs/ directory. Remove redundant test scripts (functionality will be folded into run.sh). Update AGENTS.md with SDLC workflow. Update PRD.md with tier0 architecture clarification. Update README.md to reflect clean directory structure.

Changes:
- Delete: BUILD-COMPLETE.md, BUILD-SUMMARY.md, RESUME.md, SESSION-CLOSED.md
- Delete: FINAL-SECURITY-COMPLIANCE-REPORT.md, QUICK_START.md, JOURNAL.md
- Move: TEST-COVERAGE.md, VERIFICATION-REPORT.md to docs/
- Delete: test-iso.sh, test-runner.sh (will fold into run.sh)
- Update: AGENTS.md with SDLC workflow section
- Update: PRD.md with tier0 architecture clarification and diagram
- Update: README.md to reflect clean directory structure

Root directory now contains only: AGENTS.md, README.md, PRD.md, Dockerfile, run.sh

💘 Generated with Crush

Assisted-by: GLM-4.7 via Crush <crush@charm.land>
2026-01-29 12:07:28 -05:00

56 lines
1.9 KiB
Bash

#!/usr/bin/env bats
# Unit tests for security hardening functions
# Add bats library to BATS_LIB_PATH
load 'bats-support/load'
load 'bats-assert/load'
load 'bats-file/load'
load '../test_helper/common.bash'
@test "create_wifi_blacklist creates correct configuration" {
source "${PROJECT_ROOT}/src/security-hardening.sh"
local test_output="$TEST_TEMP_DIR/blacklist-wifi.conf"
create_wifi_blacklist "$test_output"
assert [ -f "$test_output" ]
assert_file_contains "$test_output" "blacklist cfg80211"
assert_file_contains "$test_output" "blacklist mac80211"
assert_file_contains "$test_output" "blacklist iwlwifi"
}
@test "create_bluetooth_blacklist creates correct configuration" {
source "${PROJECT_ROOT}/src/security-hardening.sh"
local test_output="$TEST_TEMP_DIR/blacklist-bluetooth.conf"
create_bluetooth_blacklist "$test_output"
assert [ -f "$test_output" ]
assert_file_contains "$test_output" "blacklist btusb"
assert_file_contains "$test_output" "blacklist bluetooth"
}
@test "configure_ssh creates secure configuration" {
source "${PROJECT_ROOT}/src/security-hardening.sh"
local test_output="$TEST_TEMP_DIR/sshd_config"
configure_ssh "$test_output"
assert [ -f "$test_output" ]
assert_file_contains "$test_output" "PermitRootLogin no"
assert_file_contains "$test_output" "PasswordAuthentication yes"
assert_file_contains "$test_output" "MaxAuthTries 3"
}
@test "configure_password_policy creates secure policy" {
source "${PROJECT_ROOT}/src/security-hardening.sh"
local test_output="$TEST_TEMP_DIR/pwquality.conf"
configure_password_policy "$test_output"
assert [ -f "$test_output" ]
assert_file_contains "$test_output" "minlen = 14"
assert_file_contains "$test_output" "dcredit = -1"
assert_file_contains "$test_output" "ucredit = -1"
}