fix: run post-install tests automatically on first boot
Adds archipelago-post-install-tests.service — runs once after all services are up, outputs to console + journal + log file at /var/log/archipelago-post-install-tests.log. Tests password setup, onboarding, and container lifecycle. Runs with default password (password123) for automated validation. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
7cd4d90ed8
commit
316dc4875a
@ -2007,6 +2007,30 @@ ExecStart=-/sbin/agetty --autologin archipelago --noclear %I $TERM
|
|||||||
AUTOLOGIN
|
AUTOLOGIN
|
||||||
chroot /mnt/target systemctl enable archipelago-diagnostics.service 2>/dev/null || true
|
chroot /mnt/target systemctl enable archipelago-diagnostics.service 2>/dev/null || true
|
||||||
|
|
||||||
|
# Post-install test runner — runs once on first boot after all services are up
|
||||||
|
cat > /mnt/target/etc/systemd/system/archipelago-post-install-tests.service <<'PITSERVICE'
|
||||||
|
[Unit]
|
||||||
|
Description=Archipelago Post-Install Test Suite (first boot)
|
||||||
|
After=archipelago.service archipelago-first-boot-containers.service nginx.service
|
||||||
|
Wants=archipelago.service nginx.service
|
||||||
|
ConditionPathExists=/opt/archipelago/scripts/run-post-install-tests.sh
|
||||||
|
ConditionPathExists=!/var/lib/archipelago/.post-install-tests-done
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=oneshot
|
||||||
|
# Wait for backend to fully initialize
|
||||||
|
ExecStartPre=/bin/bash -c 'for i in $(seq 1 30); do curl -sf http://127.0.0.1:5678/health >/dev/null 2>&1 && exit 0; sleep 2; done; exit 0'
|
||||||
|
ExecStart=/bin/bash -c '/opt/archipelago/scripts/run-post-install-tests.sh "password123" 2>&1 | tee /var/log/archipelago-post-install-tests.log; touch /var/lib/archipelago/.post-install-tests-done'
|
||||||
|
RemainAfterExit=yes
|
||||||
|
StandardOutput=journal+console
|
||||||
|
StandardError=journal+console
|
||||||
|
TimeoutStartSec=300
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
|
PITSERVICE
|
||||||
|
chroot /mnt/target systemctl enable archipelago-post-install-tests.service 2>/dev/null || true
|
||||||
|
|
||||||
# Install first-boot diagnostic script — runs once after first boot and logs system state
|
# Install first-boot diagnostic script — runs once after first boot and logs system state
|
||||||
cat > /mnt/target/opt/archipelago/scripts/first-boot-diag.sh <<'DIAGSCRIPT'
|
cat > /mnt/target/opt/archipelago/scripts/first-boot-diag.sh <<'DIAGSCRIPT'
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user