Merge component 'engine' from git@github.com:moby/moby master

This commit is contained in:
GordonTheTurtle
2018-05-23 17:06:41 +00:00
7 changed files with 21 additions and 23 deletions

View File

@ -4663,7 +4663,11 @@ paths:
AppArmorProfile:
type: "string"
ExecIDs:
description: "IDs of exec instances that are running in the container."
type: "array"
items:
type: "string"
x-nullable: true
HostConfig:
$ref: "#/definitions/HostConfig"
GraphDriver:
@ -4720,6 +4724,9 @@ paths:
StopTimeout: 10
Created: "2015-01-06T15:47:31.485331387Z"
Driver: "devicemapper"
ExecIDs:
- "b35395de42bc8abd327f9dd65d913b9ba28c74d2f0734eeeae84fa1c616a0fca"
- "3fc1232e5cd20c8de182ed81178503dc6437f4e7ef12b52cc5e8de020652f1c4"
HostConfig:
MaximumIOps: 0
MaximumIOBps: 0

View File

@ -442,7 +442,8 @@ func (s *DockerSuite) TestContainerAPITop(c *check.C) {
c.Assert(err, checker.IsNil)
defer cli.Close()
top, err := cli.ContainerTop(context.Background(), id, []string{"aux"})
// sort by comm[andline] to make sure order stays the same in case of PID rollover
top, err := cli.ContainerTop(context.Background(), id, []string{"aux", "--sort=comm"})
c.Assert(err, checker.IsNil)
c.Assert(top.Titles, checker.HasLen, 11, check.Commentf("expected 11 titles, found %d: %v", len(top.Titles), top.Titles))

View File

@ -458,10 +458,3 @@ func (s *DockerSuite) TestInspectUnknownObject(c *check.C) {
c.Assert(out, checker.Contains, "Error: No such object: foobar")
c.Assert(err.Error(), checker.Contains, "Error: No such object: foobar")
}
func (s *DockerSuite) TestInspectInvalidReference(c *check.C) {
// This test should work on both Windows and Linux
out, _, err := dockerCmdWithError("inspect", "FooBar")
c.Assert(err, checker.NotNil)
c.Assert(out, checker.Contains, "invalid reference format: repository name must be lowercase")
}

View File

@ -175,6 +175,7 @@ func TestBuildMultiStageParentConfig(t *testing.T) {
// Test cases in #36996
func TestBuildLabelWithTargets(t *testing.T) {
skip.If(t, versions.LessThan(testEnv.DaemonAPIVersion(), "1.37"), "test added after 1.37")
bldName := "build-a"
testLabels := map[string]string{
"foo": "bar",

View File

@ -12,9 +12,11 @@ import (
"github.com/docker/docker/integration/internal/container"
"github.com/docker/docker/internal/test/daemon"
"github.com/gotestyourself/gotestyourself/assert"
"github.com/gotestyourself/gotestyourself/skip"
)
func TestContinueAfterPluginCrash(t *testing.T) {
skip.If(t, testEnv.IsRemoteDaemon(), "test requires daemon on the same host")
t.Parallel()
d := daemon.New(t)

View File

@ -121,7 +121,7 @@ func (e *Execution) IsRemoteDaemon() bool {
return !e.IsLocalDaemon()
}
// DaemonAPIVersion returns the negociated daemon api version
// DaemonAPIVersion returns the negotiated daemon api version
func (e *Execution) DaemonAPIVersion() string {
version, err := e.APIClient().ServerVersion(context.TODO())
if err != nil {

View File

@ -8,8 +8,6 @@ import (
"os"
"strings"
"testing"
selinux "github.com/opencontainers/selinux/go-selinux"
)
func TestMount(t *testing.T) {
@ -103,11 +101,7 @@ func TestMount(t *testing.T) {
t.Fatal(err)
}
defer ensureUnmount(t, target)
expectedVFS := tc.expectedVFS
if selinux.GetEnabled() && expectedVFS != "" {
expectedVFS = expectedVFS + ",seclabel"
}
validateMount(t, target, tc.expectedOpts, tc.expectedOptional, expectedVFS)
validateMount(t, target, tc.expectedOpts, tc.expectedOptional, tc.expectedVFS)
})
}
}
@ -177,13 +171,13 @@ func validateMount(t *testing.T, mnt string, opts, optional, vfs string) {
for _, opt := range strings.Split(mi.Opts, ",") {
opt = clean(opt)
if !has(wantedOpts, opt) && !has(pOpts, opt) {
t.Errorf("unexpected mount option %q expected %q", opt, opts)
t.Errorf("unexpected mount option %q, expected %q", opt, opts)
}
delete(wantedOpts, opt)
}
}
for opt := range wantedOpts {
t.Errorf("missing mount option %q found %q", opt, mi.Opts)
t.Errorf("missing mount option %q, found %q", opt, mi.Opts)
}
// Validate Optional
@ -191,13 +185,13 @@ func validateMount(t *testing.T, mnt string, opts, optional, vfs string) {
for _, field := range strings.Split(mi.Optional, ",") {
field = clean(field)
if !has(wantedOptional, field) && !has(pOptional, field) {
t.Errorf("unexpected optional failed %q expected %q", field, optional)
t.Errorf("unexpected optional field %q, expected %q", field, optional)
}
delete(wantedOptional, field)
}
}
for field := range wantedOptional {
t.Errorf("missing optional field %q found %q", field, mi.Optional)
t.Errorf("missing optional field %q, found %q", field, mi.Optional)
}
// Validate VFS if set
@ -205,14 +199,14 @@ func validateMount(t *testing.T, mnt string, opts, optional, vfs string) {
if mi.VfsOpts != "" {
for _, opt := range strings.Split(mi.VfsOpts, ",") {
opt = clean(opt)
if !has(wantedVFS, opt) {
t.Errorf("unexpected mount option %q expected %q", opt, vfs)
if !has(wantedVFS, opt) && opt != "seclabel" { // can be added by selinux
t.Errorf("unexpected vfs option %q, expected %q", opt, vfs)
}
delete(wantedVFS, opt)
}
}
for opt := range wantedVFS {
t.Errorf("missing mount option %q found %q", opt, mi.VfsOpts)
t.Errorf("missing vfs option %q, found %q", opt, mi.VfsOpts)
}
}