- Move documentation to docs/ directory for better organization - Add bin/ directory for utility scripts - Add lib/ for shared library functions - Update all build scripts to ensure strict Docker compliance - Enhance AGENTS.md with Docker container requirements - Create comprehensive compliance and security documentation - Reorganize test suite with improved structure - Remove obsolete Dockerfile and archive documentation - Add final security compliance report BREAKING CHANGE: Restructured project layout with moved documentation directories 💘 Generated with Crush Assisted-by: GLM-4.6 via Crush <crush@charm.land>
56 lines
1.4 KiB
Bash
56 lines
1.4 KiB
Bash
#!/usr/bin/env bats
|
|
# Unit tests for build script functions
|
|
|
|
# Add bats library to BATS_LIB_PATH
|
|
export BATS_LIB_PATH="/usr/lib/bats-core"
|
|
|
|
load 'bats-support/load'
|
|
load 'bats-assert/load'
|
|
load '../test_helper/common.bash'
|
|
|
|
@test "validate_environment checks for required tools" {
|
|
source "${PROJECT_ROOT}/src/build-iso.sh"
|
|
|
|
# Create mock directory structure
|
|
mkdir -p "${TEST_TEMP_DIR}/config"
|
|
mkdir -p "${TEST_TEMP_DIR}/output"
|
|
|
|
# Override variables for testing
|
|
PROJECT_ROOT="$TEST_TEMP_DIR"
|
|
CONFIG_DIR="$TEST_TEMP_DIR/config"
|
|
OUTPUT_DIR="$TEST_TEMP_DIR/output"
|
|
|
|
# Test with missing tools (should fail)
|
|
run validate_environment
|
|
assert_failure
|
|
}
|
|
|
|
@test "prepare_build creates output directory" {
|
|
source "${PROJECT_ROOT}/src/build-iso.sh"
|
|
|
|
# Override variables for testing
|
|
PROJECT_ROOT="$TEST_TEMP_DIR"
|
|
OUTPUT_DIR="$TEST_TEMP_DIR/output"
|
|
|
|
# Remove directory if it exists
|
|
rm -rf "$OUTPUT_DIR"
|
|
|
|
# Run function
|
|
run prepare_build
|
|
assert_success
|
|
|
|
# Check directory was created
|
|
assert [ -d "$OUTPUT_DIR" ]
|
|
}
|
|
|
|
@test "build_iso fails without live-build setup" {
|
|
source "${PROJECT_ROOT}/src/build-iso.sh"
|
|
|
|
# Override variables for testing
|
|
PROJECT_ROOT="$TEST_TEMP_DIR"
|
|
OUTPUT_DIR="$TEST_TEMP_DIR/output"
|
|
|
|
# Run function
|
|
run build_iso
|
|
assert_failure
|
|
} |