Skip to content

Commit

Permalink
builtin/logical/pki: fix dropped test errors (#12013)
Browse files Browse the repository at this point in the history
  • Loading branch information
alrs committed Jul 8, 2021
1 parent b41665b commit 30ce696
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions builtin/logical/pki/backend_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ func TestPKI_RequireCN(t *testing.T) {
"allow_subdomains": true,
"max_ttl": "2h",
})
if err != nil {
t.Fatal(err)
}

// Issue a cert with require_cn set to true and with common name supplied.
// It should succeed.
Expand All @@ -115,6 +118,9 @@ func TestPKI_RequireCN(t *testing.T) {
"max_ttl": "2h",
"require_cn": false,
})
if err != nil {
t.Fatal(err)
}

// Issue a cert with require_cn set to false and without supplying the
// common name. It should succeed.
Expand Down Expand Up @@ -1412,6 +1418,9 @@ func generateRoleSteps(t *testing.T, useCSRs bool) []logicaltest.TestStep {
}
cert := parsedCertBundle.Certificate
foundOthers, err := getOtherSANsFromX509Extensions(cert.Extensions)
if err != nil {
return err
}
var emptyOthers []otherNameUtf8
var expected []otherNameUtf8 = append(emptyOthers, expectedOthers...)
if diff := deep.Equal(foundOthers, expected); len(diff) > 0 {
Expand Down Expand Up @@ -3007,6 +3016,9 @@ func TestBackend_RevokePlusTidy_Intermediate(t *testing.T) {
_, err = client.Logical().Write("pki/revoke", map[string]interface{}{
"serial_number": intermediateCertSerial,
})
if err != nil {
t.Fatal(err)
}

// Revoke adds a fixed 2s buffer, so we sleep for a bit longer to ensure
// the revocation time is past the current time.
Expand Down

0 comments on commit 30ce696

Please sign in to comment.