#!/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