diff options
| author | Shulhan <ms@kilabit.info> | 2023-08-05 15:21:29 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2023-08-05 15:47:53 +0700 |
| commit | 34d09fcaa210ddd9d8bf8d1754151faeebf4e485 (patch) | |
| tree | 7346e07a168f65f81dd5475816bb1e88119f9a0f /lib/dns/dns_test.go | |
| parent | bd2ae82e254e203a021c9907e41b41ec0643ad49 (diff) | |
| download | pakakeh.go-34d09fcaa210ddd9d8bf8d1754151faeebf4e485.tar.xz | |
lib/dns: always initialize the Zone SOA record to default values
Previously, if we parse, create, or remove the SOA record from zone, we
assume the SOA records are valid and not touch their values.
In this changes, we set the SOA fields to default values if its not set,
to make the SOA record consistent and valid, in perspective of client.
This changes also export the default OS values for documentation and add
new method NewRDataSOA to simplify creating new SOA record.
Diffstat (limited to 'lib/dns/dns_test.go')
| -rw-r--r-- | lib/dns/dns_test.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/dns/dns_test.go b/lib/dns/dns_test.go index 1d9bac6a..207b5a3c 100644 --- a/lib/dns/dns_test.go +++ b/lib/dns/dns_test.go @@ -15,6 +15,9 @@ const ( testServerAddress = "127.0.0.1:5300" testDoTServerAddress = "127.0.0.1:18053" testTLSPort = 18053 + + // Equal to 2023-08-05 07:53:20 +0000 UTC. + testNowEpoch = 1691222000 ) var ( @@ -24,6 +27,10 @@ var ( func TestMain(m *testing.M) { log.SetFlags(0) + timeNow = func() time.Time { + return time.Unix(testNowEpoch, 0) + } + var ( serverOptions = &ServerOptions{ ListenAddress: "127.0.0.1:5300", |
