From 71f522ae44175ae2b6bc443c1629d6aa6e791040 Mon Sep 17 00:00:00 2001 From: Junjie Gao Date: Mon, 30 Dec 2024 07:43:49 +0000 Subject: [PATCH] fix: E2E test Signed-off-by: Junjie Gao --- test/e2e/suite/command/blob/policy.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/e2e/suite/command/blob/policy.go b/test/e2e/suite/command/blob/policy.go index 68af357c9..f60b46dfd 100644 --- a/test/e2e/suite/command/blob/policy.go +++ b/test/e2e/suite/command/blob/policy.go @@ -60,8 +60,8 @@ var _ = Describe("blob trust policy maintainer", func() { content, err := os.ReadFile(filepath.Join(NotationE2ETrustPolicyDir, policyName)) Expect(err).NotTo(HaveOccurred()) Host(Opts(AddBlobTrustPolicyOption(policyName)), func(notation *utils.ExecOpts, artifact *Artifact, vhost *utils.VirtualHost) { - notation.Exec("blob", "policy", "show"). - MatchErrKeyWords("existing blob trust policy configuration is invalid"). + notation.ExpectFailure().Exec("blob", "policy", "show"). + MatchErrKeyWords("existing blob trust policy file is invalid"). MatchContent(string(content)) }) }) @@ -190,7 +190,7 @@ var _ = Describe("blob trust policy maintainer", func() { Host(Opts(AddBlobTrustPolicyOption("invalid_format_trustpolicy.json")), func(notation *utils.ExecOpts, artifact *Artifact, vhost *utils.VirtualHost) { policyFileName := "skip_trustpolicy.json" notation.Exec("blob", "policy", "import", filepath.Join(NotationE2ETrustPolicyDir, policyFileName)).MatchKeyWords(). - MatchKeyWords("Blob trust policy configuration imported successfully.") + MatchKeyWords("Successfully imported blob trust policy file.") // validate content, err := os.ReadFile(filepath.Join(NotationE2ETrustPolicyDir, policyFileName)) Expect(err).NotTo(HaveOccurred()) @@ -202,7 +202,7 @@ var _ = Describe("blob trust policy maintainer", func() { Host(opts, func(notation *utils.ExecOpts, artifact *Artifact, vhost *utils.VirtualHost) { policyFileName := "skip_trustpolicy.json" notation.WithInput(strings.NewReader("Y\n")).Exec("blob", "policy", "import", filepath.Join(NotationE2ETrustPolicyDir, policyFileName)). - MatchKeyWords("Blob trust policy configuration imported successfully.") + MatchKeyWords("Successfully imported blob trust policy file.") // validate content, err := os.ReadFile(filepath.Join(NotationE2ETrustPolicyDir, policyFileName)) Expect(err).NotTo(HaveOccurred()) @@ -214,7 +214,7 @@ var _ = Describe("blob trust policy maintainer", func() { Host(opts, func(notation *utils.ExecOpts, artifact *Artifact, vhost *utils.VirtualHost) { policyFileName := "skip_trustpolicy.json" notation.Exec("blob", "policy", "import", filepath.Join(NotationE2ETrustPolicyDir, policyFileName), "--force"). - MatchKeyWords("Blob trust policy configuration imported successfully.") + MatchKeyWords("Successfully imported blob trust policy file.") // validate content, err := os.ReadFile(filepath.Join(NotationE2ETrustPolicyDir, policyFileName)) Expect(err).NotTo(HaveOccurred())