Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
C
Coredns
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Railgun
Coredns
Commits
ed1f42cf
Commit
ed1f42cf
authored
Apr 25, 2020
by
Ambrose Chua
Committed by
GitHub
Apr 25, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix mixed indentation within tests (#3855)
Signed-off-by:
Ambrose Chua
<
ambrose@chua.family
>
parent
74eabe90
Changes
31
Show whitespace changes
Inline
Side-by-side
Showing
31 changed files
with
286 additions
and
307 deletions
+286
-307
test/auto_test.go
test/auto_test.go
+7
-10
test/cache_test.go
test/cache_test.go
+7
-7
test/chaos_test.go
test/chaos_test.go
+1
-2
test/compression_scrub_test.go
test/compression_scrub_test.go
+6
-6
test/ds_file_test.go
test/ds_file_test.go
+2
-3
test/edns0_test.go
test/edns0_test.go
+1
-2
test/erratic_autopath_test.go
test/erratic_autopath_test.go
+15
-15
test/etcd_cache_test.go
test/etcd_cache_test.go
+5
-5
test/etcd_credentials_test.go
test/etcd_credentials_test.go
+4
-4
test/etcd_test.go
test/etcd_test.go
+9
-9
test/example_test.go
test/example_test.go
+10
-10
test/file_cname_proxy_test.go
test/file_cname_proxy_test.go
+9
-9
test/file_reload_test.go
test/file_reload_test.go
+9
-9
test/file_serve_test.go
test/file_serve_test.go
+20
-20
test/file_srv_additional_test.go
test/file_srv_additional_test.go
+3
-3
test/file_upstream_test.go
test/file_upstream_test.go
+33
-33
test/file_xfr_test.go
test/file_xfr_test.go
+5
-5
test/grpc_test.go
test/grpc_test.go
+2
-2
test/hosts_file_test.go
test/hosts_file_test.go
+5
-5
test/metrics_test.go
test/metrics_test.go
+40
-45
test/miek_test.go
test/miek_test.go
+21
-21
test/plugin_dnssec_test.go
test/plugin_dnssec_test.go
+8
-8
test/proxy_health_test.go
test/proxy_health_test.go
+2
-4
test/proxy_test.go
test/proxy_test.go
+4
-6
test/reload_test.go
test/reload_test.go
+25
-27
test/rewrite_test.go
test/rewrite_test.go
+6
-6
test/secondary_test.go
test/secondary_test.go
+11
-14
test/server_reverse_test.go
test/server_reverse_test.go
+6
-6
test/server_test.go
test/server_test.go
+5
-5
test/template_upstream_test.go
test/template_upstream_test.go
+3
-3
test/wildcard_test.go
test/wildcard_test.go
+2
-3
No files found.
test/auto_test.go
View file @
ed1f42cf
...
...
@@ -22,8 +22,7 @@ func TestAuto(t *testing.T) {
directory `
+
tmpdir
+
` db\.(.*) {1}
reload 1s
}
}
`
}`
i
,
udp
,
_
,
err
:=
CoreDNSServerAndPorts
(
corefile
)
if
err
!=
nil
{
...
...
@@ -82,8 +81,7 @@ func TestAutoNonExistentZone(t *testing.T) {
reload 1s
}
errors stdout
}
`
}`
i
,
err
:=
CoreDNSServer
(
corefile
)
if
err
!=
nil
{
...
...
@@ -121,8 +119,7 @@ func TestAutoAXFR(t *testing.T) {
reload 1s
transfer to *
}
}
`
}`
i
,
err
:=
CoreDNSServer
(
corefile
)
if
err
!=
nil
{
...
...
@@ -161,8 +158,8 @@ func TestAutoAXFR(t *testing.T) {
const
zoneContent
=
`; testzone
@ IN SOA sns.dns.icann.org. noc.dns.icann.org. 2016082534 7200 3600 1209600 3600
NS
a.iana-servers.net.
NS
b.iana-servers.net.
IN NS
a.iana-servers.net.
IN NS
b.iana-servers.net.
www IN A 127.0.0.1
`
test/cache_test.go
View file @
ed1f42cf
...
...
@@ -18,8 +18,8 @@ func TestLookupCache(t *testing.T) {
corefile
:=
`example.org:0 {
file `
+
name
+
`
}
`
}`
i
,
udp
,
_
,
err
:=
CoreDNSServerAndPorts
(
corefile
)
if
err
!=
nil
{
t
.
Fatalf
(
"Could not get CoreDNS serving instance: %s"
,
err
)
...
...
@@ -30,8 +30,8 @@ func TestLookupCache(t *testing.T) {
corefile
=
`example.org:0 {
forward . `
+
udp
+
`
cache 10
}
`
}`
i
,
udp
,
_
,
err
=
CoreDNSServerAndPorts
(
corefile
)
if
err
!=
nil
{
t
.
Fatalf
(
"Could not get CoreDNS serving instance: %s"
,
err
)
...
...
test/chaos_test.go
View file @
ed1f42cf
...
...
@@ -13,8 +13,7 @@ import (
func
TestChaos
(
t
*
testing
.
T
)
{
corefile
:=
`.:0 {
chaos
}
`
}`
i
,
udp
,
_
,
err
:=
CoreDNSServerAndPorts
(
corefile
)
if
err
!=
nil
{
...
...
test/compression_scrub_test.go
View file @
ed1f42cf
test/ds_file_test.go
View file @
ed1f42cf
...
...
@@ -36,8 +36,7 @@ func TestLookupDS(t *testing.T) {
corefile
:=
`miek.nl:0 {
file `
+
name
+
`
}
`
}`
i
,
udp
,
_
,
err
:=
CoreDNSServerAndPorts
(
corefile
)
if
err
!=
nil
{
...
...
test/edns0_test.go
View file @
ed1f42cf
...
...
@@ -9,8 +9,7 @@ import (
func
TestEDNS0
(
t
*
testing
.
T
)
{
corefile
:=
`.:0 {
whoami
}
`
}`
i
,
udp
,
_
,
err
:=
CoreDNSServerAndPorts
(
corefile
)
if
err
!=
nil
{
...
...
test/erratic_autopath_test.go
View file @
ed1f42cf
...
...
@@ -31,8 +31,8 @@ google.com. IN A 172.217.25.110
corefile
:=
`.:0 {
file `
+
path
+
`
}
`
}`
i
,
udp
,
_
,
err
:=
CoreDNSServerAndPorts
(
corefile
)
if
err
!=
nil
{
t
.
Fatalf
(
"Could not get proxy target CoreDNS serving instance: %s"
,
err
)
...
...
@@ -49,8 +49,8 @@ func TestLookupAutoPathErratic(t *testing.T) {
autopath @erratic
forward . `
+
proxyPath
+
`
debug
}
`
}
`
i
,
udp
,
_
,
err
:=
CoreDNSServerAndPorts
(
corefile
)
if
err
!=
nil
{
t
.
Fatalf
(
"Could not get CoreDNS serving instance: %s"
,
err
)
...
...
@@ -94,8 +94,8 @@ func TestAutoPathErraticNotLoaded(t *testing.T) {
autopath @erratic
forward . `
+
proxyPath
+
`
debug
}
`
}`
i
,
err
:=
CoreDNSServer
(
corefile
)
if
err
!=
nil
{
t
.
Fatalf
(
"Could not get CoreDNS serving instance: %s"
,
err
)
...
...
test/etcd_cache_test.go
View file @
ed1f42cf
...
...
@@ -19,7 +19,7 @@ func TestEtcdCache(t *testing.T) {
path /skydns
}
cache skydns.test
}`
}`
ex
,
udp
,
_
,
err
:=
CoreDNSServerAndPorts
(
corefile
)
if
err
!=
nil
{
...
...
test/etcd_credentials_test.go
View file @
ed1f42cf
...
...
@@ -14,7 +14,7 @@ func TestEtcdCredentials(t *testing.T) {
etcd skydns.test {
path /skydns
}
}`
}`
ex
,
_
,
_
,
err
:=
CoreDNSServerAndPorts
(
corefile
)
if
err
!=
nil
{
...
...
test/etcd_test.go
View file @
ed1f42cf
...
...
@@ -49,7 +49,7 @@ func TestEtcdStubAndProxyLookup(t *testing.T) {
fallthrough
}
forward . 8.8.8.8:53
}`
}`
ex
,
udp
,
_
,
err
:=
CoreDNSServerAndPorts
(
corefile
)
if
err
!=
nil
{
...
...
test/example_test.go
View file @
ed1f42cf
test/file_cname_proxy_test.go
View file @
ed1f42cf
...
...
@@ -20,8 +20,8 @@ func TestZoneExternalCNAMELookupWithoutProxy(t *testing.T) {
// Corefile with for example without proxy section.
corefile
:=
`example.org:0 {
file `
+
name
+
`
}
`
}`
i
,
udp
,
_
,
err
:=
CoreDNSServerAndPorts
(
corefile
)
if
err
!=
nil
{
t
.
Fatalf
(
"Could not get CoreDNS serving instance: %s"
,
err
)
...
...
@@ -55,8 +55,8 @@ func TestZoneExternalCNAMELookupWithProxy(t *testing.T) {
upstream
}
forward . 8.8.8.8 8.8.4.4
}
`
}`
i
,
udp
,
_
,
err
:=
CoreDNSServerAndPorts
(
corefile
)
if
err
!=
nil
{
t
.
Fatalf
(
"Could not get CoreDNS serving instance: %s"
,
err
)
...
...
test/file_reload_test.go
View file @
ed1f42cf
...
...
@@ -18,16 +18,16 @@ func TestZoneReload(t *testing.T) {
defer
rm
()
// Corefile with two stanzas
corefile
:=
`example.org:0 {
corefile
:=
`
example.org:0 {
file `
+
name
+
` {
reload 1s
}
}
example.net:0 {
}
example.net:0 {
file `
+
name
+
`
}
`
}`
i
,
udp
,
_
,
err
:=
CoreDNSServerAndPorts
(
corefile
)
if
err
!=
nil
{
t
.
Fatalf
(
"Could not get CoreDNS serving instance: %s"
,
err
)
...
...
test/file_serve_test.go
View file @
ed1f42cf
...
...
@@ -18,7 +18,7 @@ func TestZoneEDNS0Lookup(t *testing.T) {
3600 ; retry (1 hour)
1209600 ; expire (2 weeks)
3600 ; minimum (1 hour)
)
)
3600 IN NS a.iana-servers.net.
3600 IN NS b.iana-servers.net.
...
...
@@ -34,8 +34,8 @@ www IN AAAA ::1
// Corefile with for example without proxy section.
corefile
:=
`example.org:0 {
file `
+
name
+
`
}
`
}`
i
,
udp
,
_
,
err
:=
CoreDNSServerAndPorts
(
corefile
)
if
err
!=
nil
{
t
.
Fatalf
(
"Could not get CoreDNS serving instance: %s"
,
err
)
...
...
@@ -78,8 +78,8 @@ www IN AAAA ::1
// Corefile with for example without proxy section.
corefile
:=
`example.org:0 {
file `
+
name
+
`
}
`
}`
i
,
udp
,
_
,
err
:=
CoreDNSServerAndPorts
(
corefile
)
if
err
!=
nil
{
t
.
Fatalf
(
"Could not get CoreDNS serving instance: %s"
,
err
)
...
...
test/file_srv_additional_test.go
View file @
ed1f42cf
...
...
@@ -20,8 +20,8 @@ func TestZoneSRVAdditional(t *testing.T) {
// Corefile with for example without proxy section.
corefile
:=
`example.org:0 {
file `
+
name
+
`
}
`
}`
i
,
udp
,
_
,
err
:=
CoreDNSServerAndPorts
(
corefile
)
if
err
!=
nil
{
t
.
Fatalf
(
"Could not get CoreDNS serving instance: %s"
,
err
)
...
...
test/file_upstream_test.go
View file @
ed1f42cf
...
...
@@ -16,7 +16,7 @@ func TestFileUpstream(t *testing.T) {
3600 ; retry (1 hour)
1209600 ; expire (2 weeks)
3600 ; minimum (1 hour)
)
)
3600 IN NS a.iana-servers.net.
3600 IN NS b.iana-servers.net.
...
...
@@ -36,8 +36,8 @@ www 3600 IN CNAME www.example.net.
10.0.0.1 www.example.net.
fallthrough
}
}
`
}`
i
,
udp
,
_
,
err
:=
CoreDNSServerAndPorts
(
corefile
)
if
err
!=
nil
{
t
.
Fatalf
(
"Could not get CoreDNS serving instance: %s"
,
err
)
...
...
@@ -94,8 +94,8 @@ www 3600 IN A 127.0.0.53
file `
+
name2
+
` foo.example.org {
upstream
}
}
`
}`
i
,
udp
,
_
,
err
:=
CoreDNSServerAndPorts
(
corefile
)
if
err
!=
nil
{
t
.
Fatalf
(
"Could not get CoreDNS serving instance: %s"
,
err
)
...
...
test/file_xfr_test.go
View file @
ed1f42cf
...
...
@@ -32,8 +32,8 @@ func TestLargeAXFR(t *testing.T) {
file `
+
name
+
` {
transfer to *
}
}
`
}`
// Start server, and send an AXFR query to the TCP port. We set the deadline to prevent the test from hanging.
i
,
_
,
tcp
,
err
:=
CoreDNSServerAndPorts
(
corefile
)
if
err
!=
nil
{
...
...
test/grpc_test.go
View file @
ed1f42cf
...
...
@@ -14,8 +14,8 @@ import (
func
TestGrpc
(
t
*
testing
.
T
)
{
corefile
:=
`grpc://.:0 {
whoami
}
`
}`
g
,
_
,
tcp
,
err
:=
CoreDNSServerAndPorts
(
corefile
)
if
err
!=
nil
{
t
.
Fatalf
(
"Could not get CoreDNS serving instance: %s"
,
err
)
...
...
test/hosts_file_test.go
View file @
ed1f42cf
test/metrics_test.go
View file @
ed1f42cf
package
test
import
(
"fmt"
"io/ioutil"
"os"
"path/filepath"
...
...
@@ -18,16 +17,16 @@ import (
// Start test server that has metrics enabled. Then tear it down again.
func
TestMetricsServer
(
t
*
testing
.
T
)
{
corefile
:=
`example.org:0 {
corefile
:=
`
example.org:0 {
chaos CoreDNS-001 miek@miek.nl
prometheus localhost:0
}
example.com:0 {
}
example.com:0 {
forward . 8.8.4.4:53
prometheus localhost:0
}
`
}`
srv
,
err
:=
CoreDNSServer
(
corefile
)
if
err
!=
nil
{
t
.
Fatalf
(
"Could not get CoreDNS serving instance: %s"
,
err
)
...
...
@@ -37,12 +36,11 @@ example.com:0 {
func
TestMetricsRefused
(
t
*
testing
.
T
)
{
metricName
:=
"coredns_dns_responses_total"
corefile
:=
`example.org:0 {
forward . 8.8.8.8:53
prometheus localhost:0
}
`
}`
srv
,
udp
,
_
,
err
:=
CoreDNSServerAndPorts
(
corefile
)
if
err
!=
nil
{
t
.
Fatalf
(
"Could not get CoreDNS serving instance: %s"
,
err
)
...
...
@@ -82,8 +80,7 @@ func TestMetricsAuto(t *testing.T) {
reload 1s
}
prometheus localhost:0
}
`
}`
i
,
err
:=
CoreDNSServer
(
corefile
)
if
err
!=
nil
{
...
...
@@ -140,22 +137,20 @@ func TestMetricsAuto(t *testing.T) {
func
TestMetricsSeveralBlocs
(
t
*
testing
.
T
)
{
cacheSizeMetricName
:=
"coredns_cache_entries"
addrMetrics
:=
"localhost:9155"
corefile
:=
fmt
.
Sprintf
(
`
example.org:0 {
prometheus %s
corefile
:=
`
example.org:0 {
prometheus `
+
addrMetrics
+
`
forward . 8.8.8.8:53 {
force_tcp
}
}
google.com:0 {
prometheus %s
}
google.com:0 {
prometheus `
+
addrMetrics
+
`
forward . 8.8.8.8:53 {
force_tcp
}
cache
}
`
,
addrMetrics
,
addrMetrics
)
}`
i
,
udp
,
_
,
err
:=
CoreDNSServerAndPorts
(
corefile
)
if
err
!=
nil
{
...
...
@@ -190,16 +185,16 @@ google.com:0 {
}
func
TestMetricsPluginEnabled
(
t
*
testing
.
T
)
{
corefile
:=
`example.org:0 {
corefile
:=
`
example.org:0 {
chaos CoreDNS-001 miek@miek.nl
prometheus localhost:0
}
example.com:0 {
}
example.com:0 {
forward . 8.8.4.4:53
prometheus localhost:0
}
`
}`
srv
,
err
:=
CoreDNSServer
(
corefile
)
if
err
!=
nil
{
t
.
Fatalf
(
"Could not get CoreDNS serving instance: %s"
,
err
)
...
...
@@ -230,14 +225,14 @@ func TestMetricsAvailable(t *testing.T) {
procCache
:=
"coredns_cache_entries"
procCacheMiss
:=
"coredns_cache_misses_total"
procForward
:=
"coredns_dns_request_duration_seconds"
corefileWithMetrics
:=
`
.:0 {
corefileWithMetrics
:=
`.:0 {
prometheus localhost:0
cache
forward . 8.8.8.8 {
force_tcp
}
}`
inst
,
_
,
tcp
,
err
:=
CoreDNSServerAndPorts
(
corefileWithMetrics
)
defer
inst
.
Stop
()
if
err
!=
nil
{
...
...
test/miek_test.go
View file @
ed1f42cf
test/plugin_dnssec_test.go
View file @
ed1f42cf
...
...
@@ -27,8 +27,8 @@ func TestLookupBalanceRewriteCacheDnssec(t *testing.T) {
key file `
+
base
+
`
}
loadbalance
}
`
}`
ex
,
udp
,
_
,
err
:=
CoreDNSServerAndPorts
(
corefile
)
if
err
!=
nil
{
t
.
Fatalf
(
"Could not get CoreDNS serving instance: %s"
,
err
)
...
...
test/proxy_health_test.go
View file @
ed1f42cf
...
...
@@ -15,8 +15,7 @@ func TestProxyThreeWay(t *testing.T) {
erratic {
drop 2
}
}
`
}`
up1
,
err
:=
CoreDNSServer
(
corefileUp1
)
if
err
!=
nil
{
...
...
@@ -26,8 +25,7 @@ func TestProxyThreeWay(t *testing.T) {
corefileUp2
:=
`example.org:0 {
whoami
}
`
}`
up2
,
err
:=
CoreDNSServer
(
corefileUp2
)
if
err
!=
nil
{
...
...
test/proxy_test.go
View file @
ed1f42cf
...
...
@@ -18,8 +18,7 @@ func TestLookupProxy(t *testing.T) {
corefile
:=
`example.org:0 {
file `
+
name
+
`
}
`
}`
i
,
udp
,
_
,
err
:=
CoreDNSServerAndPorts
(
corefile
)
if
err
!=
nil
{
...
...
@@ -55,8 +54,7 @@ func BenchmarkProxyLookup(b *testing.B) {
corefile
:=
`example.org:0 {
file `
+
name
+
`
}
`
}`
i
,
err
:=
CoreDNSServer
(
corefile
)
if
err
!=
nil
{
...
...
test/reload_test.go
View file @
ed1f42cf
...
...
@@ -15,8 +15,8 @@ import (
func
TestReload
(
t
*
testing
.
T
)
{
corefile
:=
`.:0 {
whoami
}
`
}`
coreInput
:=
NewInput
(
corefile
)
c
,
err
:=
CoreDNSServer
(
corefile
)
...
...
@@ -60,11 +60,11 @@ func send(t *testing.T, server string) {
}
func
TestReloadHealth
(
t
*
testing
.
T
)
{
corefile
:=
`
.:0 {
corefile
:=
`.:0 {
health 127.0.0.1:52182
whoami
}`
}`
c
,
err
:=
CoreDNSServer
(
corefile
)
if
err
!=
nil
{
if
strings
.
Contains
(
err
.
Error
(),
inUse
)
{
...
...
@@ -81,12 +81,12 @@ func TestReloadHealth(t *testing.T) {
}
func
TestReloadMetricsHealth
(
t
*
testing
.
T
)
{
corefile
:=
`
.:0 {
corefile
:=
`.:0 {
prometheus 127.0.0.1:53183
health 127.0.0.1:53184
whoami
}`
}`
c
,
err
:=
CoreDNSServer
(
corefile
)
if
err
!=
nil
{
if
strings
.
Contains
(
err
.
Error
(),
inUse
)
{
...
...
@@ -154,15 +154,14 @@ func TestReloadSeveralTimeMetrics(t *testing.T) {
// that is not used in another test
promAddress
:=
"127.0.0.1:53185"
proc
:=
"coredns_build_info"
corefileWithMetrics
:=
`
.:0 {
corefileWithMetrics
:=
`.:0 {
prometheus `
+
promAddress
+
`
whoami
}`
corefileWithoutMetrics
:=
`
.:0 {
corefileWithoutMetrics
:=
`.:0 {
whoami
}`
if
err
:=
collectMetricsInfo
(
promAddress
,
proc
);
err
==
nil
{
t
.
Errorf
(
"Prometheus is listening before the test started"
)
}
...
...
@@ -211,14 +210,14 @@ func TestMetricsAvailableAfterReload(t *testing.T) {
procMetric
:=
"coredns_build_info"
procCache
:=
"coredns_cache_entries"
procForward
:=
"coredns_dns_request_duration_seconds"
corefileWithMetrics
:=
`
.:0 {
corefileWithMetrics
:=
`.:0 {
prometheus `
+
promAddress
+
`
cache
forward . 8.8.8.8 {
force_tcp
}
}`
inst
,
_
,
tcp
,
err
:=
CoreDNSServerAndPorts
(
corefileWithMetrics
)
if
err
!=
nil
{
if
strings
.
Contains
(
err
.
Error
(),
inUse
)
{
...
...
@@ -265,16 +264,14 @@ func TestMetricsAvailableAfterReloadAndFailedReload(t *testing.T) {
procMetric
:=
"coredns_build_info"
procCache
:=
"coredns_cache_entries"
procForward
:=
"coredns_dns_request_duration_seconds"
corefileWithMetrics
:=
`
.:0 {
corefileWithMetrics
:=
`.:0 {
prometheus `
+
promAddress
+
`
cache
forward . 8.8.8.8 {
force_tcp
}
}`
invalidCorefileWithMetrics
:=
`
.:0 {
invalidCorefileWithMetrics
:=
`.:0 {
prometheus `
+
promAddress
+
`
cache
forward . 8.8.8.8 {
...
...
@@ -282,6 +279,7 @@ func TestMetricsAvailableAfterReloadAndFailedReload(t *testing.T) {
}
invalid
}`
inst
,
_
,
tcp
,
err
:=
CoreDNSServerAndPorts
(
corefileWithMetrics
)
if
err
!=
nil
{
if
strings
.
Contains
(
err
.
Error
(),
inUse
)
{
...
...
test/rewrite_test.go
View file @
ed1f42cf
...
...
@@ -15,7 +15,7 @@ func TestRewrite(t *testing.T) {
erratic . {
drop 0
}
}`
}`
i
,
udp
,
_
,
err
:=
CoreDNSServerAndPorts
(
corefile
)
if
err
!=
nil
{
...
...
test/secondary_test.go
View file @
ed1f42cf
...
...
@@ -15,8 +15,7 @@ func TestEmptySecondaryZone(t *testing.T) {
secondary {
transfer from 127.0.0.1:1717
}
}
`
}`
i
,
udp
,
_
,
err
:=
CoreDNSServerAndPorts
(
corefile
)
if
err
!=
nil
{
...
...
@@ -46,8 +45,7 @@ func TestSecondaryZoneTransfer(t *testing.T) {
file `
+
name
+
` {
transfer to *
}
}
`
}`
i
,
_
,
tcp
,
err
:=
CoreDNSServerAndPorts
(
corefile
)
if
err
!=
nil
{
...
...
@@ -59,8 +57,8 @@ func TestSecondaryZoneTransfer(t *testing.T) {
secondary {
transfer from `
+
tcp
+
`
}
}
`
}`
i1
,
udp
,
_
,
err
:=
CoreDNSServerAndPorts
(
corefile
)
if
err
!=
nil
{
t
.
Fatalf
(
"Could not get CoreDNS serving instance: %s"
,
err
)
...
...
@@ -96,8 +94,7 @@ func TestIxfrResponse(t *testing.T) {
file `
+
name
+
` {
transfer to *
}
}
`
}`
i
,
udp
,
_
,
err
:=
CoreDNSServerAndPorts
(
corefile
)
if
err
!=
nil
{
...
...
test/server_reverse_test.go
View file @
ed1f42cf
...
...
@@ -11,8 +11,8 @@ func TestClasslessReverse(t *testing.T) {
// 25 -> so anything above 1.127 won't be answered, below is OK.
corefile
:=
`192.168.1.0/25:0 {
whoami
}
`
}`
s
,
udp
,
_
,
err
:=
CoreDNSServerAndPorts
(
corefile
)
if
err
!=
nil
{
t
.
Fatalf
(
"Could not get CoreDNS serving instance: %s"
,
err
)
...
...
@@ -51,8 +51,8 @@ func TestClasslessReverse(t *testing.T) {
func
TestReverse
(
t
*
testing
.
T
)
{
corefile
:=
`192.168.1.0/24:0 {
whoami
}
`
}`
s
,
udp
,
_
,
err
:=
CoreDNSServerAndPorts
(
corefile
)
if
err
!=
nil
{
t
.
Fatalf
(
"Could not get CoreDNS serving instance: %s"
,
err
)
...
...
@@ -97,8 +97,8 @@ func TestReverse(t *testing.T) {
func
TestReverseInAddr
(
t
*
testing
.
T
)
{
corefile
:=
`1.168.192.in-addr.arpa:0 {
whoami
}
`
}`
s
,
udp
,
_
,
err
:=
CoreDNSServerAndPorts
(
corefile
)
if
err
!=
nil
{
t
.
Fatalf
(
"Could not get CoreDNS serving instance: %s"
,
err
)
...
...
test/server_test.go
View file @
ed1f42cf
...
...
@@ -11,8 +11,8 @@ func TestProxyToChaosServer(t *testing.T) {
t
.
Parallel
()
corefile
:=
`.:0 {
chaos CoreDNS-001 miek@miek.nl
}
`
}`
chaos
,
udpChaos
,
_
,
err
:=
CoreDNSServerAndPorts
(
corefile
)
if
err
!=
nil
{
t
.
Fatalf
(
"Could not get CoreDNS serving instance: %s"
,
err
)
...
...
@@ -22,8 +22,8 @@ func TestProxyToChaosServer(t *testing.T) {
corefileProxy
:=
`.:0 {
forward . `
+
udpChaos
+
`
}
`
}`
proxy
,
udp
,
_
,
err
:=
CoreDNSServerAndPorts
(
corefileProxy
)
if
err
!=
nil
{
t
.
Fatalf
(
"Could not get CoreDNS serving instance"
)
...
...
test/template_upstream_test.go
View file @
ed1f42cf
...
...
@@ -20,8 +20,8 @@ func TestTemplateUpstream(t *testing.T) {
match ".*"
answer "target.example.net. 60 IN A 1.2.3.4"
}
}
`
}`
i
,
udp
,
_
,
err
:=
CoreDNSServerAndPorts
(
corefile
)
if
err
!=
nil
{
t
.
Fatalf
(
"Could not get CoreDNS serving instance: %s"
,
err
)
...
...
test/wildcard_test.go
View file @
ed1f42cf
...
...
@@ -18,8 +18,7 @@ func TestLookupWildcard(t *testing.T) {
corefile
:=
`example.org:0 {
file `
+
name
+
`
}
`
}`
i
,
udp
,
_
,
err
:=
CoreDNSServerAndPorts
(
corefile
)
if
err
!=
nil
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment