Generate RFC 9432 DNS catalog zone files from a declarative input file. Parses zone-to-catalog assignments with optional group and coo properties, produces deterministic BIND-format output with automatic SOA serial management and change detection.
31 lines
549 B
Go
31 lines
549 B
Go
package main
|
|
|
|
import (
|
|
"strings"
|
|
"testing"
|
|
"time"
|
|
)
|
|
|
|
func fixedTime(year, month, day int) time.Time {
|
|
return time.Date(year, time.Month(month), day, 0, 0, 0, 0, time.UTC)
|
|
}
|
|
|
|
func splitLines(s string) []string {
|
|
s = strings.TrimRight(s, "\n")
|
|
if s == "" {
|
|
return nil
|
|
}
|
|
return strings.Split(s, "\n")
|
|
}
|
|
|
|
func assertContains(t *testing.T, s, substr string) {
|
|
t.Helper()
|
|
if !strings.Contains(s, substr) {
|
|
t.Errorf("expected %q to contain %q", s, substr)
|
|
}
|
|
}
|
|
|
|
func containsStr(s, substr string) bool {
|
|
return strings.Contains(s, substr)
|
|
}
|