Commit graph

946 commits

Author SHA1 Message Date
Yong Tang
e0403604e2 Migrate some ipcmode tests to integration
This fix migrates some ipcmode tests in integration-cli
to integration tests.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-07-04 16:32:18 +00:00
Akihiro Suda
8f709d8948
Merge pull request #37351 from LotusFenn/unique-names-network-service-test
Use unique names in integration/network/service_test.go
2018-06-27 20:32:20 +09:00
Lotus Fenn
f94c97d320 add unique names to integration/network/service_test.go
Signed-off-by: Lotus Fenn <fenn.lotus@gmail.com>
2018-06-27 00:56:52 -07:00
Arash Deshmeh
8b07ec58ea refactored integration/service/network integration tests to use network package
Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
2018-06-26 17:18:22 -04:00
Sebastiaan van Stijn
af626ba08a
Merge pull request #37293 from adshmh/migrate-TestNetworkCreateDelete-to-integration
migrate TestAPINetworkCreateDelete from integration-cli/ to integration/
2018-06-21 19:08:08 -07:00
Arash Deshmeh
dda4128c7e refactor network inspect integration tests to use network package
Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
2018-06-21 09:44:52 -04:00
Arash Deshmeh
1c923b28b8 refactored remaining macvlan integration tests to use network package for creating networks
Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
2018-06-20 17:09:26 -04:00
Arash Deshmeh
6fc9c7e5a9 refactor ipvlan network integration tests to use network.Create
Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
2018-06-16 05:11:35 -04:00
Arash Deshmeh
f542621429 migrate TestAPINetworkCreateDelete from integration-cli/ to integration/
Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
2018-06-15 16:06:45 -04:00
Vincent Demeester
3f405c48ff
Merge pull request #37279 from adshmh/refactor-service-create-integration-tests-use-network-create
Create service integration tests use network package
2018-06-14 12:57:48 +02:00
Sebastiaan van Stijn
d3d58b68c6
Merge pull request #37270 from adshmh/refactor-service-network-integration-tests-use-network-create
refactored service network integration tests to use the network package
2018-06-13 13:11:31 -07:00
Arash Deshmeh
ad46a1f5e7 create service integration tests use network package
Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
2018-06-13 12:10:02 -04:00
Vincent Demeester
3845728524
Update tests to use gotest.tools 👼
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-06-13 09:04:30 +02:00
Arash Deshmeh
694047183a refactored network integration tests under integration/network/service_test.go to use network package
Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
2018-06-12 14:31:01 -04:00
Arash Deshmeh
991d512159 refactor delete network integration tests to use network package
Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
2018-06-09 06:39:22 -04:00
Vincent Demeester
162ba6016d
Merge pull request #37195 from adshmh/refactor-integration-test-create-network-calls-macvlan
Refactor macvlan network integration tests to use network.Create
2018-06-08 09:46:04 +02:00
Sebastiaan van Stijn
f11f249588
Merge pull request #37183 from vdemeester/service-create-init
Add support for `init` on services
2018-06-07 19:22:14 -07:00
Sebastiaan van Stijn
5ff12f6ba1
Merge pull request #37231 from adshmh/use-unique-names-for-integration-tests-service-create
use unique names for resources in create service integration tests
2018-06-07 17:47:07 -07:00
Vincent Demeester
d47c45175b
Merge pull request #37215 from adshmh/integration-container-links-tests-use-unique-names
container links integration tests use unique names
2018-06-07 22:34:12 +02:00
Arash Deshmeh
d5ae23fc11 use unique names for resources in create service integration tests
Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
2018-06-07 12:11:11 -04:00
Vincent Demeester
e401b88e59
Add support for init on services
It's already supported by `swarmkit`, and act the same as
`HostConfig.Init` on container creation.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-06-07 14:17:55 +02:00
Sebastiaan van Stijn
1fe0e49d20
Merge pull request #36644 from jessfraz/rawaccess
api: add MaskedPaths and ReadonlyPaths options
2018-06-06 18:16:16 -07:00
Arash Deshmeh
077247050d integration tests under integration/container/links_linux_test.go use unique names
Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
2018-06-06 06:14:24 -04:00
Jess Frazelle
3694c1e34e
api: add configurable MaskedPaths and ReadOnlyPaths to the API
This adds MaskedPaths and ReadOnlyPaths options to HostConfig for containers so
that a user can override the default values.

When the value sent through the API is nil the default is used.
Otherwise the default is overridden.

Adds integration tests for MaskedPaths and ReadonlyPaths.

Signed-off-by: Jess Frazelle <acidburn@microsoft.com>
2018-06-05 12:33:14 -04:00
Arash Deshmeh
0418893f0b refactored integration tests under integration/network/macvlan to use network.Create
Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
2018-06-05 06:32:24 -04:00
Arash Deshmeh
0e3012cfff Added network package to integration/internal to refactor integration tests calls to client.NetworkCreate
Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
2018-06-05 06:32:24 -04:00
Derek McGowan
52ed3e0896
Update containerd to 1.1
Updates swarmkit, grpc, and all related vendors

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2018-06-04 15:37:03 -07:00
Sebastiaan van Stijn
d7e94d6ea7
Merge pull request #37191 from adshmh/use-unique-names-for-integration-tests-secret
use unique names for resources in integration tests of secret package
2018-06-05 00:06:50 +02:00
Tonis Tiigi
c9ebd2f13b vendor: use dockerfile parser from buildkit
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-06-02 11:10:34 -07:00
Arash Deshmeh
a70794aff0 use unique names for resources in integration tests of integration/secret package
Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
2018-06-01 06:46:52 -04:00
Anda Xu
d8e6f273b5 fix the mis-used skip condition
Signed-off-by: Anda Xu <anda.xu@docker.com>
2018-05-30 17:13:20 -07:00
Tibor Vass
0a94468a5b
Merge pull request #37169 from AntaresS/add-version-checking
add api version checking for tests from new feature
2018-05-30 09:58:45 -10:00
Brian Goff
b85799b63f
Merge pull request #36874 from kolyshkin/stop-timeout
daemon.ContainerStop(): fix for a negative timeout
2018-05-30 13:38:42 -04:00
Anda Xu
8ed0fdebe7 add api version checking for tests from new feature
Signed-off-by: Anda Xu <anda.xu@docker.com>
2018-05-29 15:25:33 -07:00
Yong Tang
76195f8047 Add t.Name() to tests so that service names are unique
This fix adds `t.Name()` to tests in integration/network
so that services created in those tests have unique names.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-05-28 22:57:52 +00:00
Sebastiaan van Stijn
a061b1e2d8
Adjust API version to match correct release
This fix was not yet included in Docker 17.05, so
API version v1.37 was not the right selector (Docker
18.03, 18.04 and 18.05 all support API v1.37).

We should change these checks for engine versions,
or use a different method to skip tests when running
against older engines.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-05-24 02:39:56 +02:00
Sebastiaan van Stijn
f23c00d870
Various code-cleanup
remove unnescessary import aliases, brackets, and so on.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-05-23 17:50:54 +02:00
Anda Xu
84598be35f skip feature/test added that is breaking ee
Signed-off-by: Anda Xu <anda.xu@docker.com>
2018-05-22 17:42:41 -07:00
Anda Xu
b9b4f88870 more fixes on integration
Signed-off-by: Anda Xu <anda.xu@docker.com>
2018-05-22 11:25:25 -07:00
Yong Tang
9bd5d9912f
Merge pull request #37110 from thaJeztah/remove-testutil-errorcontains
Replace deprecated testutil.ErrorContains()
2018-05-21 11:04:45 -07:00
Dennis Chen
476d7872ef Some slight tweaks for the integration test
`arm64` needs get more time duration for the test to finish.

`pty.Start()` opens a file, so the caller should close it explicitly,
else the file I/O can result in unexpected data synchronization issue.

All those changes will not affect the test itself.

Signed-off-by: Dennis Chen <dennis.chen@arm.com>
2018-05-21 10:08:27 +08:00
Sebastiaan van Stijn
8974fd47c7
Merge pull request #37011 from arm64b/ReAdd-LABEL-command-4-target-option
Construct and add 'LABEL' command from 'label' option to last stage
2018-05-21 00:15:02 +02:00
Sebastiaan van Stijn
55bebbaecf
Replace deprecated testutil.ErrorContains()
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-05-21 00:13:04 +02:00
Sebastiaan van Stijn
4f8c870d62
Fix some linting issues
These showed locally when running `make validate`. CI doesn't seem to have the
same (possibly it's disabled in the configuration)

    builder/fscache/fscache.go:618::error: github.com/docker/docker/vendor/github.com/tonistiigi/fsutil.StatInfo composite literal uses unkeyed fields (vet)
    client/swarm_unlock_test.go:44::error: github.com/docker/docker/api/types/swarm.UnlockRequest composite literal uses unkeyed fields (vet)
    client/swarm_unlock_test.go:20::error: github.com/docker/docker/api/types/swarm.UnlockRequest composite literal uses unkeyed fields (vet)
    cmd/dockerd/daemon_unix.go:113::error: github.com/docker/docker/cmd/dockerd/hack.MalformedHostHeaderOverride composite literal uses unkeyed fields (vet)
    cmd/dockerd/daemon_unix.go:110::error: github.com/docker/docker/cmd/dockerd/hack.MalformedHostHeaderOverride composite literal uses unkeyed fields (vet)
    daemon/graphdriver/overlay/overlay.go:171::error: github.com/docker/docker/pkg/idtools.IDPair composite literal uses unkeyed fields (vet)
    daemon/graphdriver/overlay/overlay.go:413::error: github.com/docker/docker/pkg/idtools.IDPair composite literal uses unkeyed fields (vet)
    daemon/graphdriver/overlay2/overlay.go:203::error: github.com/docker/docker/pkg/idtools.IDPair composite literal uses unkeyed fields (vet)
    daemon/graphdriver/overlay2/overlay.go:584::error: github.com/docker/docker/pkg/idtools.IDPair composite literal uses unkeyed fields (vet)
    daemon/graphdriver/zfs/zfs.go:109::error: github.com/docker/docker/pkg/idtools.IDPair composite literal uses unkeyed fields (vet)
    daemon/graphdriver/zfs/zfs.go:388::error: github.com/docker/docker/pkg/idtools.IDPair composite literal uses unkeyed fields (vet)
    daemon/volumes_windows.go:27::error: github.com/docker/docker/pkg/idtools.IDPair composite literal uses unkeyed fields (vet)
    integration/service/network_test.go:31::error: github.com/docker/docker/api/types/network.NetworkingConfig composite literal uses unkeyed fields (vet)
    api/server/server.go:129:10⚠️ should not use basic type string as key in context.WithValue (golint)
    integration/service/network_test.go:54::error: github.com/docker/docker/api/types/network.NetworkingConfig composite literal uses unkeyed fields (vet)
    libcontainerd/client_daemon_linux.go:61::error: github.com/docker/docker/pkg/idtools.IDPair composite literal uses unkeyed fields (vet)
    libcontainerd/client_daemon_linux.go:74::error: github.com/docker/docker/pkg/idtools.IDPair composite literal uses unkeyed fields (vet)
    pkg/archive/archive_windows.go:76::error: github.com/docker/docker/pkg/idtools.IDPair composite literal uses unkeyed fields (vet)
    plugin/manager_linux.go:56::error: github.com/docker/docker/pkg/idtools.IDPair composite literal uses unkeyed fields (vet)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-05-17 19:28:27 +02:00
Dennis Chen
f7add4262b Add test case for --label with --target
Add a new test case `TestBuildLabelWithTargets` to cover the Docker builder
with both `--label` and `--target` options.

Signed-off-by: Dennis Chen <dennis.chen@arm.com>
2018-05-17 09:41:06 +08:00
Anda Xu
e440831802 fix and skip some tests based on API version
Signed-off-by: Anda Xu <anda.xu@docker.com>

Co-authored-by: Anda Xu <anda.xu@docker.com>
Co-authored-by: Tibor Vass <tibor@docker.com>
2018-05-15 16:05:04 -07:00
Vincent Demeester
25494e4c74
Fix logging test type
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-05-15 15:04:46 +02:00
Sebastiaan van Stijn
6821ffd1a1
Merge pull request #37028 from cpuguy83/log_plugin_broken_pipe
Fix logging plugin crash unrecoverable
2018-05-15 13:57:01 +02:00
Vincent Demeester
829dcefa9d
Merge pull request #37044 from yongtang/03112018-TestDockerNetworkConnectAlias-name
Avoid unique name usage in TestDockerNetworkConnectAlias
2018-05-15 11:46:11 +02:00
Vincent Demeester
bcd86fc2ac
Merge pull request #37060 from cpuguy83/fix_swagger_gen
Fix swagger volume type generation
2018-05-15 11:46:02 +02:00
Yong Tang
6de3be1366
Merge pull request #37030 from adshmh/refactor-service-create-integration-tests-use-swarm-create-service
Refactor service create integration tests to use swarm CreateService
2018-05-14 14:07:22 -07:00
Brian Goff
e7479e3ab8 Fix logging plugin crash unrecoverable
In cases where a logging plugin has crashed when the daemon tries to
copy the container stdio to the logging plugin it returns a broken pipe
error and any log entries that occurr while the plugin is down are lost.

Fix this by opening read+write in the daemon so logs are not lost while
the plugin is down.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2018-05-14 16:51:56 -04:00
Brian Goff
b16b125bb4 Fix swagger volume type generation
This was broken by bf6a790f00

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2018-05-14 13:46:20 -04:00
Yong Tang
e7b5f4500d Avoid unique name usage in TestDockerNetworkConnectAlias
In TestDockerNetworkConnectAlias the network and container
names used are unique which are not preferred. This
fix address the issue by appending t.Name() so that
names are randomized.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-05-14 16:59:13 +00:00
Abhinandan Prativadi
a059d6f4f5 Fixing network inspect for swarm
Signed-off-by: Abhinandan Prativadi <abhi@docker.com>
2018-05-13 07:31:14 -07:00
Arash Deshmeh
e9a687146a refactor integration tests under integration/service/create_test.go to use swarm.CreateService
Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
2018-05-10 05:45:49 -04:00
Sebastiaan van Stijn
6d20814819
Merge pull request #36803 from adshmh/refactor-network-integration-tests-use-swarm-create-service
refactored network integration tests to make use of swarm.CreateService
2018-05-08 00:21:32 +02:00
Kir Kolyshkin
69b4fe4065 daemon.ContainerStop(): fix for a negative timeout
1. As daemon.ContainerStop() documentation says,

> If a negative number of seconds is given, ContainerStop
> will wait for a graceful termination.

but since commit cfdf84d5d0 (PR #32237) this is no longer the case.

This happens because `context.WithTimeout(ctx, timeout)` is implemented
as `WithDeadline(ctx, time.Now().Add(timeout))`, resulting in a deadline
which is in the past.

To fix, don't use WithDeadline() if the timeout is negative.

2. Add a test case to validate the correct behavior and
as a means to prevent a similar regression in the future.

3. Fix/improve daemon.ContainerStop() and client.ContainerStop()
description for clarity and completeness.

4. Fix/improve DefaultStopTimeout description.

Fixes: cfdf84d5d0 ("Update Container Wait")
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2018-05-03 10:04:33 -07:00
Brian Goff
82d9185470
Merge pull request #36396 from selansen/master
Allow user to specify default address pools for docker networks
2018-05-03 06:34:14 -04:00
Alessandro Boch
173b3c364e Allow user to control the default address pools
- Via daemon flag --default-address-pools base=<CIDR>,size=<int>

Signed-off-by: Elango Siva  <elango@docker.com>
2018-04-30 11:14:08 -04:00
Tibor Vass
765a9f31ad
Merge pull request #36944 from vdemeester/fix-e2e-run
Skip some test on remote daemon for e2e run(s)
2018-04-27 05:03:12 -10:00
Vincent Demeester
ef2c2040c2 Skip some test on remote daemon for e2e run(s)
We really need to run those on the CI too at some point.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Signed-off-by: Tibor Vass <tibor@docker.com>
2018-04-26 16:25:52 +00:00
Sebastiaan van Stijn
18bfe3c128
Merge pull request #36924 from runcom/fix-created-rp
restartmanager: do not apply restart policy on created containers
2018-04-25 21:48:01 +02:00
Antonio Murdaca
75d3214934
restartmanager: do not apply restart policy on created containers
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2018-04-24 11:41:09 +02:00
Kir Kolyshkin
7d62e40f7e Switch from x/net/context -> context
Since Go 1.7, context is a standard package. Since Go 1.9, everything
that is provided by "x/net/context" is a couple of type aliases to
types in "context".

Many vendored packages still use x/net/context, so vendor entry remains
for now.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2018-04-23 13:52:44 -07:00
Yong Tang
67535921b3 Some improvement in restart_test.go
This fix consists of some improvement in restart_test.go
by replacing Fatal with assert, so that they are consistent
with other tests in integration/container.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-04-21 19:42:20 +00:00
Arash Deshmeh
8e335e00bb refactored network integration tests to make use of swarm.CreateService
Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
2018-04-21 09:07:57 -04:00
Vincent Demeester
cb8db44395
Make testing helpers as such…
That way, those lines won't be reported in the failure.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-04-20 10:38:43 +02:00
Vincent Demeester
69bab3832c
Migrate test-integration-cli experimental plugin tests to integration
All `plugins` tests that require an `ExperimentalDaemon` are migrated
to `integration/plugin/*` and start an experimental daemon to test on
it.

The end goal being to remove the `experimental` build.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-04-19 11:57:28 +02:00
Vincent Demeester
aa0db6f9e1
Migrate TestAPISwarmServicesPlugin to integration
Also starts to create more "poll/check" function to `internal/test/daemon`.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-04-18 16:18:53 +02:00
Vincent Demeester
42f6fdf059
Move integration-cli/request to internal/test/request…
… and change a bit the method signature

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-04-17 16:25:59 +02:00
Vincent Demeester
062564084a
Move fakecontext, fakegit and fakestorage to internal/test
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-04-17 09:53:09 +02:00
Anusha Ragunathan
abb1661907
Merge pull request #36841 from yongtang/02222018-tag-test
Migrate image tag tests from integration-cli to api tests
2018-04-16 17:53:48 -07:00
Anusha Ragunathan
f9c4e63026
Merge pull request #36838 from vdemeester/integration-fixtures-refactoring
Clean some integration-cli/fixtures package/files
2018-04-16 17:49:29 -07:00
Vincent Demeester
5f56503f58
Clean some integration-cli/fixtures package/files
- Move go package used by both `integration-cli` and `integration` to
  `internal/test/fixtures`.
- Remove fixtures that are not used anymore (moved to `docker/cli` a
  while ago) : deploy, notary, secrets.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-04-16 10:48:58 +02:00
Vincent Demeester
239a8a5189
Small daemon refactoring and add swarm init/join helpers
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-04-16 10:20:10 +02:00
Yong Tang
ab9bb47b05 Some enhancement in integration tests
This fix converts some `client.ContainerCreate` to `container.Create`,
and removes some unneeded `name` fields when test containers are created.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-04-14 16:52:02 +00:00
Yong Tang
9bcb960508 Migrate image tag tests from integration-cli to api tests
This fix migrates image tag tests from integration-cli to api tests.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-04-13 14:46:40 +00:00
Brian Goff
76e47a08c5
Merge pull request #36595 from runcom/oom-docker-cp-authz
copy: avoid using all system memory with authz plugins
2018-04-12 13:42:56 -04:00
Sebastiaan van Stijn
6f4bf5629c
Merge pull request #36722 from vdemeester/network-ipvlan-test-migration
Migrate test-integration-cli experimental ipvlan test to integration
2018-04-11 14:51:25 -07:00
Brian Goff
74f8e47352 Limit authz response buffer
When the authz response buffer limit is hit, perform a flush.
This prevents excessive buffer sizes, especially on large responses
(e.g. `/containers/<id>/archive` or `/containers/<id>/export`).

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2018-04-11 15:36:36 -04:00
Sebastiaan van Stijn
ce3c2e2331
Merge pull request #36826 from vdemeester/integration-daemon-swarm-refactoring
Make internal/test/daemon.Daemon swarm aware
2018-04-11 09:33:58 -07:00
Vincent Demeester
83d18cf4e3
Make internal/test/daemon.Daemon swarm aware
This remove the daemon.Swarm construction by make the new test Daemon
struct aware of swarm.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-04-11 12:10:17 +02:00
Vincent Demeester
a3323d2e43
Move ipvlan and macvlan tests on their own folder…
… making each folder/suites quicker to run

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-04-11 11:14:58 +02:00
Vincent Demeester
0ab6116ce8
Refactor macvlan tests a bit
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-04-11 11:14:54 +02:00
Vincent Demeester
24f9347511
Migrate test-integration-cli experimental ipvlan test to integration
All `Ipvlan` related test on `DockerSuite` and `DockerNetworkSuite`
are migrated to `ipvlan_test.go`.

The end goal being to remove the `experimental` builds.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-04-11 11:14:47 +02:00
Michael Crosby
4c000662fe Don't make container mount unbindable
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2018-04-10 15:14:34 -04:00
Sebastiaan van Stijn
68dd184c7c
Merge pull request #36824 from vdemeester/integration-daemon-refactoring
Move integration-cli daemon package to internal/test…
2018-04-10 10:06:09 -07:00
Vincent Demeester
f0d277fe84
Move integration-cli daemon package to internal/test…
… and do not use the `docker` cli in it. One of the reason of this
move is to not make `integration` package using legacy
`integration-cli` package.

Next move will be to support swarm within this package *and* provide
some helper function using the api (compared to the one using cli in
`integration-cli/daemon` package).

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-04-10 16:29:48 +02:00
Vincent Demeester
cbde00b442
Merge pull request #36746 from vdemeester/experimental-build-tests
Migrate test-integration-cli experimental build tests to integration
2018-04-09 10:21:03 +02:00
Arash Deshmeh
69481edc07 integration tests under integration/config use unique names when creating resources
Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
2018-04-06 06:06:02 -04:00
Sebastiaan van Stijn
27749659d5
Bump SwarmKit to 831df679a0b8a21b4dccd5791667d030642de7ff
Changes included:

- Ingress network should not be attachable
- [manager/state] Add fernet as an option for raft encryption
- Log GRPC server errors
- Log leadership changes at manager level
- [state/raft] Increase raft ElectionTick to 10xHeartbeatTick
- Remove the containerd executor
- agent: backoff session when no remotes are available
- [ca/manager] Remove root CA key encryption support entirely
- Fix agent logging race (fixes https://github.com/docker/swarmkit/issues/2576)
- Adding logic to restore networks in order

Also adds github.com/fernet/fernet-go as a new dependency

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-02 15:17:38 -07:00
Vincent Demeester
635f359f8b
Merge pull request #36706 from arm64b/add-defult-timeout-config-func
Add default pollSettings config functions
2018-03-30 19:31:06 +02:00
Vincent Demeester
183076e89d
Migrate test-integration-cli experimental build tests to integration
All `docker build` tests that require an `ExperimentalDaemon` are
migrated to `integration/build` package and start an experimental
daemon to test on it.

The end goal being to remove the `experimental` builds.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-03-30 13:10:02 +02:00
Vincent Demeester
e55d6fc857 Skip some tests in certain condition to run with e2e image
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-03-29 09:10:39 +02:00
Dennis Chen
b8912feeff Using the default PollSettings function
Using the default PollSettings functions to adjust the timeout
value instead of changing the value each time when needed.

Signed-off-by: Dennis Chen <dennis.chen@arm.com>
2018-03-29 05:00:14 +00:00
Dennis Chen
ee6959addc Add default pollSettings adjustment routines
Add the default function per resource to override the `pollSettings`
which will be re-used where it's needed.

Signed-off-by: Dennis Chen <dennis.chen@arm.com>
2018-03-29 04:47:14 +00:00
Anusha Ragunathan
18d1688530
Merge pull request #36711 from cpuguy83/plugin_mounts_sorting
Don't sort plugin mounts slice
2018-03-28 11:57:38 -07:00
Brian Goff
ec90839ca3 Don't sort plugin mounts slice
This was added as part of a53930a04f with
the intent to sort the mounts in the plugin config, but this was sorting
*all* the mounts from the default OCI spec which is problematic.

In reality we don't need to sort this because we are only adding a
self-binded mount to flag it as rshared.

We may want to look at sorting the plugin mounts before they are added
to the OCI spec in the future, but for now I think the existing behavior
is fine since the plugin author has control of the order (except for the
propagated mount).

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2018-03-28 09:10:43 -04:00
Vincent Demeester
ef5bc60326
Migrate test-integration-cli experimental macvlan test to integration
All `Macvlan` related test on `DockerSuite` and `DockerNetworkSuite`
are migrated to `macvlan_test.go`.

Also, as `macvlan` seems to be out of experimental, this removes
the *skip* when the run is not experimental (and doesn't start a
daemon with experimental either).

The end goal being to remove the `experimental` builds.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-03-28 10:47:11 +02:00
Catalin Pirvu
90b514922b Use unique names for container/rename_test.go
Signed-off-by: Catalin Pirvu <pirvu.catalin94@gmail.com>
2018-03-25 21:16:32 +03:00
Akihiro Suda
57c504799d
Merge pull request #36662 from adshmh/use-unique-resource-names-for-container-inspect-ps-stop-integration-tests
Use unique names for test resources of container/inspect, container/ps, container/stop tests
2018-03-23 12:16:53 +09:00
Sebastiaan van Stijn
00c59ed77e
Merge pull request #36647 from adshmh/use-unique-names-for-container-nat-test-containers
use unique names for test containers of container/nat integration tests
2018-03-22 14:03:36 +01:00
Sebastiaan van Stijn
e2bede01e4
Merge pull request #36172 from kolyshkin/systemd-memlimit
Test for systemd cgroupdriver memory setting
2018-03-22 13:36:43 +01:00
Arash Deshmeh
78e4be9133 use unique names for resources used by integration tests container/inspect_test, container/ps_test, container/stop_test
Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
2018-03-21 17:47:49 -04:00
selansen
dabffd806c Fix for Flaky test TestServiceWithPredefinedNetwork
TestServiceWithPredefinedNetwork test case was failing
	at times. To fix the issue, added new API to check
	for services after we clean up all services. Tested
	multiple times and this sould fix flaky issue.

Signed-off-by: selansen <elango.siva@docker.com>
2018-03-21 11:49:23 -04:00
Vincent Demeester
4460472f4e
Merge pull request #36594 from vdemeester/e2e-more-run
integration/*: make e2e run without failure
2018-03-21 08:54:39 +01:00
Arash Deshmeh
b4d1547af6 container/nat integration tests use unique names for test containers
Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
2018-03-20 17:11:03 -04:00
Kir Kolyshkin
4ca5c53610 Test for systemd cgroupdriver memory setting
This is a test case for issue https://github.com/moby/moby/issues/35123,
making sure we can set container's memory limit when using
`native.cgroupdriver=systemd`.

[v2: skip if no systemd present]
[v3: add --iptables=false to avoid flaky tests with t.Parallel()]
[v4: rebase after PR#36507 merge]

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2018-03-19 10:33:03 -07:00
Arash Deshmeh
a0052b8f19 Add the missing call to setupTest to TestNetworkLoopbackNat test function, to avoid leaving behind test containers
Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
2018-03-19 10:56:13 -04:00
Vincent Demeester
6016e79d25
integration/*: make e2e run without failure
… mainly by skipping if daemon is remote.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-03-19 09:47:17 +01:00
Daniel Nephin
c9e52bd0da Post migration assertion fixes
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2018-03-16 11:03:46 -04:00
Daniel Nephin
6be0f70983 Automated migration using
gty-migrate-from-testify --ignore-build-tags

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2018-03-16 11:03:43 -04:00
Vincent Demeester
823de22db6
Merge pull request #36606 from kolyshkin/t-36561
integration/TestExportContainerAfterDaemonRestart: add
2018-03-16 12:07:46 +01:00
Kir Kolyshkin
6e7141c7a2 integration/TestExportContainerAfterDaemonRestart: add
This test case checks that a container created before start
of the currently running dockerd can be exported (as reported
in #36561). To satisfy this condition, either a pre-existing
container is required, or a daemon restart after container
creation.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2018-03-15 00:30:11 -07:00
Brian Goff
834d0e262a Add some tests to the volume store
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2018-03-14 17:17:44 -04:00
Sebastiaan van Stijn
514fb6cf85
Merge pull request #36538 from ctelfer/ingress-fix
Fix automatic removal of ingress sandbox when last service leaves
2018-03-13 20:56:03 +01:00
Sebastiaan van Stijn
fb95dc7eac
Merge pull request #36569 from kolyshkin/t-etc-hosts
TestLinksEtcHostsContentMatch: use container.Exec()
2018-03-13 15:12:59 +01:00
Kir Kolyshkin
ad2f88d8cc TestLinksEtcHostsContentMatch: use container.Exec()
I am not quite sure why but this test is sometimes failing like this:

> 15:21:41 --- FAIL: TestLinksEtcHostsContentMatch (0.53s)
> 15:21:41 	assertions.go:226:
>
> 	Error Trace:	links_linux_test.go:46
> 15:21:41
> 	Error:      	Not equal:
> 15:21:41
> 	            	expected: "127.0.0.1\tlocalhost\n::1\tlocalhost
> ip6-localhost
> ip6-loopback\nfe00::0\tip6-localnet\nff00::0\tip6-mcastprefix\nff02::1\tip6-allnodes\nff02::2\tip6-allrouters\n172.17.0.2\tf53feb6df161\n"
> 15:21:41
> 	            	received: ""

To eliminate some possible failures (like ignoring stderr from `cat` or
its exit code), let's use container.Exec() to read a file from a container.

Fixes: e6bd20edcb ("Migrate some integration-cli test to api tests")
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2018-03-12 18:15:16 -07:00
Kir Kolyshkin
c125e10a04 integration/TestContainerShmNoLeak: use --iptables=false
As mentioned in commit 9e31938, test cases that use t.Parallel()
and start a docker daemon might step on each other toes as they
try to configure iptables during startup, resulting in flaky tests.

To avoid this, --iptables=false should be used while starting daemon.

Fixes: eaa5192856 ("Make container resource mounts unbindable")
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2018-03-12 14:49:15 -07:00
Chris Telfer
805b6a7f74 Add test for ingress removal on service removal
The commit https://github.com/moby/moby/pull/35422 had the result of
accidentally causing the removal of the ingress network when the
last member of a service left the network.  This did not appear
in swarm instances because the swarm manager would still maintain
and return cluster state about the network even though it had
removed its sandbox and endpoint.  This test verifies that after a
service gets added and removed that the ingress sandbox remains
in a functional state.

Signed-off-by: Chris Telfer <ctelfer@docker.com>
2018-03-12 15:19:02 -04:00
Daniel Nephin
038f3add51 Remove unnecessary diff tests
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2018-03-09 12:32:50 -05:00
Sebastiaan van Stijn
0b0af855ae
Merge pull request #36316 from selansen/36247
Fix to address regression caused by PR 30897
2018-03-06 13:40:29 +01:00
Vincent Demeester
2f7a76a6a0
Merge pull request #36444 from yongtang/02142018-events-tests
Migrate events tests to api tests
2018-03-06 08:36:30 +01:00
Yong Tang
e02fa4a679
Merge pull request #36490 from yongtang/03052018-expected-actual
Address `expected` vs `actual` in integration tests
2018-03-05 19:40:53 -08:00
selansen
7cf8b20762 Fix to address regression caused by PR 30897
With the inclusion of PR 30897, creating service for host network
    fails in 18.02. Modified IsPreDefinedNetwork check and return
    NetworkNameError instead of errdefs.Forbidden to address this issue

Signed-off-by: selansen <elango.siva@docker.com>
2018-03-05 19:10:39 -05:00
Yong Tang
8a854e933b Address expected vs actual in integration tests
This fix addresses `expected` vs `actual` in integration tests
so that they match `assert.Equal(t, expected, actual)`

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-03-05 20:39:42 +00:00
Yong Tang
ed58ba99fb Migrate docker rm tests to api tests
This fix migrates docker rm test in integration-cli
to api tests.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-03-05 20:35:14 +00:00
Yong Tang
4b2fb7e394
Merge pull request #36468 from vdemeester/e2e-container-run
Fixes some integration/container tests to run on remote daemon
2018-03-05 12:23:24 -08:00
Vincent Demeester
3af9b1d395
Merge pull request #36471 from yongtang/03022018-improvement
Improvement in integration tests
2018-03-05 17:54:09 +01:00
Yong Tang
3a749157d2 Migrate events tests to api tests
This fix migrates events tests in integration-cli to api tests.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-03-05 16:13:48 +00:00
Vincent Demeester
18dd1d9aba
Fixes some integration/container test to run on remote daemon
```
docker build -f Dockerfile.e2e -t moby-e2e .
docker run -v /var/run/docker.sock:/var/run/docker.sock \
           -e TEST_INTEGRATION_DIR=/tests/integration/container \
           -e DOCKER_API_VERSION=1.36 moby-e2e
```

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-03-05 14:24:01 +01:00
Sebastiaan van Stijn
e3814ece21
Merge pull request #36476 from yongtang/03022018-kill_test
Remove unnecessary container.WithName in kill test
2018-03-05 11:42:30 +01:00
Akihiro Suda
e734e8f515
Merge pull request #36459 from yongtang/02282018-export-test
Migrate export tests to api tests
2018-03-03 12:29:53 +09:00
Yong Tang
1778719d6a Remove unnecessary container.WithName in kill test
This fix removes several unnecessary `container.WithName`
usage in docker kill integration test.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-03-03 01:06:49 +00:00
Yong Tang
6ab465804b Improvement in integration tests
This fix adds several improvement:
1. No need for explicit ContainerRemove as it has been handled in setupTest()
2. Added `container.WithImage` helper function and used it in commit tests.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-03-02 19:03:59 +00:00
Yong Tang
4e702cf70d Migrate export tests to api tests
This fix migrates export tests in integration-cli to api tests.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-03-02 00:44:03 +00:00
Yong Tang
9045406144 Add missing canonical import comment to files in integration tests
The  canonical import comment was added some time ago, though several
newly added files do not have the comment. This fix adds the missing
canonical import comment to files in integration tests

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-03-01 22:51:11 +00:00
Sebastiaan van Stijn
7459e4cd4f
Merge pull request #36455 from thaJeztah/flip-asserts
Fix "expected" and "actual" being reversed
2018-03-01 21:31:46 +01:00
Sebastiaan van Stijn
a2517cbf62
Fix "expected" and "actual" being reversed
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-03-01 14:16:19 +01:00
Yong Tang
6ad4720c78 Enhancement of replacing ContainerCreate with helper funcs in tests
This fix is a minor enhancement to replace several ContainerCreate with
helper funcs of `container.Create` in tests.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-02-28 21:35:56 +00:00
Sebastiaan van Stijn
75377ec12c
Merge pull request #36434 from dnephin/fix-cp-cli-tests
Migrate some container copy tests to integration
2018-02-28 12:28:18 +01:00
Sebastiaan van Stijn
973cf656dd
Merge pull request #36430 from yongtang/02262018-config-test
Migrate config inspect test to api test
2018-02-28 11:50:52 +01:00
Yong Tang
4b99d78207 Migrate config inspect test to api test
This fix migrates config inspect test in integration-cli
to api test.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-02-27 23:25:07 +00:00
Daniel Nephin
00d409f03e Migrate some copy tests to integration
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2018-02-27 16:48:35 -05:00
Yong Tang
6bd4f4801b Migrate several docker rm tests to api tests
This fix migrates several docker rm tests to api tests

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-02-27 19:20:01 +00:00
Vincent Demeester
407e122ac3
Merge pull request #36292 from yongtang/0212-2018-volumes-tests
Migrate volumes tests in integration-cli to api tests
2018-02-27 13:06:06 +01:00
Vincent Demeester
2c24bfd070
Merge pull request #36406 from yongtang/02222018-secret-create-with-labels
Migrate some config secret tests to api test
2018-02-27 10:01:39 +01:00
Yong Tang
d896f87c05 Migrate volumes tests in integration-cli to api tests
This fix migrates volumes tests in integration-cli to api tests
in integration/

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-02-27 05:18:31 +00:00
Vincent Demeester
600475715e
Merge pull request #36338 from tonistiigi/fix-copy-leak
builder: fix layer lifecycle leak
2018-02-26 22:36:40 +01:00
Yong Tang
99e2818850 Migrate some config secret tests to api test
This fix migrates some secret create tests to api tests,
and remove redundant TestConfigCreate.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-02-25 23:58:04 +00:00
Yong Tang
eda311c18f Move containerIsStopped/containerIsInState to integration/internal/container
This fix moves helper functions containerIsStopped and
containerIsInState to integration/internal/container,
so that they could be used outside of integration/container.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-02-23 21:23:05 +00:00
Sebastiaan van Stijn
0076343b29
Merge pull request #33702 from aaronlehmann/templated-secrets-and-configs
Templated secrets and configs
2018-02-21 13:39:10 +01:00
Sebastiaan van Stijn
466cc98143
Merge pull request #34899 from dnephin/fix-duplicate-new-client
[client] Remove duplicate NewClient functions
2018-02-21 12:59:42 +01:00
Kir Kolyshkin
31825081d4 integration/testUpdateCPUQuota: fix name
The function name should be TestUpdateCPUQuota and not TestUpdateCPUQUota.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2018-02-20 13:36:27 -08:00
Kir Kolyshkin
cc86647098 integration/TestUpdateMemory: fix false failure
This fixes the following test failure:

> --- FAIL: TestUpdateMemory (0.53s)
>  	assertions.go:226:
>	Error Trace:	update_linux_test.go:52
>	Error:      	Not equal:
>	            	expected: int(524288000)
>	            	received: int64(524288000)

Fixes: 0f9da07b56
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2018-02-20 13:31:03 -08:00
Daniel Nephin
a68ae4a2d9 Improve docstrings and small cleanup in client
Use client instead of helpers for TLS in integration test

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2018-02-20 15:15:02 -05:00
Tonis Tiigi
7ad41d53df builder: fix layer lifecycle leak
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-02-20 11:14:53 -08:00
Sebastiaan van Stijn
ee9abc2120
Merge pull request #36326 from kolyshkin/integration-exec
Add/use container.Exec() to integration
2018-02-20 17:16:09 +01:00
Vincent Demeester
7060a40add
Merge pull request #36330 from vdemeester/migrate-container-list-tests
test: clean/migrate some docker ps cli-only integration tests
2018-02-20 08:44:17 +01:00
Kir Kolyshkin
0f9da07b56 integration/TestUpdateMemory: simplify
1. Use integration/internal/exec, removing the getContainerSysFSValue().

2. Avoid repeating magic numbers, use a variable for those.

3. Fix order of arguments to assert.Equal (first "expected", then "actual").

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2018-02-19 11:25:27 -08:00
Kir Kolyshkin
8a7d6143fc integration/TestUpdateCPUQUota: use exec
An implementation of exec in TestUpdateCPUQUota had a few issues,
including resource leaking and calling both ContainerExecAttach and
ContainerExecRun. The last one makes the test flaky:

	update_linux_test.go:136: expected cgroup value 20000, got: Error: Exec
	command f923baf709525f6b38f6511126addc5d9bb88fb477eeca1c22440551090fa2bb
	is already running

Fix by using the integration/internal/exec package.

While at it, use require/assert to further improve code readability.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2018-02-19 11:25:27 -08:00
Kir Kolyshkin
01143afe54 integration: add container.Exec()
Some test cases might need an ability to execute a command inside a
container (in order to analyse its output and/or exit code). It is a bit
complicated operation to do so using engine API. The function provided
aims to hide this complexity, making exec almost as simple as 'docker
exec'.

NOTE that the exec is synchronous, and command's stdin is closed.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2018-02-19 11:25:11 -08:00
Vincent Demeester
8cf42d3ad8
Merge pull request #36329 from tonistiigi/tar-cache-fix
builder: fix wrong cache hits building from tars
2018-02-19 12:01:20 +01:00
Vincent Demeester
641c73d211
Clean some cli-only integration tests
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-02-19 11:19:19 +01:00
Brian Goff
c02171802b Merge configs/secrets in unix implementation
On unix, merge secrets/configs handling. This is important because
configs can contain secrets (via templating) and potentially a config
could just simply have secret information "by accident" from the user.
This just make sure that configs are as secure as secrets and de-dups a
lot of code.
Generally this makes everything simpler and configs more secure.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2018-02-16 11:25:14 -05:00
Aaron Lehmann
cdd2e6efdb integration-cli: Add secret/config templating tests
Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2018-02-16 11:25:13 -05:00
Tonis Tiigi
f6c8266afd builder: fix wrong cache hits building from tars
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-02-15 23:42:42 -08:00
Brian Goff
b0b9a25e7e 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>
2018-02-15 11:53:11 -05:00
Sebastiaan van Stijn
ce35439015
Fix import path
The utils package was moved to "internal" in commit
af306d149e

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-02-15 15:29:45 +01:00
Sebastiaan van Stijn
ea34f82711
Merge pull request #36055 from cpuguy83/slave_mounts_for_root
Use rslave propagation for mounts from daemon root
2018-02-15 12:57:25 +01:00
Yong Tang
9537498ced Migrate container diff tests in integration-cli to api tests.
This fix migreates container diff tests in integration-cli
to api tests.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-02-15 01:03:29 -08:00
Akihiro Suda
e698b6e098
Merge pull request #36305 from cpuguy83/35370_fix_logs_eof
Fix log tail with empty logs
2018-02-14 16:41:22 +09:00
Brian Goff
f40860c5f3 Fix log tail with empty logs
When tailing a container log, if the log file is empty it will cause the
log stream to abort with an unexpected `EOF`.
Note that this only applies to the "current" log file as rotated files
cannot be empty.

This fix just skips adding the "current" file the log tail if it is
empty.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2018-02-13 21:33:05 -05:00
Daniel Nephin
bbd9b7ffdf
Merge pull request #36294 from yongtang/02122018-update
Update api tests to use container.Run/Create in helper package
2018-02-13 13:21:49 -05:00
Yong Tang
eaa1a0c218 Add WithNetworkMode, WithExposedPorts, WithTty, WithWorkingDir to container helper functions
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-02-13 15:45:40 +00:00
Yong Tang
9fcd2a0510 Update api tests to use container.Run/Create in helper package
This fix is a sync up with 36266 so that relevant api tests
use the newly added container.Run/Create in helper package

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-02-13 14:54:31 +00:00
Yong Tang
63bd2425fd Migrates several swarm configs tests from integration-cli to api tests
This fix migrates several swarm configs tests from integration-cli to api tests

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-02-12 19:38:56 +00:00
Yong Tang
919be92823
Merge pull request #36284 from yongtang/02112018-update-tests
Migrate some update restart tests to api tests
2018-02-12 11:21:21 -08:00
Yong Tang
1bb389121d
Merge pull request #36261 from yongtang/02082018-oom-killed
Migrate docker_cli_oom_killed_test.go to api tests
2018-02-12 09:50:26 -08:00
Vincent Demeester
848cf75f1f
Merge pull request #36234 from yongtang/02042018-config-ls
Migrate config list tests from integration-cli to api tests
2018-02-12 18:36:14 +01:00
Vincent Demeester
54d56bbcf4
Merge pull request #36283 from yongtang/02052018-secrets-tests
Migrates several swarm secrets from integration-cli to api tests
2018-02-12 18:34:29 +01:00
Yong Tang
5d26170cfd
Merge pull request #36279 from yongtang/36266-follow-up
Update api tests to use the newly added container helper package
2018-02-12 08:24:12 -08:00
Yong Tang
5b65cee915 Migrate some update restart tests to api tests
This fix migrates some update restart tests in
integration-cli to api tests in integration.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-02-12 16:23:08 +00:00
Daniel Nephin
945b786c14
Merge pull request #36285 from yongtang/02112018-session-tests
Migrates session tests in integration-cli to api tests
2018-02-12 11:04:49 -05:00
Vincent Demeester
812592d911
Merge pull request #36249 from cpuguy83/36145_fix_container_reload
Fix container cleanup on daemon restart
2018-02-12 11:36:18 +01:00
Yong Tang
5f9570c7ac
Merge pull request #36273 from yongtang/02092018-pause_test
Migrate container pause tests to api tests
2018-02-12 02:32:52 -08:00
Yong Tang
ea2f076ca9 Migrate container pause tests to api tests
This fix migrates container pause tests from integration-cli
to api tests in integration/.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-02-12 01:24:43 +00:00
Yong Tang
1d40c6a899 Migrates session tests in integration-cli to api tests
This fix migrates session tests in integration-cli to
api tests in integration.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-02-11 23:14:39 +00:00
Yong Tang
f955d2e204 Migrates several swarm secrets from integration-cli to api tests
This fix migrates several swarm secrets from integration-cli to api tests

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-02-11 21:17:44 +00:00
Yong Tang
3c21274b76 Migrate docker_cli_oom_killed_test.go to api tests
This fix migrates tests in integration-cli/docker_cli_oom_killed_test.go
to api tests.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-02-11 20:09:32 +00:00
Yong Tang
246f450ac4 Migrate config list tests from integration-cli to api tests
This fix migrates config list tests from integration-cli to api tests

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-02-11 19:39:56 +00:00
Akihiro Suda
178ebca0b9
Merge pull request #36257 from arm64b/fix-inspect-network-timeout
Fix timeout issue of `InspectNetwork` on AArch64
2018-02-11 20:50:08 +09:00
Yong Tang
e9f19df6a9 Update api tests to use the newly added container helper package
This fix is a follow up to 36266 to update some api tests
to use the newly added container helper package.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-02-10 23:30:40 +00:00
Vincent Demeester
0bb7d42b03
Add an integration/internal/container helper package
To help creating/running/… containers using the client for test integration.
This should make test more readable and reduce duplication a bit.

Usage example

```
// Create a default container named foo
id1 := container.Create(t, ctx, client, container.WithName("foo"))
// Run a default container with a custom command
id2 := container.Run(t, ctx, client, container.WithCmd("echo", "hello world"))
```

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-02-10 17:29:38 +01:00
Vincent Demeester
af306d149e
Rename integration/util to integration/internal
Both names have no real sense, but one allows to make sure these packages
aren't used outside of `integration`.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-02-10 09:16:32 +01:00
Yong Tang
2d97f5e780
Merge pull request #36259 from yongtang/02082018-kill_test
Migrate TestKillDifferentUserContainer to api test
2018-02-09 13:47:35 -08:00
Daniel Nephin
5589e9cad1
Merge pull request #36260 from yongtang/02082018-inspect_test
Migrate docker_api_inspect_unix_test.go to integration api test
2018-02-09 13:33:51 -08:00
Yong Tang
9d55eefc1b
Merge pull request #36221 from yongtang/02032018-secret_ls
Migrate secret list tests from integration-cli to api tests
2018-02-09 13:29:19 -08:00
Brian Goff
c0d56ab717 Fix container cleanup on daemon restart
When the daemon restores containers on daemon restart, it syncs up with
containerd to determine the existing state. For stopped containers it
then removes the container metadata from containerd.

In some cases this is not handled properly and causes an error when
someone attempts to start that container again.
In particular, this case is just a bad error check.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2018-02-09 14:36:36 -05:00
Yong Tang
0855922cd3 Migrate TestKillDifferentUserContainer to api test
This fix migrates TestKillDifferentUserContainer to api test

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-02-09 13:40:32 +00:00
Yong Tang
8197529ca2 Migrate docker_api_inspect_unix_test.go to integration api test
This fix migrates docker_api_inspect_unix_test.go to integration api test

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-02-09 12:56:07 +00:00
Yong Tang
7e7f8160fc
Merge pull request #36226 from yongtang/36198-follow-up
Add description to TestContainerNetworkMountsNoChown
2018-02-09 04:39:56 -08:00
Dennis Chen
8f5c1841a8 Fix timeout issue of InspectNetwork on AArch64
Service of inspect network can't be finished within 10s on AArch64 platform,
so we need to adjust the timeout value avoid to paper cover the real issue, plus
to make the integreation test can continue while not terminate with below error:

> === RUN   TestInspectNetwork
> --- FAIL: TestInspectNetwork (27.65s)
>         daemon.go:285: [de79880f4ed4a] waiting for daemon to start
>         daemon.go:317: [de79880f4ed4a] daemon started
>         inspect_test.go:57: timeout hit after 10s: waiting for tasks to enter run state
>         daemon.go:275: [de79880f4ed4a] exiting daemon
> FAIL
> ---> Making bundle: .integration-daemon-stop (in bundles/test-integration)
> Removing test suite binaries
> Makefile:171: recipe for target 'test-integration' failed

Signed-off-by: Dennis Chen <dennis.chen@arm.com>
2018-02-09 03:20:14 +00:00
Yong Tang
9349c03583 Migrate secret list tests from integration-cli to api tests
This fix migrates secret list tests from integration-cli to api tests

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-02-09 00:45:22 +00:00
Yong Tang
be24a6b11e Migrate rename tests in integration-cli to api tests
This fix migrates rename tests in integration-cli to api tests

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-02-08 23:27:14 +00:00
Yong Tang
15001f83bd
Merge pull request #36241 from yongtang/02072018-create-tests
Migrate TestCreateTmpfsMountsTarget test to api test
2018-02-08 14:58:06 -08:00
Yong Tang
21c9e5701b
Merge pull request #36140 from vdemeester/integration-container-kill
Migrate some kill integration cli test to api tests
2018-02-08 09:55:28 -08:00
Daniel Nephin
12ff002eed
Merge pull request #36235 from yongtang/02072018-info-api-test
Migrates docker info tests to integration api tests
2018-02-08 09:55:08 -08:00
Yong Tang
f601bc16d5 Migrate TestCreateTmpfsMountsTarget test to api test
This fix migrates TestCreateTmpfsMountsTarget test to api test,
and removed integration-cli/docker_cli_create_unix_test.go

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-02-08 15:59:12 +00:00
Vincent Demeester
6977f468bb
Migrate some calls to new client function
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-02-08 16:21:45 +01:00
Vincent Demeester
2227c8ad5e Move some kill integration cli to api tests
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-02-08 15:26:24 +01:00
Tianon Gravi
3a633a712c
Merge pull request #36194 from dnephin/add-canonical-import
Add canonical import path
2018-02-07 13:06:45 -08:00
Brian Goff
589a0afa8c Use rslave propagation for mounts from daemon root
By default, if a user requests a bind mount it uses private propagation.
When the source path is a path within the daemon root this, along with
some other propagation values that the user can use, causes issues when
the daemon tries to remove a mountpoint because a container will then
have a private reference to that mount which prevents removal.

Unmouting with MNT_DETATCH can help this scenario on newer kernels, but
ultimately this is just covering up the problem and doesn't actually
free up the underlying resources until all references are destroyed.

This change does essentially 2 things:

1. Change the default propagation when unspecified to `rslave` when the
source path is within the daemon root path or a parent of the daemon
root (because everything is using rbinds).
2. Creates a validation error on create when the user tries to specify
an unacceptable propagation mode for these paths...
basically the only two acceptable modes are `rslave` and `rshared`.

In cases where we have used the new default propagation but the
underlying filesystem is not setup to handle it (fs must hvae at least
rshared propagation) instead of erroring out like we normally would,
this falls back to the old default mode of `private`, which preserves
backwards compatibility.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2018-02-07 14:27:09 -05:00
Yong Tang
68d9beedbe Migrates docker info tests to integration api tests
This fix migrates docker info tests in integration-cli
to integration tests.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-02-07 18:26:01 +00:00
Sebastiaan van Stijn
4ba4b4b283
Merge pull request #36223 from yongtang/02062018-clean
Combine runSimpleContainer with runContainer for rename test
2018-02-06 17:26:49 -08:00
Yong Tang
28a2187ea7 Add description to TestContainerNetworkMountsNoChown
This fix is a follow up to 36198 by adding description
to TestContainerNetworkMountsNoChown so that it is clear
about the purpose of the test for ownership.

This fix is related to comment in 36198.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-02-07 00:19:38 +00:00
Yong Tang
203d871658 Combine runSimpleContainer with runContainer for rename test
As there is already a  runSimpleContainer, I think it makes
sense to combine runSimpleContainer with runContainer for rename test
to reduce code duplication.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-02-06 17:11:39 +00:00
Yong Tang
c028da3557 Migrates TestContainersAPINetworkMountsNoChown to api tests
This fix migrates TestContainersAPINetworkMountsNoChown from
integration-cli to api tests in integration.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-02-06 15:56:20 +00:00
Vincent Demeester
30a8c6c109
Merge pull request #36188 from yongtang/02012018-TestSecretInspect
Migrate TestSecretInspect from integration-cli to api tests
2018-02-06 15:19:08 +01:00
Daniel Nephin
4f0d95fa6e Add canonical import comment
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2018-02-05 16:51:57 -05:00
Yong Tang
8fb933a30b Migrate some of the nat tests in integration-cli to api tests
This fix migrates nat tests in docker_cli_nat_test.go
to api tests.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-02-03 20:18:00 +00:00
Yong Tang
1d40e92899 Migrate usage of newSwarm in integration/service to use integration/utils/swarm.NewSwarm
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-02-02 23:28:54 +00:00
Yong Tang
71c794d912 Migrate TestSecretInspect from integration-cli to api tests
This fix migrates TestSecretInspect from integration-cli to api tests

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-02-02 22:23:12 +00:00
Yong Tang
81e651c6d2
Merge pull request #36177 from yongtang/02012018-docker_api_resize_test
Migrate several resize tests from integration-cli to integration
2018-02-02 10:27:24 -08:00
Yong Tang
8f800c9415 Migrate several resize tests from integration-cli to integration
This fix migrates several resize tests from integration-cli to api tests.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-02-02 15:21:47 +00:00
Yong Tang
d5cbde514f Migrate TestAPIStatsContainerGetMemoryLimit from integration-cli to api tests
This fix migrates TestAPIStatsContainerGetMemoryLimit from
integration-cli to api test.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-02-01 22:07:06 +00:00
Yong Tang
490edd3582 Migrate TestAPIUpdateContainer from integration-cli to api tests
This fix migrates TestAPIUpdateContainer from integration-cli to api tests

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-01-31 20:02:55 +00:00
Yong Tang
5e7a245c3f
Merge pull request #36148 from yongtang/01302018-TestLinksEtcHostsContentMatch
Migrate some integration-cli test to api tests
2018-01-30 13:38:15 -08:00
Yong Tang
d924755789 Migrate TestAuthAPI from integration-cli to integration
This fix migrates TestAuthAPI from integration-cli to integration

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-01-30 19:15:06 +00:00
Yong Tang
e6bd20edcb Migrate some integration-cli test to api tests
This fix migrate  TestLinksEtcHostsContentMatch
to api test.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-01-30 18:52:48 +00:00
Yong Tang
4f378124ff Migrate docker_cli_stop_test.go to api test
This fix migrate docker_cli_stop_test.go to api test

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-01-30 00:55:18 +00:00
Yong Tang
65ee7fff02 Add test cases for file mode with secret and config.
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-01-28 16:48:10 +00:00
Sebastiaan van Stijn
2b2265acbb
Merge pull request #35989 from dani-docker/orca-11380
verbose info is missing for partial overlay ID
2018-01-24 16:01:31 -08:00
Yong Tang
25e56670cf
Merge pull request #35938 from yongtang/35931-filter-before-since
Fix `before` and `since` filter for `docker ps`
2018-01-24 12:06:19 -08:00
Yong Tang
50af496891 Add integration test for network connect with alias
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-01-23 01:04:39 +00:00
Dani Louca
2e0990f165 fix verbose for partial overlay ID
Signed-off-by: Dani Louca <dani.louca@docker.com>
2018-01-22 18:50:49 -05:00
Sebastiaan van Stijn
db5c006bc8
Merge pull request #35919 from yongtang/35333-carry
Carry #35333: Devicemapper: ignore Nodata errors when delete thin device
2018-01-20 18:47:16 +01:00
Anusha Ragunathan
c162e8eb41
Merge pull request #35830 from cpuguy83/unbindable_shm
Make container shm parent unbindable
2018-01-19 17:43:30 -08:00
Vincent Demeester
f97256cbf1
Merge pull request #35744 from ndeloof/35702
closes #35702 introduce « exec_die » event
2018-01-19 15:03:50 -08:00
Brian Goff
eaa5192856 Make container resource mounts unbindable
It's a common scenario for admins and/or monitoring applications to
mount in the daemon root dir into a container. When doing so all mounts
get coppied into the container, often with private references.
This can prevent removal of a container due to the various mounts that
must be configured before a container is started (for example, for
shared /dev/shm, or secrets) being leaked into another namespace,
usually with private references.

This is particularly problematic on older kernels (e.g. RHEL < 7.4)
where a mount may be active in another namespace and attempting to
remove a mountpoint which is active in another namespace fails.

This change moves all container resource mounts into a common directory
so that the directory can be made unbindable.
What this does is prevents sub-mounts of this new directory from leaking
into other namespaces when mounted with `rbind`... which is how all
binds are handled for containers.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2018-01-16 15:09:05 -05:00
Brian Goff
86ba63db82 Ensure CPU quota/period updates are sent to runc
Fixes an issue where if cpu quota/period is sent via the update API, the
values are updated in the stored container data but not actually sent to
the running container.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2018-01-16 11:50:14 -05:00
Dennis Chen
4542016cbe Fix timeout issue of multi-services cration on AArch64
Now we only adjust the timeout value for `arm` while not `arm64`,
actually the avarage duration for this test is about 25s to crate
multiple services on arm64, else the integration test will terminate
with below error:

> --- FAIL: TestCreateServiceMultipleTimes (24.11s)
>         daemon.go:285: [ddc3c7c1476c2] waiting for daemon to start
>         daemon.go:317: [ddc3c7c1476c2] daemon started
>         poll.go:121: timeout hit after 10s: task count at 4 waiting for 0
>         daemon.go:275: [ddc3c7c1476c2] exiting daemon
>         clean.go:108: Removing image sha256:e6a8d12d58602a19277ee5632b7ff9fa56a4ea52ba00eedf1d3f6f5a495fe761
>         clean.go:108: Removing image sha256:876244cc2ecb8fe1b0b2e817e3b78709a2a735edb093bc6849f99aa6c18f3a01

This PR adjusts the timeout value for both `arm64` and `arm` to mitigate
this issue on those 2 platforms.

Signed-off-by: Dennis Chen <dennis.chen@arm.com>
2018-01-12 11:52:35 +00:00
Brian Goff
9e3193810d Fix race with concurrent daemon startup in tests
Using parallel tests is nice, however it can cause an issue with
multiple daemons trying to make changes to iptables at the same time
which causes flakey tests.

This just disables iptables for the set of tests since it is not
required.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2018-01-11 11:47:21 -05:00
Yong Tang
52b44b9816 Add test case for before and since filter for docker ps
This fix adds an integration test for `before` and `since` filter for `docker ps`

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-01-10 17:42:43 +00:00
Nicolas De Loof
aa6bb5cb69
introduce « exec_die » event
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2018-01-08 11:42:25 +01:00
Yong Tang
b249ccb115 Update and use FindNetwork on Windows.
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-01-07 03:32:37 +00:00
Yong Tang
7c6ef28042 Add test case for 35333: Devicemapper: ignore Nodata errors when delete thin device
This fix adds a test case for 35333: Devicemapper: ignore Nodata errors when delete thin device

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-01-03 15:06:52 +00:00
Vincent Demeester
b0cffdb10a
Merge pull request #35672 from tonistiigi/onbuild-test
Add testcase for onbuild command in multi stage build
2017-12-22 09:22:51 +01:00
Tõnis Tiigi
a5de79b435
Merge pull request #35582 from asottile/use_base_containers_config
Fix environ substitutions in `docker commit --change ...`
2017-12-20 21:01:53 -08:00