mirror of https://github.com/docker/docs.git
Test for host networking
Signed-off-by: Alexandr Morozov <lk4d4@docker.com>
This commit is contained in:
parent
c98ae1f88f
commit
732c94a502
|
@ -2705,3 +2705,21 @@ func TestRunNonLocalMacAddress(t *testing.T) {
|
||||||
|
|
||||||
logDone("run - use non-local mac-address")
|
logDone("run - use non-local mac-address")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestRunNetHost(t *testing.T) {
|
||||||
|
defer deleteAllContainers()
|
||||||
|
iplinkHost, err := exec.Command("ip", "link", "list").CombinedOutput()
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
iplinkCont, err := exec.Command(dockerBinary, "run", "--net=host", "busybox", "ip", "link", "list").CombinedOutput()
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if !bytes.Equal(iplinkHost, iplinkCont) {
|
||||||
|
t.Fatalf("Container network:\n%s\nis not equal to host network:\n%s", iplinkCont, iplinkHost)
|
||||||
|
}
|
||||||
|
logDone("run - host network")
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue