From 97b484b9dd7dee456ad7ce2c29b852a3e616e21d Mon Sep 17 00:00:00 2001 From: Steffen Beyer Date: Tue, 14 Apr 2026 19:37:18 +0200 Subject: [PATCH] Clean up self-hosted lifecycle harness runs --- modules/fruix/packages/freebsd.scm | 1 + tests/run-self-hosted-node-lifecycle-xcpng.sh | 15 +++++++++------ tests/run-self-hosted-node-lifecycle.sh | 15 ++++++++++++--- 3 files changed, 22 insertions(+), 9 deletions(-) diff --git a/modules/fruix/packages/freebsd.scm b/modules/fruix/packages/freebsd.scm index 4b23833..cd64d29 100644 --- a/modules/fruix/packages/freebsd.scm +++ b/modules/fruix/packages/freebsd.scm @@ -464,6 +464,7 @@ experiments." (file "/usr/sbin/syslogd" "usr/sbin/syslogd") (file "/usr/sbin/utx" "usr/sbin/utx") (file "/usr/bin/id" "usr/bin/id") + (file "/usr/bin/what" "usr/bin/what") (file "/sbin/kldload" "sbin/kldload") (file "/sbin/kldstat" "sbin/kldstat") (file "/sbin/devfs" "sbin/devfs") diff --git a/tests/run-self-hosted-node-lifecycle-xcpng.sh b/tests/run-self-hosted-node-lifecycle-xcpng.sh index b909f3b..d92babc 100755 --- a/tests/run-self-hosted-node-lifecycle-xcpng.sh +++ b/tests/run-self-hosted-node-lifecycle-xcpng.sh @@ -457,10 +457,13 @@ echo "self-hosted XCP-ng guest is ready" echo " guest_ip=$guest_ip" echo " vm_id=$vm_id" echo " vdi_id=$vdi_id" -echo " current_os_file=$current_os_file" -echo " candidate_os_file=$candidate_os_file" -echo " metadata_file=$metadata_file" -if [ "$boot_only" -eq 0 ]; then - echo " lifecycle_out=$lifecycle_out" +if [ "$cleanup" -eq 1 ]; then + echo " workdir=cleaned (set KEEP_WORKDIR=1 or WORKDIR=... to retain $workdir)" +else + echo " current_os_file=$current_os_file" + echo " candidate_os_file=$candidate_os_file" + echo " metadata_file=$metadata_file" + if [ "$boot_only" -eq 0 ]; then + echo " lifecycle_out=$lifecycle_out" + fi fi -trap - EXIT diff --git a/tests/run-self-hosted-node-lifecycle.sh b/tests/run-self-hosted-node-lifecycle.sh index 3163cd6..0186d6e 100755 --- a/tests/run-self-hosted-node-lifecycle.sh +++ b/tests/run-self-hosted-node-lifecycle.sh @@ -144,8 +144,14 @@ show_status_summary() { } tmpdir=$(mktemp -d /tmp/fruix-self-hosted-node-lifecycle.XXXXXX) +cleanup_tmpdir=1 +if [ "${KEEP_WORKDIR:-0}" -eq 1 ]; then + cleanup_tmpdir=0 +fi cleanup() { - rm -rf "$tmpdir" + if [ "$cleanup_tmpdir" -eq 1 ]; then + rm -rf "$tmpdir" + fi } trap cleanup EXIT @@ -260,5 +266,8 @@ fi echo echo "self-hosted node lifecycle validation completed" -echo "artifacts: $tmpdir" -trap - EXIT +if [ "$cleanup_tmpdir" -eq 1 ]; then + echo "artifacts: cleaned (set KEEP_WORKDIR=1 to retain $tmpdir)" +else + echo "artifacts: $tmpdir" +fi