- Replace raw TOML textarea with Alpine.js interactive form editor (10 collapsible sections with change-tier badges, dynamic array management for connections/shares/ warmup rules, proper input controls per field type) - Add SSE-based live dashboard updates replacing htmx polling - Add log viewer tab with ring buffer backend and incremental polling - Fix SMB not seeing new shares after config reload: kill entire smbd process group (not just parent PID) so forked workers release port 445 - Add SIGHUP-based smbd config reload for share changes instead of full restart, preserving existing client connections - Generate human-readable commented TOML from config editor instead of bare toml::to_string_pretty() output - Fix Alpine.js 2.x __x.$data calls in dashboard/share templates (now Alpine 3.x) - Fix toggle switch CSS overlap with field labels - Fix dashboard going blank on tab switch (remove hx-swap-oob from tab content) - Add htmx:afterSettle → Alpine.initTree() bridge for robust tab switching Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
49 lines
1.8 KiB
Bash
Executable File
49 lines
1.8 KiB
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 config with only the required fields (connections[].name,
|
|
# connections[].nas_host, connections[].nas_user, cache.dir, shares[].connection).
|
|
# All other fields should be filled in by the binary's defaults.
|
|
source "$HARNESS_DIR/config-gen.sh"
|
|
_gen_minimal_config
|
|
|
|
# Run `warpgate status` against the minimal config. No mount is running,
|
|
# so status should report "DOWN" but still exit 0 — the important thing
|
|
# is that config parsing succeeds.
|
|
output=$("$WARPGATE_BIN" status -c "$TEST_CONFIG" 2>&1) || {
|
|
echo "FAIL: warpgate status exited non-zero with minimal config"
|
|
echo " output: $output"
|
|
exit 1
|
|
}
|
|
|
|
# Sanity: the generated config is valid TOML that includes the required
|
|
# fields we set.
|
|
assert_output_contains "$(cat "$TEST_CONFIG")" 'nas_host'
|
|
assert_output_contains "$(cat "$TEST_CONFIG")" '[cache]'
|
|
|
|
# Parse the status output for applied defaults and verify key values
|
|
# match the PRD specifications.
|
|
assert_output_contains "$output" "sftp_port"
|
|
assert_output_contains "$output" "22"
|
|
assert_output_contains "$output" "sftp_connections"
|
|
assert_output_contains "$output" "8"
|
|
assert_output_contains "$output" "write_back"
|
|
assert_output_contains "$output" "5s"
|
|
assert_output_contains "$output" "enable_smb"
|
|
assert_output_contains "$output" "true"
|
|
assert_output_contains "$output" "enable_nfs"
|
|
assert_output_contains "$output" "false"
|
|
assert_output_contains "$output" "enable_webdav"
|
|
assert_output_contains "$output" "false"
|
|
assert_output_contains "$output" "dir_cache_time"
|
|
assert_output_contains "$output" "5m0s"
|
|
assert_output_contains "$output" "transfers"
|
|
assert_output_contains "$output" "4"
|
|
|
|
echo "PASS: $(basename "$0" .sh)"
|