From cf4f5b47710b3875767f997fc2eb3386cb0b66c0 Mon Sep 17 00:00:00 2001
From: lixiaobing10051267
Date: Fri, 25 Nov 2016 17:02:48 +0800
Subject: [PATCH] check typos and fix in daemon directory Signed-off-by:
lixiaobing10051267
Signed-off-by: lixiaobing10051267
---
daemon/links/links_test.go | 14 +++++++-------
daemon/logger/splunk/splunk_test.go | 4 ++--
2 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/daemon/links/links_test.go b/daemon/links/links_test.go
index 0273f13cf0..52c34ec7ba 100644
--- a/daemon/links/links_test.go
+++ b/daemon/links/links_test.go
@@ -192,21 +192,21 @@ func TestLinkPortRangeEnv(t *testing.T) {
if env["DOCKER_ENV_PASSWORD"] != "gordon" {
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)
- tcpport := fmt.Sprintf("DOCKER_PORT_%d_TCP+PORT", i)
- tcpproto := fmt.Sprintf("DOCKER_PORT_%d_TCP+PROTO", i)
+ tcpport := fmt.Sprintf("DOCKER_PORT_%d_TCP_PORT", i)
+ tcpproto := fmt.Sprintf("DOCKER_PORT_%d_TCP_PROTO", 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])
}
- 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])
}
- if env[tcpproto] == "tcp" {
+ if env[tcpproto] != "tcp" {
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])
}
}
diff --git a/daemon/logger/splunk/splunk_test.go b/daemon/logger/splunk/splunk_test.go
index df74cbad5f..09f3ba7a6b 100644
--- a/daemon/logger/splunk/splunk_test.go
+++ b/daemon/logger/splunk/splunk_test.go
@@ -639,7 +639,7 @@ func TestRawFormatWithLabels(t *testing.T) {
t.Fatal(err)
} else {
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)
} else {
if event != "notjson" {
- t.Fatalf("Unexpected event in message 1 %v", event)
+ t.Fatalf("Unexpected event in message 2 %v", event)
}
}