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
1.1 KiB
Bash
Executable File
31 lines
1.1 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Test: `warpgate deploy` starts with dependency checking
|
|
#
|
|
# Verifies that the deploy subcommand begins by checking for required
|
|
# dependencies (rclone, smbd, fusermount3). The deploy may fail if not
|
|
# running as root or if dependencies are missing — that is acceptable;
|
|
# we only verify the dependency-check phase runs.
|
|
set -euo pipefail
|
|
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
source "$SCRIPT_DIR/../harness/helpers.sh"
|
|
|
|
setup_test_env
|
|
trap teardown_test_env EXIT
|
|
|
|
# Generate config (deploy reads config for protocol flags, etc.)
|
|
gen_config
|
|
|
|
# Run deploy — allow non-zero exit (deps may be missing, not root, etc.)
|
|
exit_code=0
|
|
output=$("$WARPGATE_BIN" deploy -c "$TEST_CONFIG" 2>&1) || exit_code=$?
|
|
|
|
# Verify output contains the dependency check phase
|
|
assert_output_contains "$output" "Checking dependencies"
|
|
|
|
# Verify output lists individual dependencies being checked
|
|
assert_output_contains "$output" "rclone"
|
|
assert_output_contains "$output" "samba\|smbd"
|
|
assert_output_contains "$output" "fuse3\|fusermount3"
|
|
|
|
echo "PASS: $(basename "$0" .sh)"
|