check typos and fix in daemon directory

Signed-off-by: lixiaobing10051267 <li.xiaobing1@zte.com.cn>

Signed-off-by: lixiaobing10051267 <li.xiaobing1@zte.com.cn>
This commit is contained in:
lixiaobing10051267 2016-11-25 17:02:48 +08:00
parent b8e3a28d65
commit cf4f5b4771
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)
} }
} }