1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

add api version checking for tests from new feature

Signed-off-by: Anda Xu <anda.xu@docker.com>
This commit is contained in:
Anda Xu 2018-05-29 15:09:11 -07:00
parent 864b36255d
commit 8ed0fdebe7

View file

@ -7,6 +7,7 @@ import (
"github.com/docker/docker/api/types" "github.com/docker/docker/api/types"
swarmtypes "github.com/docker/docker/api/types/swarm" swarmtypes "github.com/docker/docker/api/types/swarm"
"github.com/docker/docker/api/types/versions"
"github.com/docker/docker/client" "github.com/docker/docker/client"
"github.com/docker/docker/integration/internal/swarm" "github.com/docker/docker/integration/internal/swarm"
"github.com/docker/docker/internal/test/daemon" "github.com/docker/docker/internal/test/daemon"
@ -24,7 +25,7 @@ func delInterface(t *testing.T, ifName string) {
} }
func TestDaemonRestartWithLiveRestore(t *testing.T) { func TestDaemonRestartWithLiveRestore(t *testing.T) {
skip.If(t, testEnv.IsRemoteDaemon()) skip.If(t, testEnv.IsRemoteDaemon(), versions.LessThan(testEnv.DaemonAPIVersion(), "1.38"))
d := daemon.New(t) d := daemon.New(t)
defer d.Stop(t) defer d.Stop(t)
d.Start(t) d.Start(t)
@ -44,7 +45,7 @@ func TestDaemonRestartWithLiveRestore(t *testing.T) {
func TestDaemonDefaultNetworkPools(t *testing.T) { func TestDaemonDefaultNetworkPools(t *testing.T) {
// Remove docker0 bridge and the start daemon defining the predefined address pools // Remove docker0 bridge and the start daemon defining the predefined address pools
skip.If(t, testEnv.IsRemoteDaemon()) skip.If(t, testEnv.IsRemoteDaemon(), versions.LessThan(testEnv.DaemonAPIVersion(), "1.38"))
defaultNetworkBridge := "docker0" defaultNetworkBridge := "docker0"
delInterface(t, defaultNetworkBridge) delInterface(t, defaultNetworkBridge)
d := daemon.New(t) d := daemon.New(t)
@ -89,7 +90,7 @@ func TestDaemonDefaultNetworkPools(t *testing.T) {
} }
func TestDaemonRestartWithExistingNetwork(t *testing.T) { func TestDaemonRestartWithExistingNetwork(t *testing.T) {
skip.If(t, testEnv.IsRemoteDaemon()) skip.If(t, testEnv.IsRemoteDaemon(), versions.LessThan(testEnv.DaemonAPIVersion(), "1.38"))
defaultNetworkBridge := "docker0" defaultNetworkBridge := "docker0"
d := daemon.New(t) d := daemon.New(t)
d.Start(t) d.Start(t)
@ -123,7 +124,7 @@ func TestDaemonRestartWithExistingNetwork(t *testing.T) {
} }
func TestDaemonRestartWithExistingNetworkWithDefaultPoolRange(t *testing.T) { func TestDaemonRestartWithExistingNetworkWithDefaultPoolRange(t *testing.T) {
skip.If(t, testEnv.IsRemoteDaemon()) skip.If(t, testEnv.IsRemoteDaemon(), versions.LessThan(testEnv.DaemonAPIVersion(), "1.38"))
defaultNetworkBridge := "docker0" defaultNetworkBridge := "docker0"
d := daemon.New(t) d := daemon.New(t)
d.Start(t) d.Start(t)
@ -179,7 +180,7 @@ func TestDaemonRestartWithExistingNetworkWithDefaultPoolRange(t *testing.T) {
} }
func TestDaemonWithBipAndDefaultNetworkPool(t *testing.T) { func TestDaemonWithBipAndDefaultNetworkPool(t *testing.T) {
skip.If(t, testEnv.IsRemoteDaemon()) skip.If(t, testEnv.IsRemoteDaemon(), versions.LessThan(testEnv.DaemonAPIVersion(), "1.38"))
defaultNetworkBridge := "docker0" defaultNetworkBridge := "docker0"
d := daemon.New(t) d := daemon.New(t)
defer d.Stop(t) defer d.Stop(t)