mirror of
https://github.com/moby/moby.git
synced 2025-07-30 18:23:29 +03:00
Update Dockerfile to use the correct busybox:latest identifier
Also requires some tests to be updated which relied on behavior of a busybox image that wasn't actually "busybox:latest"; meaning these tests were unable to be verified/run against a real busybox:latest image on a daemon. Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com> (github: estesp)
This commit is contained in:
@ -1495,13 +1495,16 @@ func (s *DockerDaemonSuite) TestRunContainerWithBridgeNone(c *check.C) {
|
||||
c.Assert(err, check.IsNil, check.Commentf("Output: %s", out))
|
||||
c.Assert(strings.Contains(out, "eth0"), check.Equals, false,
|
||||
check.Commentf("There shouldn't be eth0 in container in bridge mode when bridge network is disabled: %s", out))
|
||||
cmd := exec.Command("ip", "l")
|
||||
// the extra grep and awk clean up the output of `ip` to only list the number and name of
|
||||
// interfaces, allowing for different versions of ip (e.g. inside and outside the container) to
|
||||
// be used while still verifying that the interface list is the exact same
|
||||
cmd := exec.Command("sh", "-c", "ip l | grep -E '^[0-9]+:' | awk -F: ' { print $1\":\"$2 } '")
|
||||
stdout := bytes.NewBuffer(nil)
|
||||
cmd.Stdout = stdout
|
||||
if err := cmd.Run(); err != nil {
|
||||
c.Fatal("Failed to get host network interface")
|
||||
}
|
||||
out, err = s.d.Cmd("run", "--rm", "--net=host", "busybox", "ip", "l")
|
||||
out, err = s.d.Cmd("run", "--rm", "--net=host", "busybox", "sh", "-c", "ip l | grep -E '^[0-9]+:' | awk -F: ' { print $1\":\"$2 } '")
|
||||
c.Assert(err, check.IsNil, check.Commentf("Output: %s", out))
|
||||
c.Assert(out, check.Equals, fmt.Sprintf("%s", stdout),
|
||||
check.Commentf("The network interfaces in container should be the same with host when --net=host when bridge network is disabled: %s", out))
|
||||
|
Reference in New Issue
Block a user