Signed-off-by: Alexander Morozov <lk4d4@docker.com>
| ... | ... |
@@ -67,7 +67,7 @@ func TestRmRunningContainerCheckError409(t *testing.T) {
|
| 67 | 67 |
t.Fatalf("Expected error, can't rm a running container")
|
| 68 | 68 |
} |
| 69 | 69 |
if !strings.Contains(err.Error(), "409 Conflict") {
|
| 70 |
- t.Fatalf("Expected error to contain '409 Conflict' but found", err)
|
|
| 70 |
+ t.Fatalf("Expected error to contain '409 Conflict' but found %s", err)
|
|
| 71 | 71 |
} |
| 72 | 72 |
|
| 73 | 73 |
deleteAllContainers() |
| ... | ... |
@@ -319,18 +319,18 @@ func TestRunLinksContainerWithContainerName(t *testing.T) {
|
| 319 | 319 |
cmd := exec.Command(dockerBinary, "run", "-t", "-d", "--name", "parent", "busybox") |
| 320 | 320 |
out, _, _, err := runCommandWithStdoutStderr(cmd) |
| 321 | 321 |
if err != nil {
|
| 322 |
- t.Fatal("failed to run container: %v, output: %q", err, out)
|
|
| 322 |
+ t.Fatalf("failed to run container: %v, output: %q", err, out)
|
|
| 323 | 323 |
} |
| 324 | 324 |
cmd = exec.Command(dockerBinary, "inspect", "-f", "{{.NetworkSettings.IPAddress}}", "parent")
|
| 325 | 325 |
ip, _, _, err := runCommandWithStdoutStderr(cmd) |
| 326 | 326 |
if err != nil {
|
| 327 |
- t.Fatal("failed to inspect container: %v, output: %q", err, ip)
|
|
| 327 |
+ t.Fatalf("failed to inspect container: %v, output: %q", err, ip)
|
|
| 328 | 328 |
} |
| 329 | 329 |
ip = strings.TrimSpace(ip) |
| 330 | 330 |
cmd = exec.Command(dockerBinary, "run", "--link", "parent:test", "busybox", "/bin/cat", "/etc/hosts") |
| 331 | 331 |
out, _, err = runCommandWithOutput(cmd) |
| 332 | 332 |
if err != nil {
|
| 333 |
- t.Fatal("failed to run container: %v, output: %q", err, out)
|
|
| 333 |
+ t.Fatalf("failed to run container: %v, output: %q", err, out)
|
|
| 334 | 334 |
} |
| 335 | 335 |
if !strings.Contains(out, ip+" test") {
|
| 336 | 336 |
t.Fatalf("use a container name to link target failed")
|
| ... | ... |
@@ -345,19 +345,19 @@ func TestRunLinksContainerWithContainerId(t *testing.T) {
|
| 345 | 345 |
cmd := exec.Command(dockerBinary, "run", "-t", "-d", "busybox") |
| 346 | 346 |
cID, _, _, err := runCommandWithStdoutStderr(cmd) |
| 347 | 347 |
if err != nil {
|
| 348 |
- t.Fatal("failed to run container: %v, output: %q", err, cID)
|
|
| 348 |
+ t.Fatalf("failed to run container: %v, output: %q", err, cID)
|
|
| 349 | 349 |
} |
| 350 | 350 |
cID = strings.TrimSpace(cID) |
| 351 | 351 |
cmd = exec.Command(dockerBinary, "inspect", "-f", "{{.NetworkSettings.IPAddress}}", cID)
|
| 352 | 352 |
ip, _, _, err := runCommandWithStdoutStderr(cmd) |
| 353 | 353 |
if err != nil {
|
| 354 |
- t.Fatal("faild to inspect container: %v, output: %q", err, ip)
|
|
| 354 |
+ t.Fatalf("faild to inspect container: %v, output: %q", err, ip)
|
|
| 355 | 355 |
} |
| 356 | 356 |
ip = strings.TrimSpace(ip) |
| 357 | 357 |
cmd = exec.Command(dockerBinary, "run", "--link", cID+":test", "busybox", "/bin/cat", "/etc/hosts") |
| 358 | 358 |
out, _, err := runCommandWithOutput(cmd) |
| 359 | 359 |
if err != nil {
|
| 360 |
- t.Fatal("failed to run container: %v, output: %q", err, out)
|
|
| 360 |
+ t.Fatalf("failed to run container: %v, output: %q", err, out)
|
|
| 361 | 361 |
} |
| 362 | 362 |
if !strings.Contains(out, ip+" test") {
|
| 363 | 363 |
t.Fatalf("use a container id to link target failed")
|
| ... | ... |
@@ -226,7 +226,7 @@ out2: |
| 226 | 226 |
case <-tick: |
| 227 | 227 |
i++ |
| 228 | 228 |
if i > 4 {
|
| 229 |
- d.t.Log("tried to interrupt daemon for %d times, now try to kill it", i)
|
|
| 229 |
+ d.t.Logf("tried to interrupt daemon for %d times, now try to kill it", i)
|
|
| 230 | 230 |
break out2 |
| 231 | 231 |
} |
| 232 | 232 |
d.t.Logf("Attempt #%d: daemon is still running with pid %d", i, d.cmd.Process.Pid)
|
| ... | ... |
@@ -281,7 +281,7 @@ func TestParsePortSpecsWithRange(t *testing.T) {
|
| 281 | 281 |
for portspec, bindings := range bindingMap {
|
| 282 | 282 |
_, port := SplitProtoPort(string(portspec)) |
| 283 | 283 |
if len(bindings) != 1 || bindings[0].HostIp != "0.0.0.0" || bindings[0].HostPort != port {
|
| 284 |
- t.Fatalf("Expect single binding to port %d but found %s", port, bindings)
|
|
| 284 |
+ t.Fatalf("Expect single binding to port %s but found %s", port, bindings)
|
|
| 285 | 285 |
} |
| 286 | 286 |
} |
| 287 | 287 |
|
| ... | ... |
@@ -151,7 +151,7 @@ func TestResolveAuthConfigFullURL(t *testing.T) {
|
| 151 | 151 |
for configKey, registries := range validRegistries {
|
| 152 | 152 |
configured, ok := expectedAuths[configKey] |
| 153 | 153 |
if !ok || configured.Email == "" {
|
| 154 |
- t.Fatal() |
|
| 154 |
+ t.Fail() |
|
| 155 | 155 |
} |
| 156 | 156 |
index := &IndexInfo{
|
| 157 | 157 |
Name: configKey, |