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>
31 lines
920 B
Bash
Executable File
31 lines
920 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
|
|
|
|
GENERATED="$TEST_DIR/generated.toml"
|
|
|
|
# config-init should create a new config file at the specified path.
|
|
output=$("$WARPGATE_BIN" config-init --output "$GENERATED" 2>&1) || {
|
|
echo "FAIL: config-init exited non-zero"
|
|
echo " output: $output"
|
|
exit 1
|
|
}
|
|
|
|
# The file must exist after a successful run.
|
|
assert_file_exists "$GENERATED"
|
|
|
|
# The generated config should be parseable by the binary. Running
|
|
# `status` will fail on the mount check (no mount running) but must
|
|
# not fail on config parsing — exit code 0 with a DOWN status.
|
|
output=$("$WARPGATE_BIN" status -c "$GENERATED" 2>&1) || {
|
|
echo "FAIL: generated config is not parseable by warpgate status"
|
|
echo " output: $output"
|
|
exit 1
|
|
}
|
|
|
|
echo "PASS: $(basename "$0" .sh)"
|