(t *testing.T)
| 68 | } |
| 69 | |
| 70 | func TestLoadOrCreateNodeCA_PartialFilesError(t *testing.T) { |
| 71 | dir := t.TempDir() |
| 72 | certPath := filepath.Join(dir, "node_ca_cert.pem") |
| 73 | keyPath := filepath.Join(dir, "node_ca_key.pem") |
| 74 | |
| 75 | if _, err := LoadOrCreateNodeCA(certPath, keyPath); err != nil { |
| 76 | t.Fatalf("create: %v", err) |
| 77 | } |
| 78 | // remove cert only |
| 79 | if err := os.Remove(certPath); err != nil { |
| 80 | t.Fatalf("remove: %v", err) |
| 81 | } |
| 82 | if _, err := LoadOrCreateNodeCA(certPath, keyPath); err == nil { |
| 83 | t.Fatalf("expected error when only key exists") |
| 84 | } |
| 85 | } |
| 86 | |
| 87 | func TestSignCSR_Success(t *testing.T) { |
| 88 | dir := t.TempDir() |
nothing calls this directly
no test coverage detected