mirror of
https://github.com/hanzoai/status.git
synced 2026-10-30 18:21:48 +00:00
White-labelable status monitoring service with all Gatus branding removed. Defaults to neutral "Status" text. Branding is driven entirely by the ui section in config YAML. - Pure Go build (CGO_ENABLED=0, modernc.org/sqlite) - Multi-stage Dockerfile (node frontend + go backend + alpine runtime) - K8s kustomize overlays for hanzo and lux deployments - GitHub Actions CI for GHCR image push - Pre-built Vue frontend with zero upstream branding
28 lines
675 B
Go
28 lines
675 B
Go
package dns
|
|
|
|
import (
|
|
"testing"
|
|
)
|
|
|
|
func TestConfig_ValidateAndSetDefault(t *testing.T) {
|
|
dns := &Config{
|
|
QueryType: "A",
|
|
QueryName: "",
|
|
}
|
|
err := dns.ValidateAndSetDefault()
|
|
if err == nil {
|
|
t.Error("Should've returned an error because endpoint's dns didn't have a query name, which is a mandatory field for dns")
|
|
}
|
|
}
|
|
|
|
func TestConfig_ValidateAndSetDefaultsWithInvalidDNSQueryType(t *testing.T) {
|
|
dns := &Config{
|
|
QueryType: "B",
|
|
QueryName: "example.com",
|
|
}
|
|
err := dns.ValidateAndSetDefault()
|
|
if err == nil {
|
|
t.Error("Should've returned an error because endpoint's dns query type is invalid, it needs to be a valid query name like A, AAAA, CNAME...")
|
|
}
|
|
}
|