Files
Pulse/internal/updates/manager_runtime_arch_test.go
pulse-triage[bot] 18f2dc1f19 fix(updates): select ARM release archive from build variant
ARMv6 and ARMv7 server binaries both report GOARCH=arm. Read the release binary GOARM build setting and fail closed when it does not name a published server archive, rather than offering an ARMv7 update to ARMv6 installations. Cover the architecture mapping and document the installability boundary.

Change-source: pulse-maintainer
2026-09-27 23:29:44 +01:00

26 lines
791 B
Go

package updates
import "testing"
func TestUpdateReleaseArchitectureRequiresMatchingARMVariant(t *testing.T) {
for _, tc := range []struct {
goarch, goarm, want string
ok bool
}{
{goarch: "amd64", want: "amd64", ok: true},
{goarch: "arm64", want: "arm64", ok: true},
{goarch: "386", want: "386", ok: true},
{goarch: "arm", goarm: "6", want: "armv6", ok: true},
{goarch: "arm", goarm: "7", want: "armv7", ok: true},
{goarch: "arm", goarm: "5"},
{goarch: "arm"},
{goarch: "arm", goarm: "unknown"},
{goarch: "riscv64"},
} {
got, ok := updateReleaseArchitecture(tc.goarch, tc.goarm)
if got != tc.want || ok != tc.ok {
t.Errorf("updateReleaseArchitecture(%q, %q) = (%q, %t), want (%q, %t)", tc.goarch, tc.goarm, got, ok, tc.want, tc.ok)
}
}
}