mirror of
https://github.com/hashicorp/vault.git
synced 2025-08-13 10:07:01 +02:00
Bump validity period check to satisfy CircleCI (#17740)
* Bump validity period check to satisfy CircleCI Signed-off-by: Alexander Scheel <alex.scheel@hashicorp.com> * Update builtin/logical/pki/backend_test.go Signed-off-by: Alexander Scheel <alex.scheel@hashicorp.com>
This commit is contained in:
parent
c782b6678c
commit
f11f529f72
@ -466,8 +466,13 @@ func checkCertsAndPrivateKey(keyType string, key crypto.Signer, usage x509.KeyUs
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if math.Abs(float64(time.Now().Add(validity).Unix()-cert.NotAfter.Unix())) > 20 {
|
// TODO: We incremented 20->25 due to CircleCI execution
|
||||||
return nil, fmt.Errorf("certificate validity end: %s; expected within 20 seconds of %s", cert.NotAfter.Format(time.RFC3339), time.Now().Add(validity).Format(time.RFC3339))
|
// being slow and pausing this test. We might consider recording the
|
||||||
|
// actual issuance time of the cert and calculating the expected
|
||||||
|
// validity period +/- fuzz, but that'd require recording and passing
|
||||||
|
// through more information.
|
||||||
|
if math.Abs(float64(time.Now().Add(validity).Unix()-cert.NotAfter.Unix())) > 25 {
|
||||||
|
return nil, fmt.Errorf("certificate validity end: %s; expected within 25 seconds of %s", cert.NotAfter.Format(time.RFC3339), time.Now().Add(validity).Format(time.RFC3339))
|
||||||
}
|
}
|
||||||
|
|
||||||
return parsedCertBundle, nil
|
return parsedCertBundle, nil
|
||||||
|
Loading…
Reference in New Issue
Block a user