mirror of
https://github.com/theupriser/steamify-cachyos-dev.git
synced 2026-10-05 12:45:56 +02:00
fix: a test that aborts fails (exit status of the piped block), vminstall reads the ISO with bsdtar (no loop partitions in CI containers)
This commit is contained in:
1 parent
4cb253b41c
commit
6190abadfc
3 files changed
+17
-1
No files matched your search
@@ -115,7 +115,11 @@ b="$(gssh uname -r)"
|
|||||||
step "DONE"
|
step "DONE"
|
||||||
stop_vm
|
stop_vm
|
||||||
} 2>&1 | tee "$log" | tee >(sed -u "s/^/[$loader] /" >> "$TEST_LOG") | sed 's/\x1b\[[0-9;]*m//g'
|
} 2>&1 | tee "$log" | tee >(sed -u "s/^/[$loader] /" >> "$TEST_LOG") | sed 's/\x1b\[[0-9;]*m//g'
|
||||||
|
rc=${PIPESTATUS[0]} # the test itself: an abort (exit inside the braces) must not pass as 0 failed checks
|
||||||
fails="$(grep -c '^FAIL' "$log")"
|
fails="$(grep -c '^FAIL' "$log")"
|
||||||
|
if [[ $rc -ne 0 && $fails -eq 0 ]]; then
|
||||||
|
echo "FAIL $loader aborted (exit $rc): $(grep -v '^$' "$log" | tail -n 1)" | tee -a "$log"; fails=1
|
||||||
|
fi
|
||||||
echo; echo "== $loader: $(grep -c '^PASS' "$log") passed, $fails failed (log: $log)"
|
echo; echo "== $loader: $(grep -c '^PASS' "$log") passed, $fails failed (log: $log)"
|
||||||
grep '^FAIL' "$log"
|
grep '^FAIL' "$log"
|
||||||
exit "$fails"
|
exit "$fails"
|
||||||
@@ -88,7 +88,15 @@ boot="$VM_DIR/iso-boot"
|
|||||||
mkdir -p "$boot"
|
mkdir -p "$boot"
|
||||||
# One loop setup at a time: parallel installs (vmtest.sh --install) otherwise get "Device or resource busy".
|
# One loop setup at a time: parallel installs (vmtest.sh --install) otherwise get "Device or resource busy".
|
||||||
exec 9> /tmp/vminstall-iso.lock; flock 9
|
exec 9> /tmp/vminstall-iso.lock; flock 9
|
||||||
if ! command -v udisksctl >/dev/null && [[ $EUID -eq 0 ]]; then
|
if command -v bsdtar >/dev/null; then
|
||||||
|
# No loop device, no udisks, no root: libarchive reads the ISO9660 image directly (a CI container has no
|
||||||
|
# loop partition nodes, so the mounts below can't work there).
|
||||||
|
mnt="$(mktemp -d)"
|
||||||
|
cleanup_loop() { rm -rf "$mnt"; }
|
||||||
|
trap cleanup_loop EXIT
|
||||||
|
bsdtar -xf "$iso" -C "$mnt" arch/boot/x86_64/vmlinuz-linux-cachyos arch/boot/x86_64/initramfs-linux-cachyos.img boot EFI 2>/dev/null || true
|
||||||
|
[[ -f "$mnt/arch/boot/x86_64/vmlinuz-linux-cachyos" ]] || { echo "bsdtar found no kernel in the ISO." >&2; exit 1; }
|
||||||
|
elif ! command -v udisksctl >/dev/null && [[ $EUID -eq 0 ]]; then
|
||||||
# No udisks (the WSL box, as root): a plain loop device and mount.
|
# No udisks (the WSL box, as root): a plain loop device and mount.
|
||||||
loop="$(losetup -f -r -P --show "$iso")"
|
loop="$(losetup -f -r -P --show "$iso")"
|
||||||
mnt="$(mktemp -d)"
|
mnt="$(mktemp -d)"
|
||||||
|
|||||||
@@ -96,7 +96,11 @@ for block in "$dir"/*.sh; do
|
|||||||
done
|
done
|
||||||
vm_stop
|
vm_stop
|
||||||
} 2>&1 | tee "$log" | sed -u "s/^/[$suite] /" >> "$TEST_LOG"
|
} 2>&1 | tee "$log" | sed -u "s/^/[$suite] /" >> "$TEST_LOG"
|
||||||
|
rc=${PIPESTATUS[0]} # an abort inside the braces must not pass as 0 failed checks
|
||||||
fails="$(grep -c '^FAIL' "$log")"
|
fails="$(grep -c '^FAIL' "$log")"
|
||||||
|
if [[ $rc -ne 0 && $fails -eq 0 ]]; then
|
||||||
|
echo "FAIL $suite aborted (exit $rc): $(grep -v '^$' "$log" | tail -n 1)" | tee -a "$log"; fails=1
|
||||||
|
fi
|
||||||
echo "== $suite: $(grep -c '^PASS' "$log") passed, $fails failed, $(grep -c '^SKIP' "$log") skipped (log: $log)" | tee -a "$log"
|
echo "== $suite: $(grep -c '^PASS' "$log") passed, $fails failed, $(grep -c '^SKIP' "$log") skipped (log: $log)" | tee -a "$log"
|
||||||
grep '^FAIL' "$log"
|
grep '^FAIL' "$log"
|
||||||
exit "$fails"
|
exit "$fails"
|
||||||
Reference in new issue
Block a user