(t *testing.T)
| 305 | } |
| 306 | |
| 307 | func TestInsertInvalidSerial(t *testing.T) { |
| 308 | dbAccessor, err := prepDB() |
| 309 | if err != nil { |
| 310 | t.Fatal(err) |
| 311 | } |
| 312 | |
| 313 | _, cert, pemBytes, signer, err := makeCertificate() |
| 314 | |
| 315 | if err != nil { |
| 316 | t.Fatal(err) |
| 317 | } |
| 318 | |
| 319 | resp, body := makeRequest(t, dbAccessor, signer, map[string]interface{}{ |
| 320 | "serial_number": "this is not a serial number", |
| 321 | "authority_key_identifier": hex.EncodeToString(cert.AuthorityKeyId), |
| 322 | "status": "good", |
| 323 | "pem": string(pemBytes), |
| 324 | "expiry": cert.NotAfter.UTC().Format(time.RFC3339), |
| 325 | }) |
| 326 | |
| 327 | if resp.StatusCode != http.StatusBadRequest { |
| 328 | t.Fatal("Expected HTTP Bad Request", resp.StatusCode, string(body)) |
| 329 | } |
| 330 | } |
| 331 | |
| 332 | func TestInsertInvalidAKI(t *testing.T) { |
| 333 | dbAccessor, err := prepDB() |
nothing calls this directly
no test coverage detected
searching dependent graphs…