diff --git a/components/engine/api/swagger.yaml b/components/engine/api/swagger.yaml index 459ce9b186..2550a50b56 100644 --- a/components/engine/api/swagger.yaml +++ b/components/engine/api/swagger.yaml @@ -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 diff --git a/components/engine/integration-cli/docker_api_containers_test.go b/components/engine/integration-cli/docker_api_containers_test.go index f980d87d82..31d6077880 100644 --- a/components/engine/integration-cli/docker_api_containers_test.go +++ b/components/engine/integration-cli/docker_api_containers_test.go @@ -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)) diff --git a/components/engine/integration-cli/docker_cli_inspect_test.go b/components/engine/integration-cli/docker_cli_inspect_test.go index 247721e616..a1130aebf5 100644 --- a/components/engine/integration-cli/docker_cli_inspect_test.go +++ b/components/engine/integration-cli/docker_cli_inspect_test.go @@ -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") -} diff --git a/components/engine/integration/build/build_test.go b/components/engine/integration/build/build_test.go index c0aea0fe6b..352f7c152d 100644 --- a/components/engine/integration/build/build_test.go +++ b/components/engine/integration/build/build_test.go @@ -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", diff --git a/components/engine/integration/plugin/logging/logging_test.go b/components/engine/integration/plugin/logging/logging_test.go index ad2336fc64..1b6f2962bb 100644 --- a/components/engine/integration/plugin/logging/logging_test.go +++ b/components/engine/integration/plugin/logging/logging_test.go @@ -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) diff --git a/components/engine/internal/test/environment/environment.go b/components/engine/internal/test/environment/environment.go index 9aaabad7be..74c8e2ce0a 100644 --- a/components/engine/internal/test/environment/environment.go +++ b/components/engine/internal/test/environment/environment.go @@ -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 { diff --git a/components/engine/pkg/mount/mounter_linux_test.go b/components/engine/pkg/mount/mounter_linux_test.go index 15f10593ac..336f3d5cdc 100644 --- a/components/engine/pkg/mount/mounter_linux_test.go +++ b/components/engine/pkg/mount/mounter_linux_test.go @@ -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) } }