Improve consistency in "skip"

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit a3948d17d3)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2019-01-03 12:19:15 +01:00
parent e438d4799d
commit cdedf9ae3e
No known key found for this signature in database
GPG key ID: 76698F39D527CE8C
12 changed files with 19 additions and 20 deletions

View file

@ -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)

View file

@ -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)

View file

@ -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))

View file

@ -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()

View file

@ -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)()

View file

@ -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()

View file

@ -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)()

View file

@ -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 {

View file

@ -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 {

View file

@ -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)

View file

@ -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)

View file

@ -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)