From 029b13b000ca52f4d483b9c5be8d66d1b67f86d4 Mon Sep 17 00:00:00 2001 From: Joshua Hoblitt Date: Thu, 25 Jun 2026 12:25:25 -0700 Subject: [PATCH] ci: provision extra disks when the runner starts with none find_extra_block_devs reads the runner's current extra disks with `lsblk ... | egrep -v "($boot_dev|loop|nbd)"` to decide how many more to provision. When the runner has no extra disk, that egrep matches nothing and exits 1; under the script's `set -eo pipefail` the assignment aborts the function before it ever calls create_extra_disk, so callers get zero disks and fail with "expected >= N extra disks, found 0" (or a bare /dev/ path) on those runners. Guard that first read with `|| true` (as the adjacent device-count line already is) so an empty result means "no extra disks yet" and the provisioning path runs. The second read, after create_extra_disk, is left strict on purpose: if provisioning produced no disk, egrep's non-zero exit should abort there rather than silently return nothing. Signed-off-by: Joshua Hoblitt --- tests/scripts/github-action-helper.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/scripts/github-action-helper.sh b/tests/scripts/github-action-helper.sh index da9d6d1e5..80cd2aa29 100755 --- a/tests/scripts/github-action-helper.sh +++ b/tests/scripts/github-action-helper.sh @@ -103,7 +103,7 @@ function find_extra_block_devs() { boot_dev="$(sudo lsblk --noheading --list --output MOUNTPOINT,PKNAME | grep boot | awk '{print $2}')" local devs count # --nodeps ignores partitions - devs="$(sudo lsblk --noheading --list --nodeps --output KNAME | egrep -v "($boot_dev|loop|nbd)")" + devs="$(sudo lsblk --noheading --list --nodeps --output KNAME | egrep -v "($boot_dev|loop|nbd)" || true)" count="$(echo "$devs" | grep -c . || true)" if [ "$count" -lt "$min_count" ]; then create_extra_disk "$((min_count - count))" >/dev/stderr