Use stable verified Notarius reference snapshots

This commit is contained in:
2026-09-16 17:53:29 +00:00
parent 5202f16972
commit e13d87a077
8 changed files with 469 additions and 101 deletions

View File

@@ -182,12 +182,16 @@ func TestExtractLifecyclePrepareBindsVerifiedReferenceSnapshots(t *testing.T) {
for index, expected := range want {
binding := request.References[index]
canonical := filepath.Join(paths.InputsDir, expected.filename)
snapshot := filepath.Join(
artifacts.SessionRunNotariusReferencesDirForCampaign(
cfg.Pipeline.Workspace.Root, cfg.Session.Campaign, cfg.Session.SessionID, loaded.RunID,
),
expected.filename,
descriptor, ok := artifactpolicy.DescribePreparedInputSource(expected.sourceID)
if !ok {
t.Fatalf("DescribePreparedInputSource(%q) ok = false", expected.sourceID)
}
snapshot, err := artifacts.SessionNotariusReferenceSnapshotPath(
paths, lifecycleInputChecksum(t, loaded, descriptor.ManifestKind), expected.filename,
)
if err != nil {
t.Fatalf("SessionNotariusReferenceSnapshotPath(%q) error = %v", expected.sourceID, err)
}
if binding.Selector != expected.selector || binding.Path != snapshot || binding.Path == canonical || binding.Path == originalPaths[expected.sourceID] {
t.Fatalf("reference[%d] = %#v, want selector %q snapshot %q and not prepared/source paths", index, binding, expected.selector, snapshot)
}