Skip to content
Closed
Show file tree
Hide file tree
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: 6 additions & 0 deletions .github/workflows/branch-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -594,6 +594,12 @@ jobs:
- name: Test
run: mise run test:python

- name: Test installer shell script
run: |
apt-get update
apt-get install -y --no-install-recommends gawk
bash tasks/scripts/test-install-sh.sh

- name: Test local gateway configuration helpers
run: |
bash tasks/scripts/test-gateway-pull-policy.sh
Expand Down
6 changes: 3 additions & 3 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -794,15 +794,15 @@ find_rpm_asset() {
case "$_package" in
openshell)
_dev_name="openshell-dev-${_arch}.rpm"
_fallback_re="^openshell-[0-9].*\\.${_arch}\\.rpm$"
_fallback_re="^openshell-[0-9].*[.]${_arch}[.]rpm$"
;;
openshell-gateway)
_dev_name="openshell-gateway-dev-${_arch}.rpm"
_fallback_re="^openshell-gateway-[0-9].*\\.${_arch}\\.rpm$"
_fallback_re="^openshell-gateway-[0-9].*[.]${_arch}[.]rpm$"
;;
openshell-prover)
_dev_name="openshell-prover-dev-${_arch}.rpm"
_fallback_re="^openshell-prover-[0-9].*\\.${_arch}\\.rpm$"
_fallback_re="^openshell-prover-[0-9].*[.]${_arch}[.]rpm$"
;;
*)
error "unknown RPM package selector: ${_package}"
Expand Down
52 changes: 52 additions & 0 deletions tasks/scripts/test-install-sh.sh
Original file line number Diff line number Diff line change
Expand Up @@ -872,6 +872,58 @@ if [ "$(find_rpm_asset "${tmpdir}/checksums" x86_64 openshell-prover)" != "opens
exit 1
fi

cat >"${tmpdir}/rpm-fallback-checksums" <<'EOF'
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa openshell-1.2.3-x86_64.rpm
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb openshell-1.2.3.x86_64-rpm
cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc openshell-1.2.3.x86_64.rpm
dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd openshell-gateway-1.2.3-x86_64.rpm
eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee openshell-gateway-1.2.3.x86_64-rpm
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff openshell-gateway-1.2.3.x86_64.rpm
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa openshell-prover-1.2.3-x86_64.rpm
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb openshell-prover-1.2.3.x86_64-rpm
cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc openshell-prover-1.2.3.x86_64.rpm
EOF

assert_rpm_fallback() {
local awk_bin=$1
local package=$2
local expected=$3
local actual

if ! actual="$(
awk() {
if [ "$awk_bin" = busybox ]; then
busybox awk "$@"
else
command "$awk_bin" "$@"
fi
}
find_rpm_asset "${tmpdir}/rpm-fallback-checksums" x86_64 "$package"
)" 2>"$err"; then
echo "FAIL: ${awk_bin} RPM ${package} fallback failed" >&2
cat "$err" >&2
exit 1
fi
if [ -s "$err" ]; then
echo "FAIL: ${awk_bin} RPM ${package} fallback wrote to stderr" >&2
cat "$err" >&2
exit 1
fi
if [ "$actual" != "$expected" ]; then
echo "FAIL: ${awk_bin} RPM ${package} fallback: expected ${expected}, got ${actual}" >&2
exit 1
fi
}

for awk_bin in awk gawk mawk busybox; do
if ! command -v "$awk_bin" >/dev/null 2>&1; then
continue
fi
assert_rpm_fallback "$awk_bin" openshell openshell-1.2.3.x86_64.rpm
assert_rpm_fallback "$awk_bin" openshell-gateway openshell-gateway-1.2.3.x86_64.rpm
assert_rpm_fallback "$awk_bin" openshell-prover openshell-prover-1.2.3.x86_64.rpm
done

mock_gh_log="${tmpdir}/gh.log"
PLATFORM=linux
linux_package_method() {
Expand Down
Loading