Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
Signed-off-by: Patrick Zheng <[email protected]>
  • Loading branch information
Two-Hearts committed Jan 10, 2025
1 parent 26e6982 commit a86854f
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion test/e2e/suite/command/blob/sign.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ var _ = Describe("notation blob sign", func() {

It("with signature directory", func() {
HostWithBlob(BaseOptions(), func(notation *utils.ExecOpts, blobPath string, vhost *utils.VirtualHost) {
notation.Exec("blob", "sign", "--force", "--signature-directory", vhost.AbsolutePath(), blobPath).
notation.Exec("blob", "sign", "--signature-directory", vhost.AbsolutePath(), blobPath).
MatchKeyWords(SignSuccessfully).
MatchKeyWords(fmt.Sprintf("Signature file written to %s", filepath.Join(vhost.AbsolutePath("blobFile.jws.sig"))))
})
Expand All @@ -96,6 +96,19 @@ var _ = Describe("notation blob sign", func() {
})
})

It("with --force flag", func() {
HostWithBlob(BaseOptions(), func(notation *utils.ExecOpts, blobPath string, vhost *utils.VirtualHost) {
sigDir := vhost.AbsolutePath()
notation.Exec("blob", "sign", "--signature-directory", sigDir, blobPath).
MatchKeyWords(SignSuccessfully).
MatchKeyWords(fmt.Sprintf("Signature file written to %s", filepath.Join(vhost.AbsolutePath("blobFile.jws.sig"))))

notation.Exec("blob", "sign", "--force", "--signature-directory", sigDir, blobPath).
MatchKeyWords(SignSuccessfully).
MatchKeyWords(fmt.Sprintf("Signature file written to %s", filepath.Join(vhost.AbsolutePath("blobFile.jws.sig"))))
})
})

// Failure cases
It("with undefined signature format", func() {
HostWithBlob(BaseOptions(), func(notation *utils.ExecOpts, blobPath string, vhost *utils.VirtualHost) {
Expand Down

0 comments on commit a86854f

Please sign in to comment.