소스 검색

Add test for non local mac address.

Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
Jessica Frazelle 10 년 전
부모
커밋
98d5720594
1개의 변경된 파일12개의 추가작업 그리고 0개의 파일을 삭제
  1. 12 0
      integration-cli/docker_cli_run_test.go

+ 12 - 0
integration-cli/docker_cli_run_test.go

@@ -2693,3 +2693,15 @@ func TestRunTtyWithPipe(t *testing.T) {
 
 	logDone("run - forbid piped stdin with tty")
 }
+
+func TestRunNonLocalMacAddress(t *testing.T) {
+	defer deleteAllContainers()
+	addr := "00:16:3E:08:00:50"
+
+	cmd := exec.Command(dockerBinary, "run", "--mac-address", addr, "busybox", "ifconfig")
+	if out, _, err := runCommandWithOutput(cmd); err != nil || !strings.Contains(out, addr) {
+		t.Fatalf("Output should have contained %q: %s, %v", addr, out, err)
+	}
+
+	logDone("run - use non-local mac-address")
+}