PRD fixes: - Remove duplicate 'Installation Behavior' section - Fix malformed terminology table (missing pipe separator) Documentation alignment with FR-006: - README.md: Change SSH/firewall to client-only, no inbound access - TEST-COVERAGE.md: Remove 'Firewall allows SSH inbound' - VERIFICATION-REPORT.md: Fix password config docs to match preseed.cfg - COMPLIANCE.md: Change 'SSH Hardening' to 'SSH Client-Only' Test enhancements: - Expand unit tests for encryption, firewall, security hardening - Add comprehensive coverage for FR-001 through FR-009 requirements All changes ensure documentation and tests align with PRD.md FR-006 which requires SSH client-only with no server or inbound access. 💘 Generated with Crush Assisted-by: GLM-4.7 via Crush <crush@charm.land>
57 lines
1.9 KiB
Bash
57 lines
1.9 KiB
Bash
#!/usr/bin/env bats
|
|
# Unit tests for encryption-setup.sh hook
|
|
# Reference: PRD.md FR-001 (Full Disk Encryption)
|
|
|
|
@test "encryption-setup.sh exists and is executable" {
|
|
[ -f "/workspace/config/hooks/installed/encryption-setup.sh" ]
|
|
[ -x "/workspace/config/hooks/installed/encryption-setup.sh" ]
|
|
}
|
|
|
|
@test "Encryption uses LUKS2 format" {
|
|
grep -q "luks2\|LUKS2" /workspace/config/hooks/installed/encryption-setup.sh
|
|
}
|
|
|
|
@test "Encryption uses AES-XTS cipher" {
|
|
grep -q "aes-xts\|aes_xts\|AES-XTS" /workspace/config/hooks/installed/encryption-setup.sh
|
|
}
|
|
|
|
@test "Encryption uses 512-bit key" {
|
|
grep -q "512" /workspace/config/hooks/installed/encryption-setup.sh
|
|
}
|
|
|
|
@test "Encryption setup includes cryptsetup" {
|
|
grep -q "cryptsetup" /workspace/config/hooks/installed/encryption-setup.sh
|
|
}
|
|
|
|
@test "Encryption setup configures initramfs" {
|
|
grep -q "initramfs" /workspace/config/hooks/installed/encryption-setup.sh
|
|
}
|
|
|
|
@test "Encryption setup configures crypttab" {
|
|
grep -q "crypttab" /workspace/config/hooks/installed/encryption-setup.sh
|
|
}
|
|
|
|
@test "Encryption setup includes dm-crypt module" {
|
|
grep -q "dm_crypt" /workspace/config/hooks/installed/encryption-setup.sh
|
|
}
|
|
|
|
@test "Encryption setup creates check-encryption.sh" {
|
|
grep -q "check-encryption.sh" /workspace/config/hooks/installed/encryption-setup.sh
|
|
}
|
|
|
|
@test "Encryption setup creates manage-encryption-keys.sh" {
|
|
grep -q "manage-encryption-keys.sh" /workspace/config/hooks/installed/encryption-setup.sh
|
|
}
|
|
|
|
@test "Encryption setup creates systemd service" {
|
|
grep -q "knel-encryption-check.service" /workspace/config/hooks/installed/encryption-setup.sh
|
|
}
|
|
|
|
@test "Encryption setup creates README with recovery info" {
|
|
grep -q "README" /workspace/config/hooks/installed/encryption-setup.sh
|
|
}
|
|
|
|
@test "Encryption setup configures GRUB" {
|
|
grep -q "grub" /workspace/config/hooks/installed/encryption-setup.sh
|
|
}
|