Skip to content

Commit

Permalink
Fix mixed indentation within tests (coredns#3855)
Browse files Browse the repository at this point in the history
Signed-off-by: Ambrose Chua <[email protected]>
  • Loading branch information
serverwentdown authored Apr 25, 2020
1 parent 74eabe9 commit ed1f42c
Show file tree
Hide file tree
Showing 31 changed files with 286 additions and 307 deletions.
17 changes: 7 additions & 10 deletions test/auto_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ func TestAuto(t *testing.T) {
directory ` + tmpdir + ` db\.(.*) {1}
reload 1s
}
}
`
}`

i, udp, _, err := CoreDNSServerAndPorts(corefile)
if err != nil {
Expand Down Expand Up @@ -82,8 +81,7 @@ func TestAutoNonExistentZone(t *testing.T) {
reload 1s
}
errors stdout
}
`
}`

i, err := CoreDNSServer(corefile)
if err != nil {
Expand Down Expand Up @@ -121,8 +119,7 @@ func TestAutoAXFR(t *testing.T) {
reload 1s
transfer to *
}
}
`
}`

i, err := CoreDNSServer(corefile)
if err != nil {
Expand Down Expand Up @@ -160,9 +157,9 @@ 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 SOA sns.dns.icann.org. noc.dns.icann.org. 2016082534 7200 3600 1209600 3600
IN NS a.iana-servers.net.
IN NS b.iana-servers.net.
www IN A 127.0.0.1
www IN A 127.0.0.1
`
14 changes: 7 additions & 7 deletions test/cache_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ func TestLookupCache(t *testing.T) {
defer rm()

corefile := `example.org:0 {
file ` + name + `
}
`
file ` + name + `
}`

i, udp, _, err := CoreDNSServerAndPorts(corefile)
if err != nil {
t.Fatalf("Could not get CoreDNS serving instance: %s", err)
Expand All @@ -28,10 +28,10 @@ func TestLookupCache(t *testing.T) {

// Start caching forward CoreDNS that we want to test.
corefile = `example.org:0 {
forward . ` + udp + `
cache 10
}
`
forward . ` + udp + `
cache 10
}`

i, udp, _, err = CoreDNSServerAndPorts(corefile)
if err != nil {
t.Fatalf("Could not get CoreDNS serving instance: %s", err)
Expand Down
3 changes: 1 addition & 2 deletions test/chaos_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ import (
func TestChaos(t *testing.T) {
corefile := `.:0 {
chaos
}
`
}`

i, udp, _, err := CoreDNSServerAndPorts(corefile)
if err != nil {
Expand Down
12 changes: 6 additions & 6 deletions test/compression_scrub_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ import (

func TestCompressScrub(t *testing.T) {
corefile := `example.org:0 {
erratic {
drop 0
delay 0
large
}
}`
erratic {
drop 0
delay 0
large
}
}`

i, udp, _, err := CoreDNSServerAndPorts(corefile)
if err != nil {
Expand Down
5 changes: 2 additions & 3 deletions test/ds_file_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,8 @@ func TestLookupDS(t *testing.T) {
defer rm()

corefile := `miek.nl:0 {
file ` + name + `
}
`
file ` + name + `
}`

i, udp, _, err := CoreDNSServerAndPorts(corefile)
if err != nil {
Expand Down
3 changes: 1 addition & 2 deletions test/edns0_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ import (
func TestEDNS0(t *testing.T) {
corefile := `.:0 {
whoami
}
`
}`

i, udp, _, err := CoreDNSServerAndPorts(corefile)
if err != nil {
Expand Down
30 changes: 15 additions & 15 deletions test/erratic_autopath_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func setupProxyTargetCoreDNS(t *testing.T, fn func(string)) {
defer os.Remove(tmpdir)

content := `
example.org. IN SOA sns.dns.icann.org. noc.dns.icann.org. 1 3600 3600 3600 3600
example.org. IN SOA sns.dns.icann.org. noc.dns.icann.org. 1 3600 3600 3600 3600
google.com. IN SOA ns1.google.com. dns-admin.google.com. 1 3600 3600 3600 3600
google.com. IN A 172.217.25.110
Expand All @@ -30,9 +30,9 @@ google.com. IN A 172.217.25.110
defer os.Remove(path)

corefile := `.:0 {
file ` + path + `
}
`
file ` + path + `
}`

i, udp, _, err := CoreDNSServerAndPorts(corefile)
if err != nil {
t.Fatalf("Could not get proxy target CoreDNS serving instance: %s", err)
Expand All @@ -45,12 +45,12 @@ google.com. IN A 172.217.25.110
func TestLookupAutoPathErratic(t *testing.T) {
setupProxyTargetCoreDNS(t, func(proxyPath string) {
corefile := `.:0 {
erratic
autopath @erratic
forward . ` + proxyPath + `
debug
}
`
erratic
autopath @erratic
forward . ` + proxyPath + `
debug
}`

i, udp, _, err := CoreDNSServerAndPorts(corefile)
if err != nil {
t.Fatalf("Could not get CoreDNS serving instance: %s", err)
Expand Down Expand Up @@ -91,11 +91,11 @@ func TestLookupAutoPathErratic(t *testing.T) {
func TestAutoPathErraticNotLoaded(t *testing.T) {
setupProxyTargetCoreDNS(t, func(proxyPath string) {
corefile := `.:0 {
autopath @erratic
forward . ` + proxyPath + `
debug
}
`
autopath @erratic
forward . ` + proxyPath + `
debug
}`

i, err := CoreDNSServer(corefile)
if err != nil {
t.Fatalf("Could not get CoreDNS serving instance: %s", err)
Expand Down
10 changes: 5 additions & 5 deletions test/etcd_cache_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ import (

func TestEtcdCache(t *testing.T) {
corefile := `.:0 {
etcd skydns.test {
path /skydns
}
cache skydns.test
}`
etcd skydns.test {
path /skydns
}
cache skydns.test
}`

ex, udp, _, err := CoreDNSServerAndPorts(corefile)
if err != nil {
Expand Down
8 changes: 4 additions & 4 deletions test/etcd_credentials_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ import (

func TestEtcdCredentials(t *testing.T) {
corefile := `.:0 {
etcd skydns.test {
path /skydns
}
}`
etcd skydns.test {
path /skydns
}
}`

ex, _, _, err := CoreDNSServerAndPorts(corefile)
if err != nil {
Expand Down
18 changes: 9 additions & 9 deletions test/etcd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ func TestEtcdStubLoop(t *testing.T) {

func TestEtcdStubAndProxyLookup(t *testing.T) {
corefile := `.:0 {
etcd skydns.local {
stubzones
path /skydns
endpoint http://localhost:2379
upstream
fallthrough
}
forward . 8.8.8.8:53
}`
etcd skydns.local {
stubzones
path /skydns
endpoint http://localhost:2379
upstream
fallthrough
}
forward . 8.8.8.8:53
}`

ex, udp, _, err := CoreDNSServerAndPorts(corefile)
if err != nil {
Expand Down
20 changes: 10 additions & 10 deletions test/example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ package test

const exampleOrg = `; example.org test file
$TTL 3600
@ IN SOA sns.dns.icann.org. noc.dns.icann.org. 2015082541 7200 3600 1209600 3600
@ IN NS b.iana-servers.net.
@ IN NS a.iana-servers.net.
@ IN A 127.0.0.1
@ IN A 127.0.0.2
short 1 IN A 127.0.0.3
@ IN SOA sns.dns.icann.org. noc.dns.icann.org. 2015082541 7200 3600 1209600 3600
@ IN NS b.iana-servers.net.
@ IN NS a.iana-servers.net.
@ IN A 127.0.0.1
@ IN A 127.0.0.2
short 1 IN A 127.0.0.3
*.w 3600 IN TXT "Wildcard"
a.b.c.w IN TXT "Not a wildcard"
cname IN CNAME www.example.net.
service IN SRV 8080 10 10 @
*.w 3600 IN TXT "Wildcard"
a.b.c.w IN TXT "Not a wildcard"
cname IN CNAME www.example.net.
service IN SRV 8080 10 10 @
`
18 changes: 9 additions & 9 deletions test/file_cname_proxy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ func TestZoneExternalCNAMELookupWithoutProxy(t *testing.T) {

// Corefile with for example without proxy section.
corefile := `example.org:0 {
file ` + name + `
}
`
file ` + name + `
}`

i, udp, _, err := CoreDNSServerAndPorts(corefile)
if err != nil {
t.Fatalf("Could not get CoreDNS serving instance: %s", err)
Expand Down Expand Up @@ -51,12 +51,12 @@ func TestZoneExternalCNAMELookupWithProxy(t *testing.T) {

// Corefile with for example proxy section.
corefile := `.:0 {
file ` + name + ` example.org {
upstream
}
forward . 8.8.8.8 8.8.4.4
}
`
file ` + name + ` example.org {
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)
Expand Down
18 changes: 9 additions & 9 deletions test/file_reload_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@ func TestZoneReload(t *testing.T) {
defer rm()

// Corefile with two stanzas
corefile := `example.org:0 {
file ` + name + ` {
reload 1s
}
}
corefile := `
example.org:0 {
file ` + name + ` {
reload 1s
}
}
example.net:0 {
file ` + name + `
}`

example.net:0 {
file ` + name + `
}
`
i, udp, _, err := CoreDNSServerAndPorts(corefile)
if err != nil {
t.Fatalf("Could not get CoreDNS serving instance: %s", err)
Expand Down
40 changes: 20 additions & 20 deletions test/file_serve_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@ func TestZoneEDNS0Lookup(t *testing.T) {
t.Parallel()

name, rm, err := test.TempFile(".", `$ORIGIN example.org.
@ 3600 IN SOA sns.dns.icann.org. noc.dns.icann.org. (
2017042745 ; serial
7200 ; refresh (2 hours)
3600 ; retry (1 hour)
1209600 ; expire (2 weeks)
3600 ; minimum (1 hour)
)
@ 3600 IN SOA sns.dns.icann.org. noc.dns.icann.org. (
2017042745 ; serial
7200 ; refresh (2 hours)
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.
3600 IN NS a.iana-servers.net.
3600 IN NS b.iana-servers.net.
www IN A 127.0.0.1
www IN AAAA ::1
www IN A 127.0.0.1
www IN AAAA ::1
`)
if err != nil {
t.Fatalf("Failed to create zone: %s", err)
Expand All @@ -33,9 +33,9 @@ www IN AAAA ::1

// Corefile with for example without proxy section.
corefile := `example.org:0 {
file ` + name + `
}
`
file ` + name + `
}`

i, udp, _, err := CoreDNSServerAndPorts(corefile)
if err != nil {
t.Fatalf("Could not get CoreDNS serving instance: %s", err)
Expand All @@ -59,16 +59,16 @@ func TestZoneNoNS(t *testing.T) {
t.Parallel()

name, rm, err := test.TempFile(".", `$ORIGIN example.org.
@ 3600 IN SOA sns.dns.icann.org. noc.dns.icann.org. (
@ 3600 IN SOA sns.dns.icann.org. noc.dns.icann.org. (
2017042745 ; serial
7200 ; refresh (2 hours)
3600 ; retry (1 hour)
1209600 ; expire (2 weeks)
3600 ; minimum (1 hour)
)
www IN A 127.0.0.1
www IN AAAA ::1
www IN A 127.0.0.1
www IN AAAA ::1
`)
if err != nil {
t.Fatalf("Failed to create zone: %s", err)
Expand All @@ -77,9 +77,9 @@ www IN AAAA ::1

// Corefile with for example without proxy section.
corefile := `example.org:0 {
file ` + name + `
}
`
file ` + name + `
}`

i, udp, _, err := CoreDNSServerAndPorts(corefile)
if err != nil {
t.Fatalf("Could not get CoreDNS serving instance: %s", err)
Expand Down
Loading

0 comments on commit ed1f42c

Please sign in to comment.