Documentation
¶
Overview ¶
Package edgetest stages what an edge-channel upgrade touches, for tests (Task 20376): a device installed as `cloop executor agent install` would install it — unit, drop-ins, remote-upgrade helper, binary — under a temp directory, and an edge release served over HTTP whose assets a stand-in cosign (internal/cosigntest) will accept or refuse by signer.
The binaries are shell scripts that answer `cloop version` the way a real build does, so the installer's identify-before-replace check runs for real.
Index ¶
- Constants
- func FakeCloop(version string, protocol int, marker string) string
- func FakeCloopAt(version string, protocol int, commit string, sequence int, marker string) string
- func Marker(body string) string
- func Recorder() (*install.Installer, func() []string)
- func TarGz(t testing.TB, binary string) []byte
- type Build
- type Device
- type Release
Constants ¶
const DefaultSequence = 4000
DefaultSequence is the place on main Publish gives a build.
Variables ¶
This section is empty.
Functions ¶
func FakeCloop ¶
FakeCloop is a stand-in cloop binary reporting version and protocol, with a marker a test can read back to tell which one is installed. It reports no commit and no sequence: a build from before builds were stamped with their place on main (Task 20380).
func FakeCloopAt ¶
FakeCloopAt is FakeCloop stamped with a commit and its place on main, as scripts/build-release.sh stamps every build since Task 20380. A zero sequence and an empty commit are left out of the report, as a real build leaves them out.
Types ¶
type Build ¶
type Build struct {
Commit string
SAN string
Protocol int
// Sequence is the commit's place on main. Zero publishes a build from
// before Task 20380: a schema-1 manifest, and a binary carrying none.
Sequence int
Marker string
// Binary, when set, is the archived binary instead of the stand-in the
// manifest describes — a validly signed manifest paired with the bytes
// of another build.
Binary string
}
Build is one edge build to publish.
type Device ¶
Device is a staged install.
func NewDevice ¶
func NewDevice(t testing.TB, installedVersion string, protocol int, channel provenance.Channel) *Device
NewDevice stages an install running installedVersion at protocol, on channel, with the packet-filter grant and the remote-upgrade helper. Its binary carries no sequence; InstallBuild replaces it with one that does.
func (*Device) InstallBuild ¶
InstallBuild puts a binary in place as if the device ran body — for a device whose installed build is stamped (FakeCloopAt).
type Release ¶
type Release struct {
URL string
// contains filtered or unexported fields
}
Release is a stand-in for the edge release's download endpoint.
func (*Release) Options ¶
Options are the staging options that fetch from this release and verify with the stand-in cosign.
func (*Release) Publish ¶
func (r *Release) Publish(t testing.TB, commit, san string, protocol int, marker string) upgrade.EdgeManifest
Publish puts commit's build up, every asset signed by san, its binary a FakeCloopAt reporting the edge version at protocol, stamped with commit and DefaultSequence, with the given marker.
func (*Release) PublishBuild ¶
PublishBuild puts b up, every asset signed by b.SAN.