aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-01-20 19:32:13 -0600
committerCraig Jennings <c@cjennings.net>2026-01-20 19:32:13 -0600
commit90585039f4a7ae6e7af8e1567a23c4c0b012930b (patch)
treeab79ec5c648ef383addae5113d64d2167d881668 /scripts
parent32eef0b69a321cc24e7a51390dbc5de0ddfb5be2 (diff)
downloadarchangel-90585039f4a7ae6e7af8e1567a23c4c0b012930b.tar.gz
archangel-90585039f4a7ae6e7af8e1567a23c4c0b012930b.zip
Add initramfs and reboot verification tests
- Check zpool.cache is present in initramfs (catches cachefile bugs) - Add reboot test: issue reboot, wait for system to come back - Verify ZFS pool healthy after reboot - Ensures the installed system can survive a reboot cycle
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/full-test.sh52
1 files changed, 52 insertions, 0 deletions
diff --git a/scripts/full-test.sh b/scripts/full-test.sh
index 9537411..c5fa641 100755
--- a/scripts/full-test.sh
+++ b/scripts/full-test.sh
@@ -457,6 +457,15 @@ CONF"
fi
$VERBOSE && info "Pool cachefile property set correctly"
+ # Check zpool.cache is in initramfs (required for boot)
+ local initramfs_cache=$(ssh_cmd "lsinitcpio /boot/initramfs-linux-lts.img 2>/dev/null | grep zpool.cache" 2>/dev/null)
+ if [[ -z "$initramfs_cache" ]]; then
+ fail "$test_name: zpool.cache missing from initramfs"
+ cleanup
+ return 1
+ fi
+ $VERBOSE && info "zpool.cache present in initramfs"
+
# Check kernel
local kernel=$(ssh_cmd "uname -r" 2>/dev/null)
if [[ "$kernel" != *"lts"* ]]; then
@@ -464,6 +473,49 @@ CONF"
fi
$VERBOSE && info "Kernel: $kernel"
+ # Reboot test - verify system comes back up cleanly
+ info "Testing reboot..."
+ ssh_cmd "reboot" 2>/dev/null || true
+
+ # Wait for SSH to go down (system is rebooting)
+ local down_timeout=30
+ local down_start=$(date +%s)
+ while ssh_cmd "echo up" &>/dev/null; do
+ sleep 1
+ local elapsed=$(($(date +%s) - down_start))
+ if [[ $elapsed -gt $down_timeout ]]; then
+ warn "System didn't go down for reboot within ${down_timeout}s"
+ break
+ fi
+ done
+ $VERBOSE && info "System went down for reboot"
+
+ # Wait for SSH to come back up
+ local reboot_timeout=120
+ local reboot_start=$(date +%s)
+ while ! ssh_cmd "echo up" &>/dev/null; do
+ sleep 2
+ local elapsed=$(($(date +%s) - reboot_start))
+ if [[ $elapsed -gt $reboot_timeout ]]; then
+ fail "$test_name: System failed to come back after reboot (timeout ${reboot_timeout}s)"
+ cleanup
+ return 1
+ fi
+ $VERBOSE && printf "."
+ done
+ $VERBOSE && echo ""
+ local reboot_elapsed=$(($(date +%s) - reboot_start))
+ info "System rebooted successfully (${reboot_elapsed}s)"
+
+ # Verify ZFS pool is healthy after reboot
+ local post_reboot_status=$(ssh_cmd "zpool status -x zroot" 2>/dev/null)
+ if [[ "$post_reboot_status" != *"healthy"* && "$post_reboot_status" != *"all pools are healthy"* ]]; then
+ fail "$test_name: ZFS pool not healthy after reboot: $post_reboot_status"
+ cleanup
+ return 1
+ fi
+ $VERBOSE && info "ZFS pool healthy after reboot"
+
# Shutdown
ssh_cmd "poweroff" 2>/dev/null || true
sleep 3