mirror of
https://github.com/coredns/coredns.git
synced 2025-10-27 08:14:18 -04:00
Use filepath when manipulating file paths (#2221)
Automatically submitted.
This commit is contained in:
committed by
corbot[bot]
parent
cf04223718
commit
4b1b0ec9e6
@@ -3,7 +3,7 @@ package test
|
||||
import (
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path"
|
||||
"path/filepath"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
@@ -46,7 +46,7 @@ func TestAuto(t *testing.T) {
|
||||
}
|
||||
|
||||
// Write db.example.org to get example.org.
|
||||
if err = ioutil.WriteFile(path.Join(tmpdir, "db.example.org"), []byte(zoneContent), 0644); err != nil {
|
||||
if err = ioutil.WriteFile(filepath.Join(tmpdir, "db.example.org"), []byte(zoneContent), 0644); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ func TestAuto(t *testing.T) {
|
||||
}
|
||||
|
||||
// Remove db.example.org again.
|
||||
os.Remove(path.Join(tmpdir, "db.example.org"))
|
||||
os.Remove(filepath.Join(tmpdir, "db.example.org"))
|
||||
|
||||
time.Sleep(1100 * time.Millisecond) // wait for it to be picked up
|
||||
resp, err = p.Lookup(state, "www.example.org.", dns.TypeA)
|
||||
@@ -139,7 +139,7 @@ func TestAutoAXFR(t *testing.T) {
|
||||
defer i.Stop()
|
||||
|
||||
// Write db.example.org to get example.org.
|
||||
if err = ioutil.WriteFile(path.Join(tmpdir, "db.example.org"), []byte(zoneContent), 0644); err != nil {
|
||||
if err = ioutil.WriteFile(filepath.Join(tmpdir, "db.example.org"), []byte(zoneContent), 0644); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ package test
|
||||
import (
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path"
|
||||
"path/filepath"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
@@ -145,7 +145,7 @@ func TestMetricsAuto(t *testing.T) {
|
||||
defer i.Stop()
|
||||
|
||||
// Write db.example.org to get example.org.
|
||||
if err = ioutil.WriteFile(path.Join(tmpdir, "db.example.org"), []byte(zoneContent), 0644); err != nil {
|
||||
if err = ioutil.WriteFile(filepath.Join(tmpdir, "db.example.org"), []byte(zoneContent), 0644); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
// TODO(miek): make the auto sleep even less.
|
||||
@@ -169,7 +169,7 @@ func TestMetricsAuto(t *testing.T) {
|
||||
}
|
||||
|
||||
// Remove db.example.org again. And see if the metric stops increasing.
|
||||
os.Remove(path.Join(tmpdir, "db.example.org"))
|
||||
os.Remove(filepath.Join(tmpdir, "db.example.org"))
|
||||
time.Sleep(1100 * time.Millisecond) // wait for it to be picked up
|
||||
if _, err := dns.Exchange(m, udp); err != nil {
|
||||
t.Fatalf("Could not send message: %s", err)
|
||||
|
||||
Reference in New Issue
Block a user