Make experimental a runtime flag
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com> Upstream-commit: 7781a1bf0fef748877326632b88e92fbf3c90daa Component: engine
This commit is contained in:
@ -266,7 +266,11 @@ func (s *DockerSwarmSuite) AddDaemon(c *check.C, joinSwarm, manager bool) *Swarm
|
||||
port: defaultSwarmPort + s.portIndex,
|
||||
}
|
||||
d.listenAddr = fmt.Sprintf("0.0.0.0:%d", d.port)
|
||||
err := d.StartWithBusybox("--iptables=false", "--swarm-default-advertise-addr=lo") // avoid networking conflicts
|
||||
args := []string{"--iptables=false", "--swarm-default-advertise-addr=lo"} // avoid networking conflicts
|
||||
if experimentalDaemon {
|
||||
args = append(args, "--experimental")
|
||||
}
|
||||
err := d.StartWithBusybox(args...)
|
||||
c.Assert(err, check.IsNil)
|
||||
|
||||
if joinSwarm == true {
|
||||
|
||||
@ -153,6 +153,9 @@ func (d *Daemon) StartWithLogFile(out *os.File, providedArgs ...string) error {
|
||||
"--pidfile", fmt.Sprintf("%s/docker.pid", d.folder),
|
||||
fmt.Sprintf("--userland-proxy=%t", d.userlandProxy),
|
||||
)
|
||||
if experimentalDaemon {
|
||||
args = append(args, "--experimental")
|
||||
}
|
||||
if !(d.useDefaultHost || d.useDefaultTLSHost) {
|
||||
args = append(args, []string{"--host", d.sock()}...)
|
||||
}
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// +build linux, experimental
|
||||
// +build linux
|
||||
|
||||
package main
|
||||
|
||||
@ -17,7 +17,8 @@ var pluginName = "tiborvass/no-remove"
|
||||
|
||||
// TestDaemonRestartWithPluginEnabled tests state restore for an enabled plugin
|
||||
func (s *DockerDaemonSuite) TestDaemonRestartWithPluginEnabled(c *check.C) {
|
||||
testRequires(c, Network)
|
||||
testRequires(c, Network, ExperimentalDaemon)
|
||||
|
||||
if err := s.d.Start(); err != nil {
|
||||
c.Fatalf("Could not start daemon: %v", err)
|
||||
}
|
||||
@ -49,7 +50,8 @@ func (s *DockerDaemonSuite) TestDaemonRestartWithPluginEnabled(c *check.C) {
|
||||
|
||||
// TestDaemonRestartWithPluginDisabled tests state restore for a disabled plugin
|
||||
func (s *DockerDaemonSuite) TestDaemonRestartWithPluginDisabled(c *check.C) {
|
||||
testRequires(c, Network)
|
||||
testRequires(c, Network, ExperimentalDaemon)
|
||||
|
||||
if err := s.d.Start(); err != nil {
|
||||
c.Fatalf("Could not start daemon: %v", err)
|
||||
}
|
||||
@ -79,7 +81,8 @@ func (s *DockerDaemonSuite) TestDaemonRestartWithPluginDisabled(c *check.C) {
|
||||
// TestDaemonKillLiveRestoreWithPlugins SIGKILLs daemon started with --live-restore.
|
||||
// Plugins should continue to run.
|
||||
func (s *DockerDaemonSuite) TestDaemonKillLiveRestoreWithPlugins(c *check.C) {
|
||||
testRequires(c, Network)
|
||||
testRequires(c, Network, ExperimentalDaemon)
|
||||
|
||||
if err := s.d.Start("--live-restore"); err != nil {
|
||||
c.Fatalf("Could not start daemon: %v", err)
|
||||
}
|
||||
@ -111,7 +114,8 @@ func (s *DockerDaemonSuite) TestDaemonKillLiveRestoreWithPlugins(c *check.C) {
|
||||
// TestDaemonShutdownLiveRestoreWithPlugins SIGTERMs daemon started with --live-restore.
|
||||
// Plugins should continue to run.
|
||||
func (s *DockerDaemonSuite) TestDaemonShutdownLiveRestoreWithPlugins(c *check.C) {
|
||||
testRequires(c, Network)
|
||||
testRequires(c, Network, ExperimentalDaemon)
|
||||
|
||||
if err := s.d.Start("--live-restore"); err != nil {
|
||||
c.Fatalf("Could not start daemon: %v", err)
|
||||
}
|
||||
@ -142,7 +146,8 @@ func (s *DockerDaemonSuite) TestDaemonShutdownLiveRestoreWithPlugins(c *check.C)
|
||||
|
||||
// TestDaemonShutdownWithPlugins shuts down running plugins.
|
||||
func (s *DockerDaemonSuite) TestDaemonShutdownWithPlugins(c *check.C) {
|
||||
testRequires(c, Network)
|
||||
testRequires(c, Network, ExperimentalDaemon)
|
||||
|
||||
if err := s.d.Start(); err != nil {
|
||||
c.Fatalf("Could not start daemon: %v", err)
|
||||
}
|
||||
@ -180,7 +185,8 @@ func (s *DockerDaemonSuite) TestDaemonShutdownWithPlugins(c *check.C) {
|
||||
|
||||
// TestVolumePlugin tests volume creation using a plugin.
|
||||
func (s *DockerDaemonSuite) TestVolumePlugin(c *check.C) {
|
||||
testRequires(c, Network)
|
||||
testRequires(c, Network, ExperimentalDaemon)
|
||||
|
||||
volName := "plugin-volume"
|
||||
volRoot := "/data"
|
||||
destDir := "/tmp/data/"
|
||||
|
||||
@ -1,21 +1,36 @@
|
||||
// +build experimental
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"github.com/docker/docker/pkg/integration/checker"
|
||||
"github.com/go-check/check"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func (s *DockerSuite) TestExperimentalVersion(c *check.C) {
|
||||
func (s *DockerSuite) TestExperimentalVersionTrue(c *check.C) {
|
||||
testRequires(c, ExperimentalDaemon)
|
||||
|
||||
out, _ := dockerCmd(c, "version")
|
||||
for _, line := range strings.Split(out, "\n") {
|
||||
if strings.HasPrefix(line, "Experimental (client):") || strings.HasPrefix(line, "Experimental (server):") {
|
||||
if strings.HasPrefix(strings.TrimSpace(line), "Experimental:") {
|
||||
c.Assert(line, checker.Matches, "*true")
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
out, _ = dockerCmd(c, "-v")
|
||||
c.Assert(out, checker.Contains, ", experimental", check.Commentf("docker version did not contain experimental"))
|
||||
c.Fatal(`"Experimental" not found in version output`)
|
||||
}
|
||||
|
||||
func (s *DockerSuite) TestExperimentalVersionFalse(c *check.C) {
|
||||
testRequires(c, NotExperimentalDaemon)
|
||||
|
||||
out, _ := dockerCmd(c, "version")
|
||||
for _, line := range strings.Split(out, "\n") {
|
||||
if strings.HasPrefix(strings.TrimSpace(line), "Experimental:") {
|
||||
c.Assert(line, checker.Matches, "*false")
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
c.Fatal(`"Experimental" not found in version output`)
|
||||
}
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
// +build experimental
|
||||
// +build !windows
|
||||
|
||||
package main
|
||||
@ -287,7 +286,7 @@ func (s *DockerExternalGraphdriverSuite) setUpPlugin(c *check.C, name string, ex
|
||||
|
||||
mux.HandleFunc("/GraphDriver.ApplyDiff", func(w http.ResponseWriter, r *http.Request) {
|
||||
s.ec[ext].applydiff++
|
||||
var diff io.Reader = r.Body
|
||||
diff := r.Body
|
||||
defer r.Body.Close()
|
||||
|
||||
id := r.URL.Query().Get("id")
|
||||
@ -338,6 +337,8 @@ func (s *DockerExternalGraphdriverSuite) TearDownSuite(c *check.C) {
|
||||
}
|
||||
|
||||
func (s *DockerExternalGraphdriverSuite) TestExternalGraphDriver(c *check.C) {
|
||||
testRequires(c, ExperimentalDaemon)
|
||||
|
||||
s.testExternalGraphDriver("test-external-graph-driver", "spec", c)
|
||||
s.testExternalGraphDriver("json-external-graph-driver", "json", c)
|
||||
}
|
||||
@ -388,7 +389,8 @@ func (s *DockerExternalGraphdriverSuite) testExternalGraphDriver(name string, ex
|
||||
}
|
||||
|
||||
func (s *DockerExternalGraphdriverSuite) TestExternalGraphDriverPull(c *check.C) {
|
||||
testRequires(c, Network)
|
||||
testRequires(c, Network, ExperimentalDaemon)
|
||||
|
||||
c.Assert(s.d.Start(), check.IsNil)
|
||||
|
||||
out, err := s.d.Cmd("pull", "busybox:latest")
|
||||
|
||||
@ -10,7 +10,6 @@ import (
|
||||
"github.com/docker/docker/pkg/homedir"
|
||||
"github.com/docker/docker/pkg/integration/checker"
|
||||
icmd "github.com/docker/docker/pkg/integration/cmd"
|
||||
"github.com/docker/docker/utils"
|
||||
"github.com/go-check/check"
|
||||
)
|
||||
|
||||
@ -117,7 +116,7 @@ func (s *DockerSuite) TestHelpTextVerify(c *check.C) {
|
||||
cmdsToTest = append(cmdsToTest, "network ls")
|
||||
cmdsToTest = append(cmdsToTest, "network rm")
|
||||
|
||||
if utils.ExperimentalBuild() {
|
||||
if experimentalDaemon {
|
||||
cmdsToTest = append(cmdsToTest, "checkpoint create")
|
||||
cmdsToTest = append(cmdsToTest, "checkpoint ls")
|
||||
cmdsToTest = append(cmdsToTest, "checkpoint rm")
|
||||
|
||||
@ -7,7 +7,6 @@ import (
|
||||
"strings"
|
||||
|
||||
"github.com/docker/docker/pkg/integration/checker"
|
||||
"github.com/docker/docker/utils"
|
||||
"github.com/go-check/check"
|
||||
)
|
||||
|
||||
@ -44,8 +43,10 @@ func (s *DockerSuite) TestInfoEnsureSucceeds(c *check.C) {
|
||||
stringsToCheck = append(stringsToCheck, "Runtimes:", "Default Runtime: runc")
|
||||
}
|
||||
|
||||
if utils.ExperimentalBuild() {
|
||||
if experimentalDaemon {
|
||||
stringsToCheck = append(stringsToCheck, "Experimental: true")
|
||||
} else {
|
||||
stringsToCheck = append(stringsToCheck, "Experimental: false")
|
||||
}
|
||||
|
||||
for _, linePrefix := range stringsToCheck {
|
||||
|
||||
@ -1,5 +1,3 @@
|
||||
// +build experimental
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
@ -11,6 +9,7 @@ import (
|
||||
)
|
||||
|
||||
func (s *DockerSwarmSuite) TestStackRemove(c *check.C) {
|
||||
testRequires(c, ExperimentalDaemon)
|
||||
d := s.AddDaemon(c, true, true)
|
||||
|
||||
stackArgs := append([]string{"stack", "remove", "UNKNOWN_STACK"})
|
||||
@ -21,6 +20,7 @@ func (s *DockerSwarmSuite) TestStackRemove(c *check.C) {
|
||||
}
|
||||
|
||||
func (s *DockerSwarmSuite) TestStackTasks(c *check.C) {
|
||||
testRequires(c, ExperimentalDaemon)
|
||||
d := s.AddDaemon(c, true, true)
|
||||
|
||||
stackArgs := append([]string{"stack", "ps", "UNKNOWN_STACK"})
|
||||
@ -31,6 +31,7 @@ func (s *DockerSwarmSuite) TestStackTasks(c *check.C) {
|
||||
}
|
||||
|
||||
func (s *DockerSwarmSuite) TestStackServices(c *check.C) {
|
||||
testRequires(c, ExperimentalDaemon)
|
||||
d := s.AddDaemon(c, true, true)
|
||||
|
||||
stackArgs := append([]string{"stack", "services", "UNKNOWN_STACK"})
|
||||
@ -59,6 +60,7 @@ const testDAB = `{
|
||||
}`
|
||||
|
||||
func (s *DockerSwarmSuite) TestStackWithDAB(c *check.C) {
|
||||
testRequires(c, ExperimentalDaemon)
|
||||
// setup
|
||||
testStackName := "test"
|
||||
testDABFileName := testStackName + ".dab"
|
||||
@ -92,6 +94,7 @@ func (s *DockerSwarmSuite) TestStackWithDAB(c *check.C) {
|
||||
}
|
||||
|
||||
func (s *DockerSwarmSuite) TestStackWithDABExtension(c *check.C) {
|
||||
testRequires(c, ExperimentalDaemon)
|
||||
// setup
|
||||
testStackName := "test.dab"
|
||||
testDABFileName := testStackName
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// +build experimental
|
||||
// +build !windows
|
||||
|
||||
package main
|
||||
|
||||
@ -50,7 +50,8 @@ var (
|
||||
|
||||
func (s *DockerNetworkSuite) TestDockerNetworkMacvlanPersistance(c *check.C) {
|
||||
// verify the driver automatically provisions the 802.1q link (dm-dummy0.60)
|
||||
testRequires(c, DaemonIsLinux, MacvlanKernelSupport, NotUserNamespace, NotArm)
|
||||
testRequires(c, DaemonIsLinux, MacvlanKernelSupport, NotUserNamespace, NotArm, ExperimentalDaemon)
|
||||
|
||||
// master dummy interface 'dm' abbreviation represents 'docker macvlan'
|
||||
master := "dm-dummy0"
|
||||
// simulate the master link the vlan tagged subinterface parent link will use
|
||||
@ -69,7 +70,7 @@ func (s *DockerNetworkSuite) TestDockerNetworkMacvlanPersistance(c *check.C) {
|
||||
|
||||
func (s *DockerNetworkSuite) TestDockerNetworkIpvlanPersistance(c *check.C) {
|
||||
// verify the driver automatically provisions the 802.1q link (di-dummy0.70)
|
||||
testRequires(c, DaemonIsLinux, IpvlanKernelSupport, NotUserNamespace, NotArm)
|
||||
testRequires(c, DaemonIsLinux, IpvlanKernelSupport, NotUserNamespace, NotArm, ExperimentalDaemon)
|
||||
// master dummy interface 'di' notation represent 'docker ipvlan'
|
||||
master := "di-dummy0"
|
||||
// simulate the master link the vlan tagged subinterface parent link will use
|
||||
@ -88,7 +89,7 @@ func (s *DockerNetworkSuite) TestDockerNetworkIpvlanPersistance(c *check.C) {
|
||||
|
||||
func (s *DockerNetworkSuite) TestDockerNetworkMacvlanSubIntCreate(c *check.C) {
|
||||
// verify the driver automatically provisions the 802.1q link (dm-dummy0.50)
|
||||
testRequires(c, DaemonIsLinux, MacvlanKernelSupport, NotUserNamespace, NotArm)
|
||||
testRequires(c, DaemonIsLinux, MacvlanKernelSupport, NotUserNamespace, NotArm, ExperimentalDaemon)
|
||||
// master dummy interface 'dm' abbreviation represents 'docker macvlan'
|
||||
master := "dm-dummy0"
|
||||
// simulate the master link the vlan tagged subinterface parent link will use
|
||||
@ -103,7 +104,7 @@ func (s *DockerNetworkSuite) TestDockerNetworkMacvlanSubIntCreate(c *check.C) {
|
||||
|
||||
func (s *DockerNetworkSuite) TestDockerNetworkIpvlanSubIntCreate(c *check.C) {
|
||||
// verify the driver automatically provisions the 802.1q link (di-dummy0.50)
|
||||
testRequires(c, DaemonIsLinux, IpvlanKernelSupport, NotUserNamespace, NotArm)
|
||||
testRequires(c, DaemonIsLinux, IpvlanKernelSupport, NotUserNamespace, NotArm, ExperimentalDaemon)
|
||||
// master dummy interface 'dm' abbreviation represents 'docker ipvlan'
|
||||
master := "di-dummy0"
|
||||
// simulate the master link the vlan tagged subinterface parent link will use
|
||||
@ -118,7 +119,7 @@ func (s *DockerNetworkSuite) TestDockerNetworkIpvlanSubIntCreate(c *check.C) {
|
||||
|
||||
func (s *DockerNetworkSuite) TestDockerNetworkMacvlanOverlapParent(c *check.C) {
|
||||
// verify the same parent interface cannot be used if already in use by an existing network
|
||||
testRequires(c, DaemonIsLinux, MacvlanKernelSupport, NotUserNamespace, NotArm)
|
||||
testRequires(c, DaemonIsLinux, MacvlanKernelSupport, NotUserNamespace, NotArm, ExperimentalDaemon)
|
||||
// master dummy interface 'dm' abbreviation represents 'docker macvlan'
|
||||
master := "dm-dummy0"
|
||||
out, err := createMasterDummy(c, master)
|
||||
@ -138,7 +139,7 @@ func (s *DockerNetworkSuite) TestDockerNetworkMacvlanOverlapParent(c *check.C) {
|
||||
|
||||
func (s *DockerNetworkSuite) TestDockerNetworkIpvlanOverlapParent(c *check.C) {
|
||||
// verify the same parent interface cannot be used if already in use by an existing network
|
||||
testRequires(c, DaemonIsLinux, IpvlanKernelSupport, NotUserNamespace, NotArm)
|
||||
testRequires(c, DaemonIsLinux, IpvlanKernelSupport, NotUserNamespace, NotArm, ExperimentalDaemon)
|
||||
// master dummy interface 'dm' abbreviation represents 'docker ipvlan'
|
||||
master := "di-dummy0"
|
||||
out, err := createMasterDummy(c, master)
|
||||
@ -158,7 +159,7 @@ func (s *DockerNetworkSuite) TestDockerNetworkIpvlanOverlapParent(c *check.C) {
|
||||
|
||||
func (s *DockerNetworkSuite) TestDockerNetworkMacvlanMultiSubnet(c *check.C) {
|
||||
// create a dual stack multi-subnet Macvlan bridge mode network and validate connectivity between four containers, two on each subnet
|
||||
testRequires(c, DaemonIsLinux, IPv6, MacvlanKernelSupport, NotUserNamespace, NotArm)
|
||||
testRequires(c, DaemonIsLinux, IPv6, MacvlanKernelSupport, NotUserNamespace, NotArm, ExperimentalDaemon)
|
||||
dockerCmd(c, "network", "create", "--driver=macvlan", "--ipv6", "--subnet=172.28.100.0/24", "--subnet=172.28.102.0/24", "--gateway=172.28.102.254",
|
||||
"--subnet=2001:db8:abc2::/64", "--subnet=2001:db8:abc4::/64", "--gateway=2001:db8:abc4::254", "dualstackbridge")
|
||||
// Ensure the network was created
|
||||
@ -213,7 +214,7 @@ func (s *DockerNetworkSuite) TestDockerNetworkMacvlanMultiSubnet(c *check.C) {
|
||||
|
||||
func (s *DockerNetworkSuite) TestDockerNetworkIpvlanL2MultiSubnet(c *check.C) {
|
||||
// create a dual stack multi-subnet Ipvlan L2 network and validate connectivity within the subnets, two on each subnet
|
||||
testRequires(c, DaemonIsLinux, IPv6, IpvlanKernelSupport, NotUserNamespace, NotArm)
|
||||
testRequires(c, DaemonIsLinux, IPv6, IpvlanKernelSupport, NotUserNamespace, NotArm, ExperimentalDaemon)
|
||||
dockerCmd(c, "network", "create", "--driver=ipvlan", "--ipv6", "--subnet=172.28.200.0/24", "--subnet=172.28.202.0/24", "--gateway=172.28.202.254",
|
||||
"--subnet=2001:db8:abc8::/64", "--subnet=2001:db8:abc6::/64", "--gateway=2001:db8:abc6::254", "dualstackl2")
|
||||
// Ensure the network was created
|
||||
@ -267,7 +268,7 @@ func (s *DockerNetworkSuite) TestDockerNetworkIpvlanL2MultiSubnet(c *check.C) {
|
||||
|
||||
func (s *DockerNetworkSuite) TestDockerNetworkIpvlanL3MultiSubnet(c *check.C) {
|
||||
// create a dual stack multi-subnet Ipvlan L3 network and validate connectivity between all four containers per L3 mode
|
||||
testRequires(c, DaemonIsLinux, IPv6, IpvlanKernelSupport, NotUserNamespace, NotArm, IPv6)
|
||||
testRequires(c, DaemonIsLinux, IPv6, IpvlanKernelSupport, NotUserNamespace, NotArm, IPv6, ExperimentalDaemon)
|
||||
dockerCmd(c, "network", "create", "--driver=ipvlan", "--ipv6", "--subnet=172.28.10.0/24", "--subnet=172.28.12.0/24", "--gateway=172.28.12.254",
|
||||
"--subnet=2001:db8:abc9::/64", "--subnet=2001:db8:abc7::/64", "--gateway=2001:db8:abc7::254", "-o", "ipvlan_mode=l3", "dualstackl3")
|
||||
// Ensure the network was created
|
||||
@ -326,7 +327,7 @@ func (s *DockerNetworkSuite) TestDockerNetworkIpvlanL3MultiSubnet(c *check.C) {
|
||||
|
||||
func (s *DockerNetworkSuite) TestDockerNetworkIpvlanAddressing(c *check.C) {
|
||||
// Ensure the default gateways, next-hops and default dev devices are properly set
|
||||
testRequires(c, DaemonIsLinux, IPv6, IpvlanKernelSupport, NotUserNamespace, NotArm)
|
||||
testRequires(c, DaemonIsLinux, IPv6, IpvlanKernelSupport, NotUserNamespace, NotArm, ExperimentalDaemon)
|
||||
dockerCmd(c, "network", "create", "--driver=macvlan", "--ipv6", "--subnet=172.28.130.0/24",
|
||||
"--subnet=2001:db8:abca::/64", "--gateway=2001:db8:abca::254", "-o", "macvlan_mode=bridge", "dualstackbridge")
|
||||
assertNwIsAvailable(c, "dualstackbridge")
|
||||
@ -372,7 +373,7 @@ func (s *DockerNetworkSuite) TestDockerNetworkIpvlanAddressing(c *check.C) {
|
||||
|
||||
func (s *DockerSuite) TestDockerNetworkMacVlanBridgeNilParent(c *check.C) {
|
||||
// macvlan bridge mode - dummy parent interface is provisioned dynamically
|
||||
testRequires(c, DaemonIsLinux, MacvlanKernelSupport, NotUserNamespace, NotArm)
|
||||
testRequires(c, DaemonIsLinux, MacvlanKernelSupport, NotUserNamespace, NotArm, ExperimentalDaemon)
|
||||
dockerCmd(c, "network", "create", "--driver=macvlan", "dm-nil-parent")
|
||||
assertNwIsAvailable(c, "dm-nil-parent")
|
||||
|
||||
@ -389,7 +390,7 @@ func (s *DockerSuite) TestDockerNetworkMacVlanBridgeNilParent(c *check.C) {
|
||||
|
||||
func (s *DockerSuite) TestDockerNetworkMacVlanBridgeInternalMode(c *check.C) {
|
||||
// macvlan bridge mode --internal containers can communicate inside the network but not externally
|
||||
testRequires(c, DaemonIsLinux, MacvlanKernelSupport, NotUserNamespace, NotArm)
|
||||
testRequires(c, DaemonIsLinux, MacvlanKernelSupport, NotUserNamespace, NotArm, ExperimentalDaemon)
|
||||
dockerCmd(c, "network", "create", "--driver=macvlan", "--internal", "dm-internal")
|
||||
assertNwIsAvailable(c, "dm-internal")
|
||||
nr := getNetworkResource(c, "dm-internal")
|
||||
@ -412,7 +413,7 @@ func (s *DockerSuite) TestDockerNetworkMacVlanBridgeInternalMode(c *check.C) {
|
||||
|
||||
func (s *DockerSuite) TestDockerNetworkIpvlanL2NilParent(c *check.C) {
|
||||
// ipvlan l2 mode - dummy parent interface is provisioned dynamically
|
||||
testRequires(c, DaemonIsLinux, IpvlanKernelSupport, NotUserNamespace, NotArm)
|
||||
testRequires(c, DaemonIsLinux, IpvlanKernelSupport, NotUserNamespace, NotArm, ExperimentalDaemon)
|
||||
dockerCmd(c, "network", "create", "--driver=ipvlan", "di-nil-parent")
|
||||
assertNwIsAvailable(c, "di-nil-parent")
|
||||
|
||||
@ -429,7 +430,7 @@ func (s *DockerSuite) TestDockerNetworkIpvlanL2NilParent(c *check.C) {
|
||||
|
||||
func (s *DockerSuite) TestDockerNetworkIpvlanL2InternalMode(c *check.C) {
|
||||
// ipvlan l2 mode --internal containers can communicate inside the network but not externally
|
||||
testRequires(c, DaemonIsLinux, IpvlanKernelSupport, NotUserNamespace, NotArm)
|
||||
testRequires(c, DaemonIsLinux, IpvlanKernelSupport, NotUserNamespace, NotArm, ExperimentalDaemon)
|
||||
dockerCmd(c, "network", "create", "--driver=ipvlan", "--internal", "di-internal")
|
||||
assertNwIsAvailable(c, "di-internal")
|
||||
nr := getNetworkResource(c, "di-internal")
|
||||
@ -451,7 +452,7 @@ func (s *DockerSuite) TestDockerNetworkIpvlanL2InternalMode(c *check.C) {
|
||||
|
||||
func (s *DockerSuite) TestDockerNetworkIpvlanL3NilParent(c *check.C) {
|
||||
// ipvlan l3 mode - dummy parent interface is provisioned dynamically
|
||||
testRequires(c, DaemonIsLinux, IpvlanKernelSupport, NotUserNamespace, NotArm)
|
||||
testRequires(c, DaemonIsLinux, IpvlanKernelSupport, NotUserNamespace, NotArm, ExperimentalDaemon)
|
||||
dockerCmd(c, "network", "create", "--driver=ipvlan", "--subnet=172.28.230.0/24",
|
||||
"--subnet=172.28.220.0/24", "-o", "ipvlan_mode=l3", "di-nil-parent-l3")
|
||||
assertNwIsAvailable(c, "di-nil-parent-l3")
|
||||
@ -469,7 +470,7 @@ func (s *DockerSuite) TestDockerNetworkIpvlanL3NilParent(c *check.C) {
|
||||
|
||||
func (s *DockerSuite) TestDockerNetworkIpvlanL3InternalMode(c *check.C) {
|
||||
// ipvlan l3 mode --internal containers can communicate inside the network but not externally
|
||||
testRequires(c, DaemonIsLinux, IpvlanKernelSupport, NotUserNamespace, NotArm)
|
||||
testRequires(c, DaemonIsLinux, IpvlanKernelSupport, NotUserNamespace, NotArm, ExperimentalDaemon)
|
||||
dockerCmd(c, "network", "create", "--driver=ipvlan", "--subnet=172.28.230.0/24",
|
||||
"--subnet=172.28.220.0/24", "-o", "ipvlan_mode=l3", "--internal", "di-internal-l3")
|
||||
assertNwIsAvailable(c, "di-internal-l3")
|
||||
@ -492,7 +493,7 @@ func (s *DockerSuite) TestDockerNetworkIpvlanL3InternalMode(c *check.C) {
|
||||
|
||||
func (s *DockerSuite) TestDockerNetworkMacVlanExistingParent(c *check.C) {
|
||||
// macvlan bridge mode - empty parent interface containers can reach each other internally but not externally
|
||||
testRequires(c, DaemonIsLinux, MacvlanKernelSupport, NotUserNamespace, NotArm)
|
||||
testRequires(c, DaemonIsLinux, MacvlanKernelSupport, NotUserNamespace, NotArm, ExperimentalDaemon)
|
||||
netName := "dm-parent-exists"
|
||||
out, err := createMasterDummy(c, "dm-dummy0")
|
||||
//out, err := createVlanInterface(c, "dm-parent", "dm-slave", "macvlan", "bridge")
|
||||
@ -512,7 +513,7 @@ func (s *DockerSuite) TestDockerNetworkMacVlanExistingParent(c *check.C) {
|
||||
|
||||
func (s *DockerSuite) TestDockerNetworkMacVlanSubinterface(c *check.C) {
|
||||
// macvlan bridge mode - empty parent interface containers can reach each other internally but not externally
|
||||
testRequires(c, DaemonIsLinux, MacvlanKernelSupport, NotUserNamespace, NotArm)
|
||||
testRequires(c, DaemonIsLinux, MacvlanKernelSupport, NotUserNamespace, NotArm, ExperimentalDaemon)
|
||||
netName := "dm-subinterface"
|
||||
out, err := createMasterDummy(c, "dm-dummy0")
|
||||
c.Assert(err, check.IsNil, check.Commentf(out))
|
||||
|
||||
@ -61,6 +61,10 @@ var (
|
||||
volumesConfigPath string
|
||||
containerStoragePath string
|
||||
|
||||
// experimentalDaemon tell whether the main daemon has
|
||||
// experimental features enabled or not
|
||||
experimentalDaemon bool
|
||||
|
||||
// daemonStorageDriver is held globally so that tests can know the storage
|
||||
// driver of the daemon. This is initialized in docker_utils by sending
|
||||
// a version call to the daemon and examining the response header.
|
||||
@ -128,13 +132,15 @@ func init() {
|
||||
// /info endpoint for the specific root dir
|
||||
dockerBasePath = "/var/lib/docker"
|
||||
type Info struct {
|
||||
DockerRootDir string
|
||||
DockerRootDir string
|
||||
ExperimentalBuild bool
|
||||
}
|
||||
var i Info
|
||||
status, b, err := sockRequest("GET", "/info", nil)
|
||||
if err == nil && status == 200 {
|
||||
if err = json.Unmarshal(b, &i); err == nil {
|
||||
dockerBasePath = i.DockerRootDir
|
||||
experimentalDaemon = i.ExperimentalBuild
|
||||
}
|
||||
}
|
||||
volumesConfigPath = dockerBasePath + "/volumes"
|
||||
|
||||
@ -9,7 +9,6 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/docker/docker/utils"
|
||||
"github.com/go-check/check"
|
||||
)
|
||||
|
||||
@ -31,11 +30,11 @@ var (
|
||||
"Test requires a Linux daemon",
|
||||
}
|
||||
ExperimentalDaemon = testRequirement{
|
||||
func() bool { return utils.ExperimentalBuild() },
|
||||
func() bool { return experimentalDaemon },
|
||||
"Test requires an experimental daemon",
|
||||
}
|
||||
NotExperimentalDaemon = testRequirement{
|
||||
func() bool { return !utils.ExperimentalBuild() },
|
||||
func() bool { return !experimentalDaemon },
|
||||
"Test requires a non experimental daemon",
|
||||
}
|
||||
IsAmd64 = testRequirement{
|
||||
|
||||
Reference in New Issue
Block a user