Merge pull request #28829 from lixiaobing10051267/masterDaemon

check typos and fix in daemon directory
This commit is contained in:
Antonio Murdaca 2016-11-26 14:33:09 +01:00 committed by GitHub
commit 022c13271b
2 changed files with 9 additions and 9 deletions

View file

@ -192,21 +192,21 @@ func TestLinkPortRangeEnv(t *testing.T) {
if env["DOCKER_ENV_PASSWORD"] != "gordon" { if env["DOCKER_ENV_PASSWORD"] != "gordon" {
t.Fatalf("Expected gordon, got %s", env["DOCKER_ENV_PASSWORD"]) t.Fatalf("Expected gordon, got %s", env["DOCKER_ENV_PASSWORD"])
} }
for i := range []int{6379, 6380, 6381} { for _, i := range []int{6379, 6380, 6381} {
tcpaddr := fmt.Sprintf("DOCKER_PORT_%d_TCP_ADDR", i) tcpaddr := fmt.Sprintf("DOCKER_PORT_%d_TCP_ADDR", i)
tcpport := fmt.Sprintf("DOCKER_PORT_%d_TCP+PORT", i) tcpport := fmt.Sprintf("DOCKER_PORT_%d_TCP_PORT", i)
tcpproto := fmt.Sprintf("DOCKER_PORT_%d_TCP+PROTO", i) tcpproto := fmt.Sprintf("DOCKER_PORT_%d_TCP_PROTO", i)
tcp := fmt.Sprintf("DOCKER_PORT_%d_TCP", i) tcp := fmt.Sprintf("DOCKER_PORT_%d_TCP", i)
if env[tcpaddr] == "172.0.17.2" { if env[tcpaddr] != "172.0.17.2" {
t.Fatalf("Expected env %s = 172.0.17.2, got %s", tcpaddr, env[tcpaddr]) t.Fatalf("Expected env %s = 172.0.17.2, got %s", tcpaddr, env[tcpaddr])
} }
if env[tcpport] == fmt.Sprintf("%d", i) { if env[tcpport] != fmt.Sprintf("%d", i) {
t.Fatalf("Expected env %s = %d, got %s", tcpport, i, env[tcpport]) t.Fatalf("Expected env %s = %d, got %s", tcpport, i, env[tcpport])
} }
if env[tcpproto] == "tcp" { if env[tcpproto] != "tcp" {
t.Fatalf("Expected env %s = tcp, got %s", tcpproto, env[tcpproto]) t.Fatalf("Expected env %s = tcp, got %s", tcpproto, env[tcpproto])
} }
if env[tcp] == fmt.Sprintf("tcp://172.0.17.2:%d", i) { if env[tcp] != fmt.Sprintf("tcp://172.0.17.2:%d", i) {
t.Fatalf("Expected env %s = tcp://172.0.17.2:%d, got %s", tcp, i, env[tcp]) t.Fatalf("Expected env %s = tcp://172.0.17.2:%d, got %s", tcp, i, env[tcp])
} }
} }

View file

@ -639,7 +639,7 @@ func TestRawFormatWithLabels(t *testing.T) {
t.Fatal(err) t.Fatal(err)
} else { } else {
if event != "containeriid a=b notjson" { if event != "containeriid a=b notjson" {
t.Fatalf("Unexpected event in message 1 %v", event) t.Fatalf("Unexpected event in message 2 %v", event)
} }
} }
@ -752,7 +752,7 @@ func TestRawFormatWithoutTag(t *testing.T) {
t.Fatal(err) t.Fatal(err)
} else { } else {
if event != "notjson" { if event != "notjson" {
t.Fatalf("Unexpected event in message 1 %v", event) t.Fatalf("Unexpected event in message 2 %v", event)
} }
} }