phoebus_os/installer/tests/test_plan.sh
Phoebus 38214ea9e7 chore: import Phoebus OS installer and Rust migration
Initial public import of the proven Bash installer (installer/) and the production Rust workspace (installer-rs/). The reference ISO, build output and local agent transcripts are gitignored.

Verified: installer/tests/run_tests.sh and cargo test --workspace both pass.
2026-09-20 02:07:33 -07:00

34 lines
1.2 KiB
Bash

#!/usr/bin/env bash
# shellcheck shell=bash
source "$(dirname "${BASH_SOURCE[0]}")/lib.sh"
TEST_NAME="test_plan"
phoebus_test_setup
config_set HOSTNAME "phoebus-test"
config_set USERNAME "tester"
config_set DESKTOP_PROFILE "dwl"
config_set PACKAGE_POLICY "balanced"
plan_generate
plan="$(plan_render)"
assert_contains "$plan" "Installation plan" "plan has header"
assert_contains "$plan" "phoebus-test" "plan includes hostname"
assert_contains "$plan" "tester" "plan includes username"
assert_contains "$plan" "dwl" "plan includes desktop profile"
assert_contains "$plan" "systemd" "plan includes init system"
assert_contains "$plan" "@snapshots" "plan includes snapshot subvolume"
assert_eq "storage_prepare" "${PLAN_STEPS[0]}" "first step is storage_prepare"
assert_eq "finalize" "${PLAN_STEPS[${#PLAN_STEPS[@]}-1]}" "last step is finalize"
# subvolume list is configurable
config_set BTRFS_SUBVOLS "@ @home @var @snapshots @swap @log"
plan_generate
assert_contains "$(plan_render)" "@log" "plan reflects configured subvolumes"
# swap sizing is bounded
swap="$(plan_swap_mib)"
assert_success "swap size is numeric" test "$swap" -ge 1024
phoebus_test_report