mirror of
https://github.com/piabrota/mu.git
synced 2026-11-07 06:15:59 -10:00
ygg-smoke-runtime.sh: the newest stack image without SIGPIPE (found in gallery-runtime T30) (#80)
stack() took the newest localhost/ygg-stack-<realm> image with `podman images ... | head -n 1`. With several stack images, head closed the pipe while podman still wrote, podman died of SIGPIPE, and under pipefail the command substitution failed: set -e stopped the script with 141 before its first line. The founder's T30 smoke hit it twice after `ygg sandbox build` added images. sed -n 1p reads every line. The test's stand-in podman lists several images and dies with 141 when its reader has gone; the new case runs without --api-image and --web-image and checks the newest image of each realm is used. Co-authored-by: Bruno Guilhermo de Barros Valério <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
This commit is contained in:
2 files changed
+17
-2
No files matched your search
@@ -51,7 +51,12 @@ echo "podman loaded=${FAKE_ENGINE_LOADED:-0} $*" >>"$FAKE_CALLS"
|
||||
a="$*"
|
||||
case "$1" in
|
||||
image) [ "$FAKE_NO_IMAGE" = "${3:-}" ] && exit 1; exit 0 ;;
|
||||
images) echo "localhost/ygg-stack-x:abc" ;;
|
||||
images)
|
||||
# The real engine lists every stack image, newest first, and dies of SIGPIPE when the reader has gone.
|
||||
if [ "${FAKE_MANY_IMAGES:-}" = 1 ]; then
|
||||
echo "localhost/ygg-stack-${3#reference=localhost/ygg-stack-}:newest"; sleep 0.3
|
||||
for i in 1 2 3 4 5 6 7 8; do echo "localhost/ygg-stack-x:old$i" 2>/dev/null || exit 141; done
|
||||
else echo "localhost/ygg-stack-x:abc"; fi ;;
|
||||
inspect) echo "10.89.0.7" ;;
|
||||
logs) echo "start: weed stopped" ;;
|
||||
run)
|
||||
@@ -147,6 +152,14 @@ check "the key is read as app" bash -c "grep -Eq 'exec --user app smoke-runtime-
|
||||
check "signed requests send the unsigned-payload header" inlog "x-amz-content-sha256: UNSIGNED-PAYLOAD"
|
||||
check "no-route has a positive control that connects" bash -c "grep -Eq 'exec smoke-runtime-product-[0-9]+ timeout 5 bash -c .*/dev/tcp/10.89.0.7/3000' '$T/calls'"
|
||||
|
||||
# The stack images found by name: the engine lists several, and the newest is taken (the reader must not close the
|
||||
# pipe early: under pipefail, podman's SIGPIPE would stop the script before its first line).
|
||||
: >"$T/calls"; : >"$T/store"
|
||||
FAKE_MANY_IMAGES=1 run "$SCRIPT" --folder "$D" --yggdrasil "$Y" --image task:img
|
||||
check "with several stack images and no --api-image, a healthy run exits 0" test "$rc" = 0
|
||||
check "... and the api release is built in the newest helheim-go image" inlog "localhost/ygg-stack-helheim-go:newest sh /src/release.sh"
|
||||
check "... and the web release in the newest midgard-react image" inlog "localhost/ygg-stack-midgard-react:newest sh /src/release.sh"
|
||||
|
||||
# One thing broken at a time.
|
||||
FAKE_UNSIGNED_CODE=200 runit; check "an unsigned PUT that is accepted fails" bash -c "[ $rc = 1 ] && grep -q 'FAIL unsigned' '$T/out'"
|
||||
FAKE_PUT_CODE=500 runit; check "a signed PUT that fails, fails" bash -c "[ $rc = 1 ] && grep -q 'FAIL signed' '$T/out'"
|
||||
|
||||
@@ -57,7 +57,9 @@ if [ "${YGG_ENGINE_CHECK:-1}" = 1 ]; then
|
||||
eval "$engine_env"
|
||||
fi
|
||||
command -v podman >/dev/null 2>&1 || fail "podman is not installed"
|
||||
stack() { podman images --filter "reference=localhost/ygg-stack-$1" --format '{{.Repository}}:{{.Tag}}' 2>/dev/null | head -n 1; }
|
||||
# The newest image is the first line. sed reads every line: head would close the pipe early, and podman's SIGPIPE
|
||||
# would then fail the pipeline (pipefail) and stop the script with 141 and no message.
|
||||
stack() { podman images --filter "reference=localhost/ygg-stack-$1" --format '{{.Repository}}:{{.Tag}}' 2>/dev/null | sed -n 1p; }
|
||||
[ -n "$api_image" ] || api_image="$(stack helheim-go)"
|
||||
[ -n "$web_image" ] || web_image="$(stack midgard-react)"
|
||||
[ -n "$api_image" ] || fail "no sandbox image of helheim-go; build it with 'ygg sandbox build --realm helheim-go' or pass --api-image"
|
||||
|
||||
Reference in new issue
Block a user