...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package tuf
20
21 import (
22 "github.com/sigstore/rekor/pkg/util"
23 "path/filepath"
24 "testing"
25 )
26
27 func TestTufVerifyUpload(t *testing.T) {
28 artifactPath := filepath.Join(t.TempDir(), "timestamp.json")
29 rootPath := filepath.Join(t.TempDir(), "root.json")
30
31 createTufSignedArtifact(t, artifactPath, rootPath)
32
33
34 out := util.RunCli(t, "upload", "--artifact", artifactPath, "--public-key", rootPath, "--type", "tuf")
35 util.OutputContains(t, out, "Created entry at")
36
37 uuid := util.GetUUIDFromUploadOutput(t, out)
38
39 out = util.RunCli(t, "verify", "--artifact", artifactPath, "--public-key", rootPath, "--type", "tuf")
40 util.OutputContains(t, out, "Inclusion Proof")
41
42 out = util.RunCli(t, "search", "--public-key", rootPath, "--pki-format", "tuf")
43 util.OutputContains(t, out, uuid)
44 }
45
View as plain text