Bläddra i källkod

libnetwork: rename unix-only testfiles

Some tests were implicitly skipped through the `getTestEnv()` utility,
which made it hard to discover they were not ran on Windows.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Sebastiaan van Stijn 1 år sedan
förälder
incheckning
c0562d4eed

+ 0 - 0
libnetwork/endpoint_test.go → libnetwork/endpoint_unix_test.go


+ 2 - 4
libnetwork/sandbox_test.go → libnetwork/sandbox_unix_test.go

@@ -1,7 +1,8 @@
+//go:build !windows
+
 package libnetwork
 
 import (
-	"runtime"
 	"strconv"
 	"testing"
 
@@ -11,12 +12,9 @@ import (
 	"github.com/docker/docker/libnetwork/netlabel"
 	"github.com/docker/docker/libnetwork/options"
 	"github.com/docker/docker/libnetwork/osl"
-	"gotest.tools/v3/skip"
 )
 
 func getTestEnv(t *testing.T, opts ...[]NetworkOption) (*Controller, []*Network) {
-	skip.If(t, runtime.GOOS == "windows", "test only works on linux")
-
 	const netType = "bridge"
 	c, err := New(
 		OptionBoltdbWithRandomDBFile(t),

+ 2 - 4
libnetwork/service_common_test.go → libnetwork/service_common_unix_test.go

@@ -1,18 +1,16 @@
+//go:build !windows
+
 package libnetwork
 
 import (
 	"net"
-	"runtime"
 	"testing"
 
 	"github.com/docker/docker/internal/testutils/netnsutils"
 	"gotest.tools/v3/assert"
-	"gotest.tools/v3/skip"
 )
 
 func TestCleanupServiceDiscovery(t *testing.T) {
-	skip.If(t, runtime.GOOS == "windows", "test only works on linux")
-
 	defer netnsutils.SetupTestOSContext(t)()
 	c, err := New()
 	assert.NilError(t, err)