Integration tests (tests/): - 9 categories covering config, lifecycle, signals, supervision, cache, writeback, network faults, crash recovery, and CLI - Shell-based harness with mock NAS (network namespace + SFTP), fault injection (tc netem), and power loss simulation - TAP format runner (run-all.sh) with proper SKIP detection Rust unit tests (warpgate/src/): - 110 tests across 14 modules, all passing in 0.01s - Config parsing, defaults validation, RestartTracker logic, RC API response parsing, rclone arg generation, service config generation, CLI output formatting, warmup path logic Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
24 lines
717 B
Bash
Executable File
24 lines
717 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
source "$SCRIPT_DIR/../harness/helpers.sh"
|
|
|
|
setup_test_env
|
|
trap teardown_test_env EXIT
|
|
|
|
# Generate a config that is missing the required `nas_host` field.
|
|
source "$HARNESS_DIR/config-gen.sh"
|
|
_gen_broken_config missing_field
|
|
|
|
# The binary should fail to parse the config and exit non-zero.
|
|
output=$("$WARPGATE_BIN" status -c "$TEST_CONFIG" 2>&1) && {
|
|
echo "FAIL: warpgate status should have exited non-zero for missing field"
|
|
echo " output: $output"
|
|
exit 1
|
|
}
|
|
|
|
# The error message from the TOML deserializer should mention "missing field".
|
|
assert_output_contains "$output" "missing field"
|
|
|
|
echo "PASS: $(basename "$0" .sh)"
|