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

Function TestInsertInvalidStatus

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

Source from the content-addressed store, hash-verified

355}
356
357func TestInsertInvalidStatus(t *testing.T) {
358 dbAccessor, err := prepDB()
359 if err != nil {
360 t.Fatal(err)
361 }
362
363 serialNumber, cert, pemBytes, signer, err := makeCertificate()
364
365 if err != nil {
366 t.Fatal(err)
367 }
368
369 resp, body := makeRequest(t, dbAccessor, signer, map[string]interface{}{
370 "serial_number": serialNumber.Text(10),
371 "authority_key_identifier": hex.EncodeToString(cert.AuthorityKeyId),
372 "status": "invalid",
373 "pem": string(pemBytes),
374 "expiry": cert.NotAfter.UTC().Format(time.RFC3339),
375 })
376
377 if resp.StatusCode != http.StatusBadRequest {
378 t.Fatal("Expected HTTP Bad Request", resp.StatusCode, string(body))
379 }
380}
381
382func TestInsertInvalidPEM(t *testing.T) {
383 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…