commit
3118ccc6bc
7 changed files with 14 additions and 14 deletions
|
@ -25,13 +25,13 @@ func New() *libcontainer.Config {
|
|||
"KILL",
|
||||
"AUDIT_WRITE",
|
||||
},
|
||||
Namespaces: libcontainer.Namespaces{
|
||||
Namespaces: libcontainer.Namespaces([]libcontainer.Namespace{
|
||||
{Type: "NEWNS"},
|
||||
{Type: "NEWUTS"},
|
||||
{Type: "NEWIPC"},
|
||||
{Type: "NEWPID"},
|
||||
{Type: "NEWNET"},
|
||||
},
|
||||
}),
|
||||
Cgroups: &cgroups.Cgroup{
|
||||
Parent: "docker",
|
||||
AllowAllDevices: false,
|
||||
|
|
|
@ -1550,13 +1550,13 @@ func (devices *DeviceSet) poolStatus() (totalSizeInSectors, transactionId, dataU
|
|||
|
||||
// MetadataDevicePath returns the path to the metadata storage for this deviceset,
|
||||
// regardless of loopback or block device
|
||||
func (devices DeviceSet) DataDevicePath() string {
|
||||
func (devices *DeviceSet) DataDevicePath() string {
|
||||
return devices.dataDevice
|
||||
}
|
||||
|
||||
// MetadataDevicePath returns the path to the metadata storage for this deviceset,
|
||||
// regardless of loopback or block device
|
||||
func (devices DeviceSet) MetadataDevicePath() string {
|
||||
func (devices *DeviceSet) MetadataDevicePath() string {
|
||||
return devices.metadataDevice
|
||||
}
|
||||
|
||||
|
|
|
@ -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…
Reference in a new issue