Skip to content

Commit

Permalink
fix e2e test
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 5cf2aaa commit 5318f7d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions test/e2e/suite/command/blob/sign.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,12 +146,13 @@ var _ = Describe("notation blob sign", Serial, func() {

It("with no permission to write the signature file", func() {
HostWithBlob(BaseOptions(), func(notation *utils.ExecOpts, blobPath string, vhost *utils.VirtualHost) {
if err := os.MkdirAll(vhost.AbsolutePath(), 0000); err != nil {
sigDir := filepath.Join(vhost.AbsolutePath(), "signature")
if err := os.MkdirAll(sigDir, 0000); err != nil {
Fail(err.Error())
}
defer os.Chmod(vhost.AbsolutePath(), 0700)
defer os.Chmod(sigDir, 0700)

notation.ExpectFailure().Exec("blob", "sign", "--signature-directory", vhost.AbsolutePath(), blobPath).
notation.ExpectFailure().Exec("blob", "sign", "--signature-directory", sigDir, blobPath).
MatchErrKeyWords("permission denied")
})
})
Expand Down

0 comments on commit 5318f7d

Please sign in to comment.