Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions tests/install-phone-initramfs
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,9 @@ done
# still be live).
held() { # name fd: an install of six waiting at the codename, which fd gives
mkfifo "$t/$1.fifo" && eval "exec $2<>\"\$t/$1.fifo\""
HOLD=$t/$1.fifo OUT=$t/$1.out install six 7>&- 8>&- &
# Its output is in OUT; the job's own shell would print bash's "Killed"
# notice for the one killed below, which in a passing log reads as a failure
HOLD=$t/$1.fifo OUT=$t/$1.out install six 7>&- 8>&- 2>/dev/null &
for _ in $(seq 600); do grep -c "Type the phone's codename" "$t/$1.out" >/dev/null 2>&1 && return; sleep 0.1; done
cat "$t/$1.out"; fail "an install waits at the codename prompt"
}
Expand All @@ -225,7 +227,7 @@ live=$!
held killed 8
kill -KILL "$(cat "$t/killed.out.pid")"
exec 8>&-
{ wait $!; } 2>/dev/null || true
wait $! || true
both=$(verify_dirs)
[[ $(wc -w <<<"$both") == 3 ]] || fail "a second install, killed, leaves its directory and the waiting one's (got: $both)"
install six --verify-only || { cat "$t/out"; fail "--verify-only passes while an install waits"; }
Expand Down