Add missing kea dhcp4 format when validating config

Thanks Discord user cosmoxl for reporting this.
This commit is contained in:
Cuong Manh Le
2024-12-12 18:47:22 +07:00
committed by Cuong Manh Le
parent f71dd78915
commit 02ee113b95
2 changed files with 8 additions and 1 deletions
+7
View File
@@ -111,6 +111,7 @@ func TestConfigValidation(t *testing.T) {
{"doh3 endpoint without type", doh3UpstreamEndpointWithoutType(t), false},
{"sdns endpoint without type", sdnsUpstreamEndpointWithoutType(t), false},
{"maximum number of flush cache domains", configWithInvalidFlushCacheDomain(t), true},
{"kea dhcp4 format", configWithDhcp4KeaFormat(t), false},
}
for _, tc := range tests {
@@ -307,6 +308,12 @@ func configWithInvalidLeaseFileFormat(t *testing.T) *ctrld.Config {
return cfg
}
func configWithDhcp4KeaFormat(t *testing.T) *ctrld.Config {
cfg := defaultConfig(t)
cfg.Service.DHCPLeaseFileFormat = "kea-dhcp4"
return cfg
}
func configWithInvalidDoHEndpoint(t *testing.T) *ctrld.Config {
cfg := defaultConfig(t)
cfg.Upstream["0"].Endpoint = "/1.1.1.1"