Browse code

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>

lixiaobing10051267 authored on 2016/11/25 18:02:48
Showing 2 changed files
... ...
@@ -192,21 +192,21 @@ func TestLinkPortRangeEnv(t *testing.T) {
192 192
 	if env["DOCKER_ENV_PASSWORD"] != "gordon" {
193 193
 		t.Fatalf("Expected gordon, got %s", env["DOCKER_ENV_PASSWORD"])
194 194
 	}
195
-	for i := range []int{6379, 6380, 6381} {
195
+	for _, i := range []int{6379, 6380, 6381} {
196 196
 		tcpaddr := fmt.Sprintf("DOCKER_PORT_%d_TCP_ADDR", i)
197
-		tcpport := fmt.Sprintf("DOCKER_PORT_%d_TCP+PORT", i)
198
-		tcpproto := fmt.Sprintf("DOCKER_PORT_%d_TCP+PROTO", i)
197
+		tcpport := fmt.Sprintf("DOCKER_PORT_%d_TCP_PORT", i)
198
+		tcpproto := fmt.Sprintf("DOCKER_PORT_%d_TCP_PROTO", i)
199 199
 		tcp := fmt.Sprintf("DOCKER_PORT_%d_TCP", i)
200
-		if env[tcpaddr] == "172.0.17.2" {
200
+		if env[tcpaddr] != "172.0.17.2" {
201 201
 			t.Fatalf("Expected env %s  = 172.0.17.2, got %s", tcpaddr, env[tcpaddr])
202 202
 		}
203
-		if env[tcpport] == fmt.Sprintf("%d", i) {
203
+		if env[tcpport] != fmt.Sprintf("%d", i) {
204 204
 			t.Fatalf("Expected env %s  = %d, got %s", tcpport, i, env[tcpport])
205 205
 		}
206
-		if env[tcpproto] == "tcp" {
206
+		if env[tcpproto] != "tcp" {
207 207
 			t.Fatalf("Expected env %s  = tcp, got %s", tcpproto, env[tcpproto])
208 208
 		}
209
-		if env[tcp] == fmt.Sprintf("tcp://172.0.17.2:%d", i) {
209
+		if env[tcp] != fmt.Sprintf("tcp://172.0.17.2:%d", i) {
210 210
 			t.Fatalf("Expected env %s  = tcp://172.0.17.2:%d, got %s", tcp, i, env[tcp])
211 211
 		}
212 212
 	}
... ...
@@ -639,7 +639,7 @@ func TestRawFormatWithLabels(t *testing.T) {
639 639
 		t.Fatal(err)
640 640
 	} else {
641 641
 		if event != "containeriid a=b notjson" {
642
-			t.Fatalf("Unexpected event in message 1 %v", event)
642
+			t.Fatalf("Unexpected event in message 2 %v", event)
643 643
 		}
644 644
 	}
645 645
 
... ...
@@ -752,7 +752,7 @@ func TestRawFormatWithoutTag(t *testing.T) {
752 752
 		t.Fatal(err)
753 753
 	} else {
754 754
 		if event != "notjson" {
755
-			t.Fatalf("Unexpected event in message 1 %v", event)
755
+			t.Fatalf("Unexpected event in message 2 %v", event)
756 756
 		}
757 757
 	}
758 758