Skip to content

Commit

Permalink
fix: test cases
Browse files Browse the repository at this point in the history
Signed-off-by: Junjie Gao <[email protected]>
  • Loading branch information
JeyJeyGao committed Nov 12, 2024
1 parent 169aead commit 5ee8970
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cmd/notation/verify.go
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ func getVerifier(ctx context.Context) (notation.Verifier, error) {
fileCache, err := crl.NewFileCache(cacheRoot)
if err != nil {
// discard NewFileCache error directly as cache is not critical
fmt.Print("Warning:", err)
fmt.Printf("Warning: %v\n", err)
} else {
crlFetcher.Cache = &clicrl.CacheWithLog{
Cache: fileCache,
Expand Down
6 changes: 4 additions & 2 deletions test/e2e/suite/scenario/crl.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,9 @@ var _ = Describe("notation CRL revocation check", Serial, func() {
notation.Exec("verify", artifact.ReferenceWithDigest(), "-d").
MatchKeyWords(
VerifySuccessfully,
"Warning: failed to create crl file cache",
).
MatchErrKeyWords(
"failed to create file cache",
"OCSP check failed with unknown error and fallback to CRL check for certificate #2",
`"GET" "http://localhost:10086/intermediate.crl"`,
`"GET" "http://localhost:10086/leaf.crl"`,
Expand All @@ -180,9 +180,11 @@ var _ = Describe("notation CRL revocation check", Serial, func() {

// verify without cache
notation.ExpectFailure().Exec("verify", artifact.ReferenceWithDigest(), "-d").
MatchKeyWords(
"Warning: failed to create crl file cache",
).
MatchErrKeyWords(
VerifyFailed,
"failed to create file cache",
"OCSP check failed with unknown error and fallback to CRL check for certificate #2",
`"GET" "http://localhost:10086/intermediate.crl"`,
`"GET" "http://localhost:10086/leaf.crl"`,
Expand Down

0 comments on commit 5ee8970

Please sign in to comment.