forked from TrueCloudLab/certificates
add acme order unit tests
This commit is contained in:
parent
c0a9f24798
commit
bdf4c0f836
2 changed files with 358 additions and 1592 deletions
|
@ -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
|
||||||
|
|
1943
acme/order_test.go
1943
acme/order_test.go
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue