mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
integration/network: remove IsUserNamespace in favor of testenv equivalent
We're already using testenv here, so might as well use the exact same function that it provides. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
7681a3eb40
commit
8a25d752a9
4 changed files with 2 additions and 16 deletions
|
@ -16,7 +16,7 @@ import (
|
|||
func TestDaemonDNSFallback(t *testing.T) {
|
||||
skip.If(t, testEnv.IsRemoteDaemon, "cannot start daemon on remote test run")
|
||||
skip.If(t, testEnv.DaemonInfo.OSType != "linux")
|
||||
skip.If(t, IsUserNamespace())
|
||||
skip.If(t, testEnv.IsUserNamespace)
|
||||
|
||||
d := daemon.New(t)
|
||||
d.StartWithBusybox(t, "-b", "none", "--dns", "127.127.127.1", "--dns", "8.8.8.8")
|
||||
|
|
|
@ -5,7 +5,6 @@ package network
|
|||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
"github.com/docker/docker/api/types"
|
||||
|
@ -86,9 +85,3 @@ func CheckKernelMajorVersionGreaterOrEqualThen(kernelVersion int, majorVersion i
|
|||
}
|
||||
return true
|
||||
}
|
||||
|
||||
// IsUserNamespace returns whether the user namespace remapping is enabled
|
||||
func IsUserNamespace() bool {
|
||||
root := os.Getenv("DOCKER_REMAP_ROOT")
|
||||
return root != ""
|
||||
}
|
||||
|
|
|
@ -3,7 +3,6 @@ package network
|
|||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/docker/docker/api/types"
|
||||
"github.com/docker/docker/client"
|
||||
|
@ -41,9 +40,3 @@ func IsNetworkNotAvailable(c client.NetworkAPIClient, name string) cmp.Compariso
|
|||
return cmp.ResultSuccess
|
||||
}
|
||||
}
|
||||
|
||||
// IsUserNamespace returns whether the user namespace remapping is enabled
|
||||
func IsUserNamespace() bool {
|
||||
root := os.Getenv("DOCKER_REMAP_ROOT")
|
||||
return root != ""
|
||||
}
|
||||
|
|
|
@ -23,7 +23,7 @@ import (
|
|||
func TestRunContainerWithBridgeNone(t *testing.T) {
|
||||
skip.If(t, testEnv.IsRemoteDaemon, "cannot start daemon on remote test run")
|
||||
skip.If(t, testEnv.DaemonInfo.OSType != "linux")
|
||||
skip.If(t, IsUserNamespace())
|
||||
skip.If(t, testEnv.IsUserNamespace)
|
||||
skip.If(t, testEnv.IsRootless, "rootless mode has different view of network")
|
||||
|
||||
d := daemon.New(t)
|
||||
|
|
Loading…
Add table
Reference in a new issue