Fix format calls as suggested by vet
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
This commit is contained in:
parent
bb96e53b0f
commit
a75b02fe72
5 changed files with 10 additions and 10 deletions
|
@ -67,7 +67,7 @@ func TestRmRunningContainerCheckError409(t *testing.T) {
|
|||
t.Fatalf("Expected error, can't rm a running container")
|
||||
}
|
||||
if !strings.Contains(err.Error(), "409 Conflict") {
|
||||
t.Fatalf("Expected error to contain '409 Conflict' but found", err)
|
||||
t.Fatalf("Expected error to contain '409 Conflict' but found %s", err)
|
||||
}
|
||||
|
||||
deleteAllContainers()
|
||||
|
|
|
@ -319,18 +319,18 @@ func TestRunLinksContainerWithContainerName(t *testing.T) {
|
|||
cmd := exec.Command(dockerBinary, "run", "-t", "-d", "--name", "parent", "busybox")
|
||||
out, _, _, err := runCommandWithStdoutStderr(cmd)
|
||||
if err != nil {
|
||||
t.Fatal("failed to run container: %v, output: %q", err, out)
|
||||
t.Fatalf("failed to run container: %v, output: %q", err, out)
|
||||
}
|
||||
cmd = exec.Command(dockerBinary, "inspect", "-f", "{{.NetworkSettings.IPAddress}}", "parent")
|
||||
ip, _, _, err := runCommandWithStdoutStderr(cmd)
|
||||
if err != nil {
|
||||
t.Fatal("failed to inspect container: %v, output: %q", err, ip)
|
||||
t.Fatalf("failed to inspect container: %v, output: %q", err, ip)
|
||||
}
|
||||
ip = strings.TrimSpace(ip)
|
||||
cmd = exec.Command(dockerBinary, "run", "--link", "parent:test", "busybox", "/bin/cat", "/etc/hosts")
|
||||
out, _, err = runCommandWithOutput(cmd)
|
||||
if err != nil {
|
||||
t.Fatal("failed to run container: %v, output: %q", err, out)
|
||||
t.Fatalf("failed to run container: %v, output: %q", err, out)
|
||||
}
|
||||
if !strings.Contains(out, ip+" test") {
|
||||
t.Fatalf("use a container name to link target failed")
|
||||
|
@ -345,19 +345,19 @@ func TestRunLinksContainerWithContainerId(t *testing.T) {
|
|||
cmd := exec.Command(dockerBinary, "run", "-t", "-d", "busybox")
|
||||
cID, _, _, err := runCommandWithStdoutStderr(cmd)
|
||||
if err != nil {
|
||||
t.Fatal("failed to run container: %v, output: %q", err, cID)
|
||||
t.Fatalf("failed to run container: %v, output: %q", err, cID)
|
||||
}
|
||||
cID = strings.TrimSpace(cID)
|
||||
cmd = exec.Command(dockerBinary, "inspect", "-f", "{{.NetworkSettings.IPAddress}}", cID)
|
||||
ip, _, _, err := runCommandWithStdoutStderr(cmd)
|
||||
if err != nil {
|
||||
t.Fatal("faild to inspect container: %v, output: %q", err, ip)
|
||||
t.Fatalf("faild to inspect container: %v, output: %q", err, ip)
|
||||
}
|
||||
ip = strings.TrimSpace(ip)
|
||||
cmd = exec.Command(dockerBinary, "run", "--link", cID+":test", "busybox", "/bin/cat", "/etc/hosts")
|
||||
out, _, err := runCommandWithOutput(cmd)
|
||||
if err != nil {
|
||||
t.Fatal("failed to run container: %v, output: %q", err, out)
|
||||
t.Fatalf("failed to run container: %v, output: %q", err, out)
|
||||
}
|
||||
if !strings.Contains(out, ip+" test") {
|
||||
t.Fatalf("use a container id to link target failed")
|
||||
|
|
|
@ -226,7 +226,7 @@ out2:
|
|||
case <-tick:
|
||||
i++
|
||||
if i > 4 {
|
||||
d.t.Log("tried to interrupt daemon for %d times, now try to kill it", i)
|
||||
d.t.Logf("tried to interrupt daemon for %d times, now try to kill it", i)
|
||||
break out2
|
||||
}
|
||||
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) {
|
|||
for portspec, bindings := range bindingMap {
|
||||
_, port := SplitProtoPort(string(portspec))
|
||||
if len(bindings) != 1 || bindings[0].HostIp != "0.0.0.0" || bindings[0].HostPort != port {
|
||||
t.Fatalf("Expect single binding to port %d but found %s", port, bindings)
|
||||
t.Fatalf("Expect single binding to port %s but found %s", port, bindings)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -151,7 +151,7 @@ func TestResolveAuthConfigFullURL(t *testing.T) {
|
|||
for configKey, registries := range validRegistries {
|
||||
configured, ok := expectedAuths[configKey]
|
||||
if !ok || configured.Email == "" {
|
||||
t.Fatal()
|
||||
t.Fail()
|
||||
}
|
||||
index := &IndexInfo{
|
||||
Name: configKey,
|
||||
|
|
Loading…
Add table
Reference in a new issue