add acme order unit tests

This commit is contained in:
max furman 2021-03-24 20:07:21 -07:00
parent c0a9f24798
commit bdf4c0f836
2 changed files with 358 additions and 1592 deletions

View file

@ -204,12 +204,15 @@ func (o *Order) Finalize(ctx context.Context, db DB, csr *x509.CertificateReques
Intermediates: certChain[1:], Intermediates: certChain[1:],
} }
if err := db.CreateCertificate(ctx, cert); err != nil { if err := db.CreateCertificate(ctx, cert); err != nil {
return err return WrapErrorISE(err, "error creating certificate for order %s", o.ID)
} }
o.CertificateID = cert.ID o.CertificateID = cert.ID
o.Status = StatusValid o.Status = StatusValid
return db.UpdateOrder(ctx, o) if err = db.UpdateOrder(ctx, o); err != nil {
return WrapErrorISE(err, "error updating order %s", o.ID)
}
return nil
} }
// uniqueSortedLowerNames returns the set of all unique names in the input after all // uniqueSortedLowerNames returns the set of all unique names in the input after all

File diff suppressed because it is too large Load diff