mirror of
https://github.com/coredns/coredns.git
synced 2025-10-27 16:24:19 -04:00
test: skip certain network-specific tests on non-Linux (#7318)
Add conditional test skipping for bind and readme tests that rely on Linux-specific loopback interface behavior. These tests reference network configurations that may not exist on for e.g. macOS or other platforms, causing spurious test failures. Signed-off-by: Ville Vesilehto <ville@vesilehto.fi>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package bind
|
||||
|
||||
import (
|
||||
"runtime"
|
||||
"testing"
|
||||
|
||||
"github.com/coredns/caddy"
|
||||
@@ -8,6 +9,12 @@ import (
|
||||
)
|
||||
|
||||
func TestSetup(t *testing.T) {
|
||||
// Skip on non-Linux systems as some tests refer to for e.g. loopback interfaces which
|
||||
// are not present on all systems.
|
||||
if runtime.GOOS != "linux" {
|
||||
t.Skipf("Skipping bind test on %s", runtime.GOOS)
|
||||
}
|
||||
|
||||
for i, test := range []struct {
|
||||
config string
|
||||
expected []string
|
||||
|
||||
Reference in New Issue
Block a user