Commit Graph

277 Commits

Author SHA1 Message Date
b4446f4926 Move log validator logic after plugins are loaded
This ensures that all log plugins are registered when the log validator
is run.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: b0b9a25e7e60abbe143e149ccaaf4dfb62044016
Component: engine
2018-02-15 11:53:11 -05:00
2802ca3c0e Merge pull request #36018 from thaJeztah/remove-deprecated-testenv-functions
Remove deprecated integration-cli/environment functions
Upstream-commit: 8c31aacebff68fe73f4203f86c5681a0fce648f1
Component: engine
2018-01-15 13:24:52 -08:00
d0afa0d404 Remove deprecated environment.ExperimentalDaemon()
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: da8032d7d351a2073f54ec0121a796800b6b1a46
Component: engine
2018-01-15 15:30:05 +01:00
2c5689d728 ineffassign: fix unused variables
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 63a0e88e8a61b5c0d5f698d5baf37f568ee01d50
Component: engine
2018-01-13 13:35:10 +01:00
dd0cbe7272 integration-cli/TestCleanupMounts: fix/improve
`TestCleanupMountsAfterDaemonAndContainerKill` was supposedly written
when the container mounts were visible from the host. Currently they
all live in their own mount namespace and the only visible mount is
the tmpfs one for shareable /dev/shm inside the container (i.e.
/var/lib/docker/containers/<ID>/shm), which will no longer be there
in case of `--default-ipc-mode private` is used, and so the test will
fail. Add a check if any container mounts are visible from the host,
and skip the test if there are none, as there's nothing to check.

`TestCleanupMountsAfterDaemonCrash`: fix in a similar way, keeping
all the other checks it does, and skipping the "mounts gone" check
if there were no mounts visible from the host.

While at it, also fix the tests to use `d.Kill()` in order to not
leave behind a stale `docker.pid` files.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: f5e01452d2c2a07bab48b4e05306ef9446770c4a
Component: engine
2017-12-28 13:08:41 -08:00
ebbba75d0a daemon, plugin: follow containerd namespace conventions
Follow the conventions for namespace naming set out by other projects,
such as linuxkit and cri-containerd. Typically, they are some sort of
host name, with a subdomain describing functionality of the namespace.
In the case of linuxkit, services are launched in `services.linuxkit`.
In cri-containerd, pods are launched in `k8s.io`, making it clear that
these are from kubernetes.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
Upstream-commit: 521e7eba86df25857647b93f13e5366c554e9d63
Component: engine
2017-12-15 17:20:42 -08:00
259cc0cc87 Increase container default shutdown timeout on Windows
The shutdown timeout for containers in insufficient on Windows. If the daemon is shutting down, and a container takes longer than expected to shut down, this can cause the container to remain in a bad state after restart, and never be able to start again. Increasing the timeout makes this less likely to occur.

Signed-off-by: Darren Stahl <darst@microsoft.com>
Upstream-commit: ed74ee127f42f32ee98be7b908e1562b1c0554d7
Component: engine
2017-10-23 10:31:31 -07:00
3242c0b622 Fix tests creating zombie processes
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
Upstream-commit: 617f89b9a357c0176efc2b5b28af8b36f5ebdbcb
Component: engine
2017-10-20 07:11:38 -07:00
044d7f995b Update libcontainerd to use containerd 1.0
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
Upstream-commit: ddae20c032058a0fd42c34c2e9750ee8f6296ac8
Component: engine
2017-10-20 07:11:37 -07:00
f34f36be87 Merge pull request #34332 from clnperez/logrus-revendor
revendor logrus and x/crypto
Upstream-commit: 2a54dc080471476037c87cc6961cc126368ffdd9
Component: engine
2017-09-14 11:29:05 -07:00
97847089f1 revendor logrus and x/crypto
this fixes the issue that was blocking a test from running on ppc64le.
the logrus revendor changes the color code used in that same test, so
that breaks the test for all platforms (updated in this pr)

Signed-off-by: Christy Perez <christy@linux.vnet.ibm.com>
Upstream-commit: 008b217844f8738cc47ef9ff108dc41dc37736cc
Component: engine
2017-09-14 11:05:47 -05:00
023fe0b32f [integration-cli] fix p/z HubPullSuite tests
This test tries to pull all the tags in the busybox repo and looks to see
if there were more than two images pulled. This was failing on
p/z due to the recent change to manifest lists, where one of the busybox
tags didn't have a p/z manifest in it's manifest list.

This error seems fine to me, so I changed the test to see if pull fails,
it fails with the "manifest not found" error.

Also switched from busybox -> alpine, because it has significantly less tags,
and the images are close in size.

Signed-off-by: Christopher Jones <tophj@linux.vnet.ibm.com>
Upstream-commit: 5739ba1b918402b8eda748ac2f5dd7ce00f2e69f
Component: engine
2017-09-14 09:42:09 -04:00
e8bff97a66 Update tests to use icmd
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 92427b3a8146e048c4b85e5ece1530da97d8472d
Component: engine
2017-08-25 12:07:30 -04:00
42d094ea01 docker_api_ipcmode_test: add SameHostDaemon req
This is needed for tests that do some checks and/or create files
on the host system. Inspired by commit d9f3548a9.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: 8a9878081f8e14a54067f249bc98ae66f0b61ba3
Component: engine
2017-08-24 17:02:21 +03:00
f5c5b5cc38 Remove RunCommandPipelineWithOutput
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: e885af2a6b6b9f88a8b419d225b1425ec3d9416e
Component: engine
2017-08-22 17:15:26 -04:00
3177188cce Remove testutil.ParseCgroupPaths
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: e8bd67181533222c192cca19a4279c85db48875e
Component: engine
2017-08-22 17:15:26 -04:00
1a431d82d1 Test cases for new ipc modes
These test cases cover various arguments for docker create/run --ipc
option, as well as daemon's --default-ipc-mode cli option and
configuration file parameter.

For the description of container IPC modes, see previous commit.

To run these:

	TESTFLAGS='-check.f IpcMode' make test-integration-cli

[v2: simplify TestDaemonEvents(), add default-ipc-mode presense check]
[v3: add TestDaemonIpcModeVSRestart]
[v4: ipcmode test now uses client lib instead of CLI (except for exec)]
[v5: nitpicks in comments]
[v6: add test case for "none"; fix a typo; simplify TestDaemonEvents() more]

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: 9a60e1cc874402d10eb7e45f62cce25bf5c41d30
Component: engine
2017-08-14 11:00:26 +03:00
e95f4619cd [project] change syscall to /x/sys/unix|windows
Changes most references of syscall to golang.org/x/sys/
Ones aren't changes include, Errno, Signal and SysProcAttr
as they haven't been implemented in /x/sys/.

Signed-off-by: Christopher Jones <tophj@linux.vnet.ibm.com>

[s390x] switch utsname from unsigned to signed

per 33267e036f
char in s390x in the /x/sys/unix package is now signed, so
change the buildtags

Signed-off-by: Christopher Jones <tophj@linux.vnet.ibm.com>
Upstream-commit: 069fdc8a083cb1663e4f86fe3fd9b9a1aebc3e54
Component: engine
2017-07-11 08:00:32 -04:00
ec1ee882b3 Merge pull request #33322 from jsoref/spelling
Spelling
Upstream-commit: ff4f700f74450018f36d014f3cde0ff1b9c17fb3
Component: engine
2017-07-04 15:46:34 +02:00
bfb65fa0bb Merge pull request #33830 from cpuguy83/33799_fix_plugin_mounts_issue
Make plugin removes more resilient to failure
Upstream-commit: 48adb9d9549b8e5c4e9fd34335161c7676395e5a
Component: engine
2017-07-03 18:37:31 -07:00
643654c2f0 Spelling fixes
* additional
* ambiguous
* anonymous
* anything
* application
* because
* before
* building
* capabilities
* circumstances
* commit
* committer
* compresses
* concatenated
* config
* container
* container's
* current
* definition
* delimiter
* disassociates
* discovery
* distributed
* doesnotexist
* downloads
* duplicates
* either
* enhancing
* enumerate
* escapable
* exactly
* expect
* expectations
* expected
* explicitly
* false
* filesystem
* following
* forbidden
* git with
* healthcheck
* ignore
* independent
* inheritance
* investigating
* irrelevant
* it
* logging
* looking
* membership
* mimic
* minimum
* modify
* mountpoint
* multiline
* notifier
* outputting
* outside
* overridden
* override
* parsable
* plugins
* precedence
* propagation
* provided
* provides
* registries
* repositories
* returning
* settings
* should
* signals
* someone
* something
* specifically
* successfully
* synchronize
* they've
* thinking
* uninitialized
* unintentionally
* unmarshaling
* unnamed
* unreferenced
* verify

Signed-off-by: Josh Soref <jsoref@gmail.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 39bcaee47b8a284a46b761afe218ba7deda0d482
Component: engine
2017-07-03 13:13:09 -07:00
8e86b3a04f Merge pull request #33875 from tmp6154/master
Change order of arguments in assertion to be more logical
Upstream-commit: 87df0e533b619c088091fd1e2310e92bb9a24822
Component: engine
2017-06-30 14:46:11 -04:00
7e46ec7067 Make plugin removes more resilient to failure
Before this patch, if the plugin's `config.json` is successfully removed
but the main plugin state dir could not be removed for some reason (e.g.
leaked mount), it will prevent the daemon from being able to be
restarted.

This patches changes this to atomically remove the plugin such that on
daemon restart we can detect that there was an error and re-try. It also
changes the logic so that it only logs errors on restore rather than
erroring out the daemon.

This also removes some code which is now duplicated elsewhere.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 11cf394e5ea964636294a219872b188fe5bdf4dd
Component: engine
2017-06-30 09:58:19 -04:00
0b353a6204 Change order of arguments in assertion to be more logical
Because of argument order to assert, in case of fail, we'll get message
like:

... obtained string = "uid=100(test) gid=101(test)\n"
... expected string = "uid=100(test) gid=101(test) groups=101(test)\n"

But obtained string should be second one, not the first one. And
expected string should be first. Here's sample output from test above:

... Output: before restart 'uid=100(test) gid=101(test)
', after restart 'uid=100(test) gid=101(test) groups=101(test)

It's confusing, because expected order of strings in assertion is
reversed. What goes before restart - should be "expected string" and
what goes after - should be "obtained string".

Signed-off-by: Vitaly Ostrosablin <vostrosablin@virtuozzo.com>
Upstream-commit: 07cc701947533089fac5fea42e7d5a9a6ea1cfcc
Component: engine
2017-06-29 12:38:13 +03:00
5b78ab86a3 Merge pull request #31273 from fabiokung/consistent-ro-view
No container locks on `docker ps`
Upstream-commit: 56ad9bb1b4f7463cf1d6eab8b6f924f46ff2c2fe
Component: engine
2017-06-23 15:28:55 -07:00
cd24ef2d4a avoid saving container state to disk before daemon.Register
Migrate legacy volumes (Daemon.verifyVolumesInfo) before containers are
registered on the Daemon, so state on disk is not overwritten and legacy
fields lost during registration.

Signed-off-by: Fabio Kung <fabio.kung@gmail.com>
Upstream-commit: 76d96418b13080514f3fb861072b06cb91d71cff
Component: engine
2017-06-23 07:52:34 -07:00
e529bcd027 Implement incremental file sync using client session
Also exposes shared cache and garbage collection/prune
for the source data.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: 5c3d2d552b0430672d5f481ab2d37036f6e92166
Component: engine
2017-06-22 11:52:35 -07:00
deaa6eb130 Use exclusive root pools if a CA cert file is specified in the daemon
Signed-off-by: Ying Li <ying.li@docker.com>
Upstream-commit: ddd5278b07b1c2b12b906244153fd9340e0d7910
Component: engine
2017-05-12 14:43:34 -07:00
6481987490 Expose trust key path in config
Allows storing key under any directory. In the case where the
"/etc/docker" directory is not preserved, this file can be
specified to a location where it will be preserved to ensure
the ID does not change across restarts.

Note this key is currently only used today to generate the ID
used in Docker info and for manifest schema v1 pushes. The key
signature and finger on these manifests are not checked or
used any longer for security, deprecated by notary.

Removes old key migration from a pre-release of Docker which put
the key under the home directory and was used to preserve ID used
for swarm v1 after the file moved.

closes #32135

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
Upstream-commit: e428c824c35e85a02fffee592b79ab7db1a0c4d2
Component: engine
2017-05-10 14:16:27 -07:00
1824504fe7 Ensure unmount before removing local volume.
When there is an error unmounting a local volume, it is still possible
to call `Remove()` on the volume causing removal of the mounted
resources which is generally not desirable.

This ensures that resources are unmounted before attempting removal.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: db3576f8a08ca70287bd3fdf9b21e162537f9d3a
Component: engine
2017-04-27 16:41:03 -04:00
7cbfe4a756 Merge pull request #32463 from FengtuWang/fix_TestExecWithUserAfterLiveRestore2
fix TestExecWithUserAfterLiveRestore
Upstream-commit: bc4560e512b7a35340247af04f32bb6f8469f0e3
Component: engine
2017-04-12 16:52:35 -07:00
3e6470e783 fix TestExecWithUserAfterLiveRestore
When container's status is running, shell command may have not
executed end. So if we use 'docker exec -u test' to execute
command, it may fail since user 'test' have not be added yet.

Signed-off-by: Fengtu Wang <wangfengtu@huawei.com>
Upstream-commit: c7c6167bcad5133dc94f7173cb40f3d974ef8a36
Component: engine
2017-04-10 14:40:29 +08:00
7de8729d6d Add test over ipv6 and container run in host network
Signed-off-by: Alessandro Boch <aboch@docker.com>
Upstream-commit: 010e5a228a633c6854ac28de62d5338c9206e80c
Component: engine
2017-04-07 16:58:20 -07:00
fd940e1e8e Deprecate --graph flag; Replace with --data-root
Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
Upstream-commit: 261ef1fa27c4dfefa5f686b0a4ef354a43040e58
Component: engine
2017-03-30 11:24:56 +02:00
6e632614a7 fix TestDaemonRestartWithInvalidBasesize
NotNil is expected behaviour, daemon should not start with
invalid base size.

Signed-off-by: Fengtu Wang <wangfengtu@huawei.com>
Upstream-commit: 1d74b4f6d4990901b918d82957bef4bb5f41294c
Component: engine
2017-03-29 17:32:25 +08:00
de10a198b8 [test-integration] Migrate some more tests to cli package
Add some required command operators to the `cli` package, and update
some tests to use this package, in order to remove a few functions
from `docker_utils_test.go`

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: eeaa6c96d83575da765dfc626c2c73d8a29dda32
Component: engine
2017-03-28 15:17:31 +02:00
9210b1bdbd Introduce a cli package for test-integration
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 50c4475df6304e0cf12ea95217eb00ab5d572e34
Component: engine
2017-03-23 18:35:22 +01:00
6df9f2365c Merge pull request #29552 from dnephin/fix-build-with-log-driver
Ignore the daemon log config when building images
Upstream-commit: 1b4e2b7c878fb69c1c96755e21a571e6d7b8e4bb
Component: engine
2017-02-07 15:47:41 -05:00
ba31fcddc2 Merge pull request #29692 from yongtang/29492-daemon-shm-size
Add daemon option `--default-shm-size`
Upstream-commit: 354bd4aaddc3072dbe9ead45b22a1eaccda6a506
Component: engine
2017-02-01 16:56:10 +01:00
1c2a160811 Ignore the daemon log config when building images.
Logs created by build containers should be handled by the daemon, not by logging drivers.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 80b642ff881d21ba6d006b8e52458335462d05b6
Component: engine
2017-01-30 10:59:19 -05:00
e290b2d1c4 Remove most of the runCommandWithOutput from integration tests
There is 5 calls left, that use StdinPipe that is not yet supported by
icmd.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: ecbb0e62f66da7d698c4f4583f36b927d8cfa811
Component: engine
2017-01-30 10:54:06 +01:00
b4140d991e Add daemon option --default-shm-size
This fix fixes issue raised in 29492 where it was not
possible to specify a default `--default-shm-size` in daemon
configuration for each `docker run``.

The flag `--default-shm-size` which is reloadable, has been
added to the daemon configuation.
Related docs has been updated.

This fix fixes 29492.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: db575ef626e8b2660750cbede6b19e951a3b4341
Component: engine
2017-01-27 12:17:06 -08:00
406aff91c7 fix some ineffectual assignments
to make goreportcard a bit happier
https://goreportcard.com/report/github.com/docker/docker

also found that `TestCpToErrDstParentNotExists()` was
partially broken, because a `runDockerCp()` was inadvertently
removed in f26a31e80cfcc77daba0872ddb14bf03f4398311

`TestDaemonRestartSaveContainerExitCode()` didn't verify
the actual _Error_ message, so added that to the test,
and updated the test to take into account that the
"experimental" CI enables `--init` on containers.

`TestVolumeCLICreateOptionConflict()` only checked
for an error to occur, but didn't validate if the
error was due to conflicting options.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: ba0afd70e89562aa3c668c87fb9191ed9edb7260
Component: engine
2017-01-24 11:16:19 +01:00
f7b8e381ec Use testEnv methods and remove most of the global variables
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: c8016e669f9507480745a441ba4cd735150ebb85
Component: engine
2017-01-17 12:39:08 +01:00
1334440bd8 Small cleanups on integration cli
- Join a few tests in one when it makes sense (reduce the number of
  container run and thus the overall time of the suites)
- Remove some duplication on several tests
- Remove some unused methods

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 9af5d7c34039d5e9d8a7dca6ea148147dc482dee
Component: engine
2017-01-12 16:57:59 +01:00
2b1a88aa3b Handle IPv6 enabling correctly in the tests
Signed-off-by: Santhosh Manohar <santhosh@docker.com>
Upstream-commit: d5e8d8e1cfb65cab9a2a651fd30c50a06afb4e00
Component: engine
2017-01-10 16:34:23 -08:00
78d1ff88be Update trustedCmd to be compatible with testutil/cmd
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 303b1d200af65ebb165602d0137f8b24b7c54d66
Component: engine
2017-01-09 11:07:05 +01:00
424f0925a7 Clean some runCommandWithOutput accross integration-cli code
There is still ways to go

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 87e3fcfe1e059780c4ee57abb097296fd29e09af
Component: engine
2017-01-05 17:44:31 +01:00
7979981cc5 Add test TestRestartPolicyWithLiveRestore
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: 89f034093a771fc1d3d161d23e018c25ae4e2ee3
Component: engine
2017-01-04 14:12:49 -08:00
a520da946c Merge pull request #29773 from forever043/fix_TestDaemonStartWithoutColors
test: Fix "--raw-logs=true" option test in TestDaemonStartWithoutColors
Upstream-commit: 2fd995bc999702bba49a802f7f054f657e1041fb
Component: engine
2017-01-03 09:29:19 +01:00