(t *testing.T)
| 430 | } |
| 431 | |
| 432 | func TestInsertWrongSerial(t *testing.T) { |
| 433 | dbAccessor, err := prepDB() |
| 434 | if err != nil { |
| 435 | t.Fatal(err) |
| 436 | } |
| 437 | |
| 438 | _, cert, pemBytes, signer, err := makeCertificate() |
| 439 | |
| 440 | if err != nil { |
| 441 | t.Fatal(err) |
| 442 | } |
| 443 | |
| 444 | resp, body := makeRequest(t, dbAccessor, signer, map[string]interface{}{ |
| 445 | "serial_number": big.NewInt(1).Text(10), |
| 446 | "authority_key_identifier": hex.EncodeToString(cert.AuthorityKeyId), |
| 447 | "status": "good", |
| 448 | "pem": string(pemBytes), |
| 449 | "expiry": cert.NotAfter.UTC().Format(time.RFC3339), |
| 450 | }) |
| 451 | |
| 452 | if resp.StatusCode != http.StatusBadRequest { |
| 453 | t.Fatal("Expected HTTP Bad Request", resp.StatusCode, string(body)) |
| 454 | } |
| 455 | } |
| 456 | |
| 457 | func TestInsertWrongAKI(t *testing.T) { |
| 458 | dbAccessor, err := prepDB() |
nothing calls this directly
no test coverage detected
searching dependent graphs…