Merge pull request #38482 from thaJeztah/skip_consistently
Improve consistency in skipping tests
This commit is contained in:
commit
e8592828eb
16 changed files with 34 additions and 34 deletions
|
@ -29,7 +29,6 @@ import (
|
|||
func TestContainerStartOnDaemonRestart(t *testing.T) {
|
||||
skip.If(t, testEnv.IsRemoteDaemon, "cannot start daemon on remote test run")
|
||||
skip.If(t, testEnv.DaemonInfo.OSType == "windows")
|
||||
skip.If(t, testEnv.IsRemoteDaemon(), "cannot start daemon on remote test run")
|
||||
t.Parallel()
|
||||
|
||||
d := daemon.New(t)
|
||||
|
|
|
@ -58,7 +58,7 @@ func TestExportContainerAndImportImage(t *testing.T) {
|
|||
// condition, daemon restart is needed after container creation.
|
||||
func TestExportContainerAfterDaemonRestart(t *testing.T) {
|
||||
skip.If(t, testEnv.DaemonInfo.OSType == "windows")
|
||||
skip.If(t, testEnv.IsRemoteDaemon())
|
||||
skip.If(t, testEnv.IsRemoteDaemon)
|
||||
|
||||
d := daemon.New(t)
|
||||
c := d.NewClientT(t)
|
||||
|
|
|
@ -92,7 +92,7 @@ func testIpcNonePrivateShareable(t *testing.T, mode string, mustBeMounted bool,
|
|||
// (--ipc none) works as expected. It makes sure there is no
|
||||
// /dev/shm mount inside the container.
|
||||
func TestIpcModeNone(t *testing.T) {
|
||||
skip.If(t, testEnv.DaemonInfo.OSType != "linux" || testEnv.IsRemoteDaemon())
|
||||
skip.If(t, testEnv.IsRemoteDaemon)
|
||||
|
||||
testIpcNonePrivateShareable(t, "none", false, false)
|
||||
}
|
||||
|
@ -102,7 +102,7 @@ func TestIpcModeNone(t *testing.T) {
|
|||
// of /dev/shm mount from the container, and makes sure there is no
|
||||
// such pair on the host.
|
||||
func TestIpcModePrivate(t *testing.T) {
|
||||
skip.If(t, testEnv.DaemonInfo.OSType != "linux" || testEnv.IsRemoteDaemon())
|
||||
skip.If(t, testEnv.IsRemoteDaemon)
|
||||
|
||||
testIpcNonePrivateShareable(t, "private", true, false)
|
||||
}
|
||||
|
@ -112,7 +112,7 @@ func TestIpcModePrivate(t *testing.T) {
|
|||
// of /dev/shm mount from the container, and makes sure such pair
|
||||
// also exists on the host.
|
||||
func TestIpcModeShareable(t *testing.T) {
|
||||
skip.If(t, testEnv.DaemonInfo.OSType != "linux" || testEnv.IsRemoteDaemon())
|
||||
skip.If(t, testEnv.IsRemoteDaemon)
|
||||
|
||||
testIpcNonePrivateShareable(t, "shareable", true, true)
|
||||
}
|
||||
|
@ -175,7 +175,7 @@ func testIpcContainer(t *testing.T, donorMode string, mustWork bool) {
|
|||
// 1) a container created with --ipc container:ID can use IPC of another shareable container.
|
||||
// 2) a container created with --ipc container:ID can NOT use IPC of another private container.
|
||||
func TestAPIIpcModeShareableAndContainer(t *testing.T) {
|
||||
skip.If(t, testEnv.DaemonInfo.OSType != "linux")
|
||||
skip.If(t, testEnv.IsRemoteDaemon)
|
||||
|
||||
testIpcContainer(t, "shareable", true)
|
||||
|
||||
|
@ -186,7 +186,8 @@ func TestAPIIpcModeShareableAndContainer(t *testing.T) {
|
|||
* can use IPC of the host system.
|
||||
*/
|
||||
func TestAPIIpcModeHost(t *testing.T) {
|
||||
skip.If(t, testEnv.DaemonInfo.OSType != "linux" || testEnv.IsRemoteDaemon() || testEnv.IsUserNamespace())
|
||||
skip.If(t, testEnv.IsRemoteDaemon)
|
||||
skip.If(t, testEnv.IsUserNamespace)
|
||||
|
||||
cfg := containertypes.Config{
|
||||
Image: "busybox",
|
||||
|
@ -257,14 +258,14 @@ func testDaemonIpcPrivateShareable(t *testing.T, mustBeShared bool, arg ...strin
|
|||
|
||||
// TestDaemonIpcModeShareable checks that --default-ipc-mode shareable works as intended.
|
||||
func TestDaemonIpcModeShareable(t *testing.T) {
|
||||
skip.If(t, testEnv.DaemonInfo.OSType != "linux" || testEnv.IsRemoteDaemon())
|
||||
skip.If(t, testEnv.IsRemoteDaemon)
|
||||
|
||||
testDaemonIpcPrivateShareable(t, true, "--default-ipc-mode", "shareable")
|
||||
}
|
||||
|
||||
// TestDaemonIpcModePrivate checks that --default-ipc-mode private works as intended.
|
||||
func TestDaemonIpcModePrivate(t *testing.T) {
|
||||
skip.If(t, testEnv.DaemonInfo.OSType != "linux" || testEnv.IsRemoteDaemon())
|
||||
skip.If(t, testEnv.IsRemoteDaemon)
|
||||
|
||||
testDaemonIpcPrivateShareable(t, false, "--default-ipc-mode", "private")
|
||||
}
|
||||
|
@ -280,14 +281,14 @@ func testDaemonIpcFromConfig(t *testing.T, mode string, mustExist bool) {
|
|||
|
||||
// TestDaemonIpcModePrivateFromConfig checks that "default-ipc-mode: private" config works as intended.
|
||||
func TestDaemonIpcModePrivateFromConfig(t *testing.T) {
|
||||
skip.If(t, testEnv.DaemonInfo.OSType != "linux" || testEnv.IsRemoteDaemon())
|
||||
skip.If(t, testEnv.IsRemoteDaemon)
|
||||
|
||||
testDaemonIpcFromConfig(t, "private", false)
|
||||
}
|
||||
|
||||
// TestDaemonIpcModeShareableFromConfig checks that "default-ipc-mode: shareable" config works as intended.
|
||||
func TestDaemonIpcModeShareableFromConfig(t *testing.T) {
|
||||
skip.If(t, testEnv.DaemonInfo.OSType != "linux" || testEnv.IsRemoteDaemon())
|
||||
skip.If(t, testEnv.IsRemoteDaemon)
|
||||
|
||||
testDaemonIpcFromConfig(t, "shareable", true)
|
||||
}
|
|
@ -15,7 +15,7 @@ import (
|
|||
)
|
||||
|
||||
func TestLinksEtcHostsContentMatch(t *testing.T) {
|
||||
skip.If(t, testEnv.IsRemoteDaemon())
|
||||
skip.If(t, testEnv.IsRemoteDaemon)
|
||||
|
||||
hosts, err := ioutil.ReadFile("/etc/hosts")
|
||||
skip.If(t, os.IsNotExist(err))
|
||||
|
|
|
@ -16,7 +16,7 @@ import (
|
|||
// Makes sure that when following we don't get an EOF error when there are no logs
|
||||
func TestLogsFollowTailEmpty(t *testing.T) {
|
||||
// FIXME(vdemeester) fails on a e2e run on linux...
|
||||
skip.If(t, testEnv.IsRemoteDaemon())
|
||||
skip.If(t, testEnv.IsRemoteDaemon)
|
||||
defer setupTest(t)()
|
||||
client := testEnv.APIClient()
|
||||
ctx := context.Background()
|
||||
|
|
|
@ -25,7 +25,7 @@ import (
|
|||
|
||||
func TestContainerNetworkMountsNoChown(t *testing.T) {
|
||||
// chown only applies to Linux bind mounted volumes; must be same host to verify
|
||||
skip.If(t, testEnv.DaemonInfo.OSType == "windows" || testEnv.IsRemoteDaemon())
|
||||
skip.If(t, testEnv.IsRemoteDaemon)
|
||||
|
||||
defer setupTest(t)()
|
||||
|
||||
|
@ -85,7 +85,7 @@ func TestContainerNetworkMountsNoChown(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestMountDaemonRoot(t *testing.T) {
|
||||
skip.If(t, testEnv.DaemonInfo.OSType == "windows" || testEnv.IsRemoteDaemon())
|
||||
skip.If(t, testEnv.IsRemoteDaemon)
|
||||
|
||||
defer setupTest(t)()
|
||||
client := testEnv.APIClient()
|
||||
|
@ -212,7 +212,7 @@ func TestMountDaemonRoot(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestContainerBindMountNonRecursive(t *testing.T) {
|
||||
skip.If(t, testEnv.DaemonInfo.OSType != "linux" || testEnv.IsRemoteDaemon())
|
||||
skip.If(t, testEnv.IsRemoteDaemon)
|
||||
skip.If(t, versions.LessThan(testEnv.DaemonAPIVersion(), "1.40"), "BindOptions.NonRecursive requires API v1.40")
|
||||
|
||||
defer setupTest(t)()
|
||||
|
|
|
@ -22,7 +22,7 @@ import (
|
|||
|
||||
func TestNetworkNat(t *testing.T) {
|
||||
skip.If(t, testEnv.OSType == "windows", "FIXME")
|
||||
skip.If(t, testEnv.IsRemoteDaemon())
|
||||
skip.If(t, testEnv.IsRemoteDaemon)
|
||||
|
||||
defer setupTest(t)()
|
||||
|
||||
|
@ -41,7 +41,7 @@ func TestNetworkNat(t *testing.T) {
|
|||
|
||||
func TestNetworkLocalhostTCPNat(t *testing.T) {
|
||||
skip.If(t, testEnv.DaemonInfo.OSType == "windows", "FIXME")
|
||||
skip.If(t, testEnv.IsRemoteDaemon())
|
||||
skip.If(t, testEnv.IsRemoteDaemon)
|
||||
|
||||
defer setupTest(t)()
|
||||
|
||||
|
@ -59,7 +59,7 @@ func TestNetworkLocalhostTCPNat(t *testing.T) {
|
|||
|
||||
func TestNetworkLoopbackNat(t *testing.T) {
|
||||
skip.If(t, testEnv.OSType == "windows", "FIXME")
|
||||
skip.If(t, testEnv.IsRemoteDaemon())
|
||||
skip.If(t, testEnv.IsRemoteDaemon)
|
||||
|
||||
defer setupTest(t)()
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ func getPrefixAndSlashFromDaemonPlatform() (prefix, slash string) {
|
|||
|
||||
// Test case for #5244: `docker rm` fails if bind dir doesn't exist anymore
|
||||
func TestRemoveContainerWithRemovedVolume(t *testing.T) {
|
||||
skip.If(t, testEnv.IsRemoteDaemon())
|
||||
skip.If(t, testEnv.IsRemoteDaemon)
|
||||
|
||||
defer setupTest(t)()
|
||||
ctx := context.Background()
|
||||
|
|
|
@ -190,7 +190,7 @@ func TestRenameContainerWithSameName(t *testing.T) {
|
|||
// of the linked container should be updated so that the other
|
||||
// container could still reference to the container that is renamed.
|
||||
func TestRenameContainerWithLinkedContainer(t *testing.T) {
|
||||
skip.If(t, testEnv.IsRemoteDaemon())
|
||||
skip.If(t, testEnv.IsRemoteDaemon)
|
||||
skip.If(t, testEnv.OSType == "windows", "FIXME")
|
||||
|
||||
defer setupTest(t)()
|
||||
|
|
|
@ -72,7 +72,7 @@ func TestStopContainerWithTimeout(t *testing.T) {
|
|||
|
||||
func TestDeleteDevicemapper(t *testing.T) {
|
||||
skip.If(t, testEnv.DaemonInfo.Driver != "devicemapper")
|
||||
skip.If(t, testEnv.IsRemoteDaemon, "cannot start daemon on remote test run")
|
||||
skip.If(t, testEnv.IsRemoteDaemon)
|
||||
|
||||
defer setupTest(t)()
|
||||
client := testEnv.APIClient()
|
||||
|
|
|
@ -20,7 +20,7 @@ import (
|
|||
func TestDockerNetworkIpvlanPersistance(t *testing.T) {
|
||||
// verify the driver automatically provisions the 802.1q link (di-dummy0.70)
|
||||
skip.If(t, testEnv.DaemonInfo.OSType == "windows")
|
||||
skip.If(t, testEnv.IsRemoteDaemon())
|
||||
skip.If(t, testEnv.IsRemoteDaemon)
|
||||
skip.If(t, !ipvlanKernelSupport(), "Kernel doesn't support ipvlan")
|
||||
|
||||
d := daemon.New(t, daemon.WithExperimental)
|
||||
|
@ -48,7 +48,7 @@ func TestDockerNetworkIpvlanPersistance(t *testing.T) {
|
|||
|
||||
func TestDockerNetworkIpvlan(t *testing.T) {
|
||||
skip.If(t, testEnv.DaemonInfo.OSType == "windows")
|
||||
skip.If(t, testEnv.IsRemoteDaemon())
|
||||
skip.If(t, testEnv.IsRemoteDaemon)
|
||||
skip.If(t, !ipvlanKernelSupport(), "Kernel doesn't support ipvlan")
|
||||
|
||||
for _, tc := range []struct {
|
||||
|
|
|
@ -19,7 +19,7 @@ import (
|
|||
|
||||
func TestDockerNetworkMacvlanPersistance(t *testing.T) {
|
||||
// verify the driver automatically provisions the 802.1q link (dm-dummy0.60)
|
||||
skip.If(t, testEnv.IsRemoteDaemon())
|
||||
skip.If(t, testEnv.IsRemoteDaemon)
|
||||
skip.If(t, !macvlanKernelSupport(), "Kernel doesn't support macvlan")
|
||||
|
||||
d := daemon.New(t)
|
||||
|
@ -42,7 +42,7 @@ func TestDockerNetworkMacvlanPersistance(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestDockerNetworkMacvlan(t *testing.T) {
|
||||
skip.If(t, testEnv.IsRemoteDaemon())
|
||||
skip.If(t, testEnv.IsRemoteDaemon)
|
||||
skip.If(t, !macvlanKernelSupport(), "Kernel doesn't support macvlan")
|
||||
|
||||
for _, tc := range []struct {
|
||||
|
|
|
@ -27,7 +27,7 @@ func delInterface(t *testing.T, ifName string) {
|
|||
|
||||
func TestDaemonRestartWithLiveRestore(t *testing.T) {
|
||||
skip.If(t, testEnv.OSType == "windows")
|
||||
skip.If(t, testEnv.IsRemoteDaemon())
|
||||
skip.If(t, testEnv.IsRemoteDaemon)
|
||||
skip.If(t, versions.LessThan(testEnv.DaemonAPIVersion(), "1.38"), "skip test from new feature")
|
||||
d := daemon.New(t)
|
||||
defer d.Stop(t)
|
||||
|
@ -50,7 +50,7 @@ func TestDaemonRestartWithLiveRestore(t *testing.T) {
|
|||
func TestDaemonDefaultNetworkPools(t *testing.T) {
|
||||
skip.If(t, testEnv.OSType == "windows")
|
||||
// Remove docker0 bridge and the start daemon defining the predefined address pools
|
||||
skip.If(t, testEnv.IsRemoteDaemon())
|
||||
skip.If(t, testEnv.IsRemoteDaemon)
|
||||
skip.If(t, versions.LessThan(testEnv.DaemonAPIVersion(), "1.38"), "skip test from new feature")
|
||||
defaultNetworkBridge := "docker0"
|
||||
delInterface(t, defaultNetworkBridge)
|
||||
|
@ -92,7 +92,7 @@ func TestDaemonDefaultNetworkPools(t *testing.T) {
|
|||
|
||||
func TestDaemonRestartWithExistingNetwork(t *testing.T) {
|
||||
skip.If(t, testEnv.OSType == "windows")
|
||||
skip.If(t, testEnv.IsRemoteDaemon())
|
||||
skip.If(t, testEnv.IsRemoteDaemon)
|
||||
skip.If(t, versions.LessThan(testEnv.DaemonAPIVersion(), "1.38"), "skip test from new feature")
|
||||
defaultNetworkBridge := "docker0"
|
||||
d := daemon.New(t)
|
||||
|
@ -125,7 +125,7 @@ func TestDaemonRestartWithExistingNetwork(t *testing.T) {
|
|||
|
||||
func TestDaemonRestartWithExistingNetworkWithDefaultPoolRange(t *testing.T) {
|
||||
skip.If(t, testEnv.OSType == "windows")
|
||||
skip.If(t, testEnv.IsRemoteDaemon())
|
||||
skip.If(t, testEnv.IsRemoteDaemon)
|
||||
skip.If(t, versions.LessThan(testEnv.DaemonAPIVersion(), "1.38"), "skip test from new feature")
|
||||
defaultNetworkBridge := "docker0"
|
||||
d := daemon.New(t)
|
||||
|
@ -175,7 +175,7 @@ func TestDaemonRestartWithExistingNetworkWithDefaultPoolRange(t *testing.T) {
|
|||
|
||||
func TestDaemonWithBipAndDefaultNetworkPool(t *testing.T) {
|
||||
skip.If(t, testEnv.OSType == "windows")
|
||||
skip.If(t, testEnv.IsRemoteDaemon())
|
||||
skip.If(t, testEnv.IsRemoteDaemon)
|
||||
skip.If(t, versions.LessThan(testEnv.DaemonAPIVersion(), "1.38"), "skip test from new feature")
|
||||
defaultNetworkBridge := "docker0"
|
||||
d := daemon.New(t)
|
||||
|
|
|
@ -16,7 +16,7 @@ import (
|
|||
)
|
||||
|
||||
func TestContinueAfterPluginCrash(t *testing.T) {
|
||||
skip.If(t, testEnv.IsRemoteDaemon(), "test requires daemon on the same host")
|
||||
skip.If(t, testEnv.IsRemoteDaemon, "test requires daemon on the same host")
|
||||
t.Parallel()
|
||||
|
||||
d := daemon.New(t)
|
||||
|
|
|
@ -19,7 +19,7 @@ import (
|
|||
)
|
||||
|
||||
func TestInspect(t *testing.T) {
|
||||
skip.If(t, testEnv.IsRemoteDaemon())
|
||||
skip.If(t, testEnv.IsRemoteDaemon)
|
||||
skip.If(t, testEnv.DaemonInfo.OSType == "windows")
|
||||
defer setupTest(t)()
|
||||
d := swarm.NewSwarm(t, testEnv)
|
||||
|
|
|
@ -66,7 +66,7 @@ func New(t testingT, dir string, modifiers ...func(*fakecontext.Fake) error) Fak
|
|||
ctx := fakecontext.New(t, dir, modifiers...)
|
||||
switch {
|
||||
case testEnv.IsRemoteDaemon() && strings.HasPrefix(request.DaemonHost(), "unix:///"):
|
||||
t.Skip(fmt.Sprintf("e2e run : daemon is remote but docker host points to a unix socket"))
|
||||
t.Skip("e2e run : daemon is remote but docker host points to a unix socket")
|
||||
case testEnv.IsLocalDaemon():
|
||||
return newLocalFakeStorage(ctx)
|
||||
default:
|
||||
|
|
Loading…
Add table
Reference in a new issue