MCPcopy Create free account
hub / github.com/cloudflare/cfssl / TestInsertMissingExpiry

Function TestInsertMissingExpiry

api/certadd/insert_test.go:259–281  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

257}
258
259func TestInsertMissingExpiry(t *testing.T) {
260 dbAccessor, err := prepDB()
261 if err != nil {
262 t.Fatal(err)
263 }
264
265 serialNumber, cert, pemBytes, signer, err := makeCertificate()
266
267 if err != nil {
268 t.Fatal(err)
269 }
270
271 resp, body := makeRequest(t, dbAccessor, signer, map[string]interface{}{
272 "serial_number": serialNumber.Text(10),
273 "authority_key_identifier": hex.EncodeToString(cert.AuthorityKeyId),
274 "status": "good",
275 "pem": string(pemBytes),
276 })
277
278 if resp.StatusCode != http.StatusBadRequest {
279 t.Fatal("Expected HTTP Bad Request", resp.StatusCode, string(body))
280 }
281}
282
283func TestInsertMissingPEM(t *testing.T) {
284 dbAccessor, err := prepDB()

Callers

nothing calls this directly

Calls 3

makeCertificateFunction · 0.85
makeRequestFunction · 0.85
prepDBFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…