#!/usr/bin/env bash # shellcheck shell=bash # # Run all installer tests. No root privileges and no block devices required. set -uo pipefail TEST_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" PHOEBUS_ROOT="$(cd "$TEST_DIR/.." && pwd)" export PHOEBUS_ROOT total_failed=0 total_run=0 failed_tests=() for test in "$TEST_DIR"/test_*.sh; do [[ -f "$test" ]] || continue printf '\n== %s ==\n' "$(basename "$test")" if bash "$test"; then : else failed_tests+=("$(basename "$test")") total_failed=$((total_failed + 1)) fi done printf '\n========================================\n' if ((${#failed_tests[@]})); then printf 'FAILED test files (%d):\n' "${#failed_tests[@]}" printf ' %s\n' "${failed_tests[@]}" exit 1 fi printf 'All tests passed.\n' exit 0