Skip to content

Commit df5c37b

Browse files
author
Daniel
committed
review: fix local signer TestLint unit test.
The upstream `zlint` project removed the `w_serial_number_low_entropy` lint and so the `TestLint` function needed to be updated accordingly.
1 parent aa34253 commit df5c37b

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

signer/local/local_test.go

+3-7
Original file line numberDiff line numberDiff line change
@@ -1522,8 +1522,6 @@ func TestLint(t *testing.T) {
15221522
// On purpose this template will trip the following lints:
15231523
// 1. e_sub_cert_aia_does_not_contain_ocsp_url because there is no OCSP URL.
15241524
// 2. e_dnsname_not_valid_tld because `.cert` is not a real TLD
1525-
// 3. w_serial_number_low_entropy because '1338' is a static constant <8
1526-
// bytes in length.
15271525
serial = big.NewInt(1338)
15281526
jankyTemplate.SerialNumber = serial
15291527
jankyTemplate.Subject.CommonName = "www.janky.cert"
@@ -1554,11 +1552,10 @@ func TestLint(t *testing.T) {
15541552
name: "lint results above err level",
15551553
signer: lintSigner,
15561554
lintErrLevel: lints.Notice,
1557-
expectedErr: errors.New("pre-issuance linting found 3 error results"),
1555+
expectedErr: errors.New("pre-issuance linting found 2 error results"),
15581556
expectedErrResults: map[string]lints.LintResult{
15591557
"e_sub_cert_aia_does_not_contain_ocsp_url": lints.LintResult{Status: 6},
15601558
"e_dnsname_not_valid_tld": lints.LintResult{Status: 6},
1561-
"w_serial_number_low_entropy": lints.LintResult{Status: 5},
15621559
},
15631560
},
15641561
{
@@ -1576,12 +1573,11 @@ func TestLint(t *testing.T) {
15761573
signer: lintSigner,
15771574
lintErrLevel: lints.Notice,
15781575
ignoredLintMap: map[string]bool{
1579-
"w_serial_number_low_entropy": true,
1576+
"e_dnsname_not_valid_tld": true,
15801577
},
1581-
expectedErr: errors.New("pre-issuance linting found 2 error results"),
1578+
expectedErr: errors.New("pre-issuance linting found 1 error results"),
15821579
expectedErrResults: map[string]lints.LintResult{
15831580
"e_sub_cert_aia_does_not_contain_ocsp_url": lints.LintResult{Status: 6},
1584-
"e_dnsname_not_valid_tld": lints.LintResult{Status: 6},
15851581
},
15861582
},
15871583
}

0 commit comments

Comments
 (0)