#!/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 # Use directories that do not yet exist. Preflight should create them. NEW_MOUNT="$TEST_DIR/new-mount" NEW_CACHE="$TEST_DIR/new-cache" # Ensure they really don't exist [[ ! -d "$NEW_MOUNT" ]] || { echo "FAIL: $NEW_MOUNT already exists"; exit 1; } [[ ! -d "$NEW_CACHE" ]] || { echo "FAIL: $NEW_CACHE already exists"; exit 1; } # Generate config with the non-existent directories. # No mock NAS is running, so the mount will fail after preflight, # but that is fine -- we only need to verify directory creation. gen_config mount_point="$NEW_MOUNT" cache_dir="$NEW_CACHE" start_warpgate # Wait for warpgate to exit (it will fail on mount since no NAS is running) wait_for_exit "$WARPGATE_PID" 35 # Verify preflight created both directories assert_dir_exists "$NEW_MOUNT" assert_dir_exists "$NEW_CACHE" echo "PASS: $(basename "$0" .sh)"