Skip to content

Commit 1cba417

Browse files
committed
fix: test
Signed-off-by: Junjie Gao <[email protected]>
1 parent c14721f commit 1cba417

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

plugin/testdata/plugins/foo/notation-foo

100644100755
File mode changed.

verifier/trustpolicy/oci_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ func TestValidateInvalidPolicyDocument(t *testing.T) {
220220
policyDoc = dummyOCIPolicyDocument()
221221
policyDoc.TrustPolicies[0].TrustedIdentities = []string{"x509.subject"}
222222
err = policyDoc.Validate()
223-
if err == nil || err.Error() != "oci trust policy: trust policy statement \"test-statement-name\" has trusted identity \"x509.subject\" missing separator" {
223+
if err == nil || err.Error() != "oci trust policy: trust policy statement \"test-statement-name\" has trusted identity \"x509.subject\" missing separator. The required format is <trustedIdentityType>:<trustedIdentityValues>" {
224224
t.Fatalf("policy statement with trusted identity missing separator should return error")
225225
}
226226

verifier/trustpolicy/trustpolicy_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ func TestValidatePolicyCore(t *testing.T) {
104104
t.Errorf("expected error '%s' but not found", expectedErr)
105105
}
106106

107-
expectedErr = "trust policy statement \"test-statement-name\" has trusted identity \"x509.subject\" missing separator"
107+
expectedErr = "trust policy statement \"test-statement-name\" has trusted identity \"x509.subject\" missing separator. The required format is <trustedIdentityType>:<trustedIdentityValues>"
108108
if err := validatePolicyCore(policyName, sigVerification, []string{"ca:valid-ts"}, []string{"x509.subject"}); err == nil || err.Error() != expectedErr {
109109
t.Errorf("expected error '%s' but not found", expectedErr)
110110
}
@@ -152,7 +152,7 @@ func TestValidateTrustedIdentities(t *testing.T) {
152152

153153
// No trusted identity prefix throws error
154154
err = validateTrustedIdentities("test-statement-name", []string{"C=US, ST=WA, O=wabbit-network.io, OU=org1"})
155-
if err == nil || err.Error() != "trust policy statement \"test-statement-name\" has trusted identity \"C=US, ST=WA, O=wabbit-network.io, OU=org1\" missing separator" {
155+
if err == nil || err.Error() != "trust policy statement \"test-statement-name\" has trusted identity \"C=US, ST=WA, O=wabbit-network.io, OU=org1\" missing separator. The required format is <trustedIdentityType>:<trustedIdentityValues>" {
156156
t.Fatalf("trusted identity without separator should return error")
157157
}
158158

verifier/verifier_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ func assertNotationVerification(t *testing.T, scheme signature.SigningScheme) {
270270
for _, level := range verificationLevels {
271271
policyDocument := dummyOCIPolicyDocument()
272272
policyDocument.TrustPolicies[0].TrustedIdentities = []string{"x509.subject"}
273-
expectedErr := fmt.Errorf("trust policy statement \"test-statement-name\" has trusted identity \"x509.subject\" missing separator")
273+
expectedErr := fmt.Errorf("trust policy statement \"test-statement-name\" has trusted identity \"x509.subject\" missing separator. The required format is <trustedIdentityType>:<trustedIdentityValues>")
274274
testCases = append(testCases, testCase{
275275
signatureBlob: validSigEnv,
276276
verificationType: trustpolicy.TypeAuthenticity,

0 commit comments

Comments
 (0)