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

Function TestInsertInvalidExpiry

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

Source from the content-addressed store, hash-verified

405}
406
407func TestInsertInvalidExpiry(t *testing.T) {
408 dbAccessor, err := prepDB()
409 if err != nil {
410 t.Fatal(err)
411 }
412
413 serialNumber, cert, pemBytes, signer, err := makeCertificate()
414
415 if err != nil {
416 t.Fatal(err)
417 }
418
419 resp, body := makeRequest(t, dbAccessor, signer, map[string]interface{}{
420 "serial_number": serialNumber.Text(10),
421 "authority_key_identifier": hex.EncodeToString(cert.AuthorityKeyId),
422 "status": "good",
423 "pem": string(pemBytes),
424 "expiry": "this is not an expiry",
425 })
426
427 if resp.StatusCode != http.StatusBadRequest {
428 t.Fatal("Expected HTTP Bad Request, got", resp.StatusCode, string(body))
429 }
430}
431
432func TestInsertWrongSerial(t *testing.T) {
433 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…