(t *testing.T)
| 77 | } |
| 78 | |
| 79 | func TestValidateControlPlaneSecurity(t *testing.T) { |
| 80 | baseCfg := ControlPlaneConfig{} |
| 81 | baseCfg.TLSCertFile = "cert.pem" |
| 82 | baseCfg.TLSKeyFile = "key.pem" |
| 83 | baseCfg.Users = map[string]string{"postgres": "postgres"} |
| 84 | |
| 85 | if err := validateControlPlaneSecurity(baseCfg); err != nil { |
| 86 | t.Fatalf("expected valid control-plane security config, got: %v", err) |
| 87 | } |
| 88 | |
| 89 | noTLS := baseCfg |
| 90 | noTLS.TLSCertFile = "" |
| 91 | if err := validateControlPlaneSecurity(noTLS); err == nil { |
| 92 | t.Fatalf("expected error for missing TLS cert") |
| 93 | } |
| 94 | |
| 95 | noUsers := baseCfg |
| 96 | noUsers.Users = map[string]string{} |
| 97 | if err := validateControlPlaneSecurity(noUsers); err == nil { |
| 98 | t.Fatalf("expected error for missing users") |
| 99 | } |
| 100 | } |
| 101 | |
| 102 | func TestValidateWorkerBackendConfig(t *testing.T) { |
| 103 | tests := []struct { |
nothing calls this directly
no test coverage detected