From 4aa5ecf78c6ae40bbc308b946b7f3fce877adc85 Mon Sep 17 00:00:00 2001 From: DevomB Date: Tue, 29 Sep 2026 04:37:20 -0700 Subject: [PATCH] The launcher suite gives a stopped zone's volume 30 seconds to close, not 10: the launcher closes it after pid 1 is gone, and a slow runner once took longer, which failed destroy for a volume that was merely still closing; the failure now says what stop answered --- compartments/tests/launcher.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/compartments/tests/launcher.sh b/compartments/tests/launcher.sh index af123c18..7994867d 100755 --- a/compartments/tests/launcher.sh +++ b/compartments/tests/launcher.sh @@ -673,9 +673,9 @@ if (( PRIVILEGED == 1 )) && command -v cryptsetup >/dev/null 2>&1 && [[ -e /dev/ done "$KRYPTIKD" stop sealed --now >/dev/null 2>&1 # The launcher closes the volume once the zone's pid 1 is gone, not - # before stop returns: up to 10 s. + # before stop returns: up to 30 s on a slow host. f4c_closed=0 - for _ in $(seq 50); do + for _ in $(seq 150); do [[ "$("$KRYPTIKD" volume status sealed --zones "$ZONES" 2>/dev/null)" == *"(closed)"* ]] && { f4c_closed=1; break; } sleep 0.2 done @@ -732,15 +732,16 @@ if (( PRIVILEGED == 1 )) && command -v cryptsetup >/dev/null 2>&1 && [[ -e /dev/ else fail "F6a volume destroy with the zone running: exit $rc, $(printf '%s' "$out" | tr '\n' '|' | cut -c1-200)" fi - "$KRYPTIKD" stop sealed --now >/dev/null 2>&1 - for _ in $(seq 50); do [[ -e /dev/mapper/kryptik-zone-sealed ]] || break; sleep 0.2; done + stop_out="$("$KRYPTIKD" stop sealed --now 2>&1)" + # The volume closes after pid 1 is gone: up to 30 s on a slow host. + for _ in $(seq 150); do [[ -e /dev/mapper/kryptik-zone-sealed ]] || break; sleep 0.2; done vol_file="$("$KRYPTIKD" volume status sealed --zones "$ZONES" 2>/dev/null | sed -n 's/^container \([^ ]*\).*/\1/p')" out="$("$KRYPTIKD" volume destroy sealed --zones "$ZONES" 2>&1)"; rc=$? if (( rc == 0 )) && [[ -n "$vol_file" && ! -e "$vol_file" ]] \ && [[ "$("$KRYPTIKD" volume status sealed --zones "$ZONES" 2>/dev/null)" == *"ABSENT"* ]]; then pass "F6b volume destroy deletes the stopped zone's container, and status says ABSENT" else - fail "F6b volume destroy: exit $rc, container ${vol_file:-unknown} $([[ -e "$vol_file" ]] && echo "still there" || echo gone): $(printf '%s' "$out" | tr '\n' '|' | cut -c1-200)" + fail "F6b volume destroy: exit $rc, container ${vol_file:-unknown} $([[ -e "$vol_file" ]] && echo "still there" || echo gone): $(printf '%s' "$out" | tr '\n' '|' | cut -c1-200); stop said: $(printf '%s' "$stop_out" | tr '\n' '|' | cut -c1-120)" fi out="$("$KRYPTIKD" volume destroy sealed --zones "$ZONES" 2>&1)"; rc=$? if (( rc != 0 )) && [[ "$out" == *"no volume at"* ]]; then