mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Network remote APIs using new router, --net=<user-defined-network> changes
* Moving Network Remote APIs out of experimental * --net can now accept user created networks using network drivers/plugins * Removed the experimental services concept and --default-network option * Neccessary backend changes to accomodate multiple networks per container * Integration Tests Signed-off-by: David Calavera <david.calavera@gmail.com> Signed-off-by: Madhu Venugopal <madhu@docker.com>
This commit is contained in:
parent
aac5c44c10
commit
2ab94e11a2
29 changed files with 966 additions and 1380 deletions
|
@ -1,40 +0,0 @@
|
|||
// +build daemon,experimental,!windows
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"os/exec"
|
||||
"strings"
|
||||
|
||||
"github.com/go-check/check"
|
||||
)
|
||||
|
||||
func assertNetwork(c *check.C, d *Daemon, name string) {
|
||||
out, err := d.Cmd("network", "ls")
|
||||
c.Assert(err, check.IsNil)
|
||||
lines := strings.Split(out, "\n")
|
||||
for i := 1; i < len(lines)-1; i++ {
|
||||
if strings.Contains(lines[i], name) {
|
||||
return
|
||||
}
|
||||
}
|
||||
c.Fatalf("Network %s not found in network ls o/p", name)
|
||||
}
|
||||
|
||||
func (s *DockerDaemonSuite) TestDaemonDefaultNetwork(c *check.C) {
|
||||
testRequires(c, SameHostDaemon)
|
||||
d := s.d
|
||||
|
||||
networkName := "testdefault"
|
||||
err := d.StartWithBusybox("--default-network", "bridge:"+networkName)
|
||||
c.Assert(err, check.IsNil)
|
||||
|
||||
_, err = d.Cmd("run", "busybox", "true")
|
||||
c.Assert(err, check.IsNil)
|
||||
|
||||
assertNetwork(c, d, networkName)
|
||||
|
||||
ifconfigCmd := exec.Command("ifconfig", networkName)
|
||||
_, _, _, err = runCommandWithStdoutStderr(ifconfigCmd)
|
||||
c.Assert(err, check.IsNil)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue