|
|
|
@@ -39,6 +39,29 @@ load test_helper
|
|
|
|
|
assert_contains "$output" "dry-run (--check)"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@test "install.sh fallback walk syncs TARBALL to fallback version (REQ-132 regression)" {
|
|
|
|
|
# Regression guard: when the fallback walk reassigns VERSION, the
|
|
|
|
|
# TARBALL variable must be recomputed too. v0.14.2 is a release with
|
|
|
|
|
# no binary asset; the installer must walk back to an earlier release.
|
|
|
|
|
# The dry-run "would install" line must reference the SAME fallback
|
|
|
|
|
# version as the "falling back to" line — not the stale pinned one.
|
|
|
|
|
# Before the fix, TARBALL stayed at the pinned v0.14.2 name while
|
|
|
|
|
# VERSION became the fallback, causing grep|sha256sum to see no
|
|
|
|
|
# matching checksum line and REQ-132 to refuse install.
|
|
|
|
|
skip_if_no_network
|
|
|
|
|
run timeout 60 "$SCRIPTS_DIR/install.sh" --check --version v0.14.2
|
|
|
|
|
assert_status 0 "$status"
|
|
|
|
|
assert_contains "$output" "falling back"
|
|
|
|
|
# Capture the fallback version from the "falling back to vX.Y.Z" line.
|
|
|
|
|
fb_version="$(printf '%s\n' "$output" | sed -n 's/.*falling back to \(v[0-9][0-9.]*\).*/\1/p' | head -1)"
|
|
|
|
|
[ -n "$fb_version" ] || { echo "could not parse fallback version from output: $output" >&2; return 1; }
|
|
|
|
|
# The dry-run "would install" line must use the fallback version,
|
|
|
|
|
# proving VERSION and TARBALL are in sync (not the stale pinned v0.14.2).
|
|
|
|
|
assert_contains "$output" "would install: orca ${fb_version}"
|
|
|
|
|
# And it must NOT reference the stale pinned version in the install line.
|
|
|
|
|
assert_not_contains "$output" "would install: orca v0.14.2"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@test "install.sh rejects unknown arguments" {
|
|
|
|
|
run "$SCRIPTS_DIR/install.sh" --bogus-flag
|
|
|
|
|
[ "$status" -ne 0 ]
|
|
|
|
|