Documentation
¶
Overview ¶
Package releasebundletest builds fixture release bundles (a staged Apple/Android artifact directory plus a matching fixture git repo root) shared by internal/releasebundle's own tests and cmd/release-artifact-gate's end-to-end subprocess test. It is a normal, exported package (not a _test.go file) precisely so both can import it without duplicating fixture-construction logic.
Index ¶
- Constants
- func InstallPATHShadowOtool(t testing.TB) string
- func NewBundle(t testing.TB, opts Opts) (bundleDir, repoRoot string)
- func NewRepoRoot(t testing.TB, swiftManifest string) (repoRoot, commit string)
- func ReplaceAppleMacOSLibrary(t testing.TB, bundleDir, libraryPath string)
- func TamperFile(t testing.TB, path string)
- type Opts
Constants ¶
const ( OpenFHEVersion = "v1.5.1" OpenFHECommit = "1306d14f8c26bb6150d3e6ad54f28dfe1007689e" // AppleMACOSDeploymentTarget is the fixture repo's declared macOS // deployment target and the default value NewBundle's Apple staging // manifest records -- both must agree for the zero-value Opts to // build a gate-accepted bundle. AppleMACOSDeploymentTarget = "14.0" ValidSwiftReleaseManifest = `` /* 458-byte string literal not displayed */ )
Variables ¶
This section is empty.
Functions ¶
func InstallPATHShadowOtool ¶
InstallPATHShadowOtool puts a marker-reading fake otool first on PATH. Adversarial subprocess tests use it to prove the production CLI ignores PATH and invokes only the fixed trusted system tool.
func NewBundle ¶
NewBundle builds a complete, self-consistent staged bundle directory (Apple + Android artifact/sbom/provenance/staging-manifest) and a matching fixture repo root, per opts.
func NewRepoRoot ¶
NewRepoRoot creates a real, tiny, committed git repository shaped like enough of ARES-core for releasebundle to read: the two pin files and clients/swift/Package.release.swift. It returns the repo root and the exact commit it committed.
func ReplaceAppleMacOSLibrary ¶
ReplaceAppleMacOSLibrary rewrites the canonical macOS archive member and refreshes the Apple staging manifest hash. It is used only by Darwin-scoped production CLI tests that compile a tiny real Mach-O archive.
func TamperFile ¶
TamperFile appends bytes to the file at path, invalidating any previously-computed hash of it. Exported so mutation tests in other packages (e.g. cmd/release-artifact-gate's end-to-end test) can simulate a corrupted/substituted staged artifact without reaching into this package's internals.
Types ¶
type Opts ¶
type Opts struct {
AppleSlices []string
AndroidABIs []string
AndroidLibsOverride map[string][]string // abi -> lib list; overrides the default full set for that ABI only
AresRevOverride string // if set, used for BOTH platform manifests instead of the fixture repo's real HEAD
AndroidAresRevOverride string // if set, used only for the android manifest (creates a cross-platform mismatch)
AndroidOpenFHEVersionOverride string // if set, used only for the android manifest
SwiftManifestOverride string // if set, replaces Package.release.swift content
AppleMACOSDeploymentTargetOverride string // if set, used instead of AppleMACOSDeploymentTarget in the Apple manifest
AppleMachOMinosOverride string // if set, encoded in the canonical macOS library for the hermetic otool fixture
AppleDecoyFirstMachOMinos string // if set, adds a matching-looking decoy before the canonical macOS library
AppleExtraZipMembers []string // additional member names used by ZIP-name mutation tests
AppleNonUTF8ZipMember string // additional member whose ZIP NonUTF8 flag is set
AppleSymlinkZipMember string // additional member encoded as a symbolic link
OmitCanonicalAppleMacOSLibrary bool // if set, only headers (and any requested decoy) are staged for macos-arm64
DuplicateCanonicalAppleMacOSLibrary bool // if set, writes the exact canonical member twice
}
Opts controls what NewBundle builds, so mutation tests can request a deliberately broken fixture instead of hand-corrupting zip bytes after the fact. The zero value builds a complete, valid, gate-accepted bundle.