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

Function TestInsertMissingSerial

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

Source from the content-addressed store, hash-verified

209}
210
211func TestInsertMissingSerial(t *testing.T) {
212 dbAccessor, err := prepDB()
213 if err != nil {
214 t.Fatal(err)
215 }
216
217 _, cert, pemBytes, signer, err := makeCertificate()
218
219 if err != nil {
220 t.Fatal(err)
221 }
222
223 resp, body := makeRequest(t, dbAccessor, signer, map[string]interface{}{
224 "authority_key_identifier": hex.EncodeToString(cert.AuthorityKeyId),
225 "status": "good",
226 "pem": string(pemBytes),
227 "expiry": cert.NotAfter.UTC().Format(time.RFC3339),
228 })
229
230 if resp.StatusCode != http.StatusBadRequest {
231 t.Fatal("Expected HTTP Bad Request", resp.StatusCode, string(body))
232 }
233}
234
235func TestInsertMissingAKI(t *testing.T) {
236 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…