Commit Graph

113 Commits

Author SHA1 Message Date
92d9a5ddfd Merge pull request #37215 from adshmh/integration-container-links-tests-use-unique-names
container links integration tests use unique names
Upstream-commit: d47c45175b13e97475649dfe8b1ab1034c4865d0
Component: engine
2018-06-07 22:34:12 +02:00
9022898c18 integration tests under integration/container/links_linux_test.go use unique names
Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
Upstream-commit: 077247050df0bf97b7b62e439152eb362e9ec813
Component: engine
2018-06-06 06:14:24 -04:00
67fe100ad5 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>
Upstream-commit: 3694c1e34e40fa2e255a97b5541645cec9c8d1d5
Component: engine
2018-06-05 12:33:14 -04:00
75e47b0eb6 Merge pull request #36874 from kolyshkin/stop-timeout
daemon.ContainerStop(): fix for a negative timeout
Upstream-commit: b85799b63fb25423620ed16e717a99401cd3a39b
Component: engine
2018-05-30 13:38:42 -04:00
0f96e98e12 Various code-cleanup
remove unnescessary import aliases, brackets, and so on.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: f23c00d8701e4bd0f2372a586dacbf66a26f9a51
Component: engine
2018-05-23 17:50:54 +02:00
fac8e1d52b Replace deprecated testutil.ErrorContains()
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 55bebbaecf5e40db9d83b28080ce08dc8642f407
Component: engine
2018-05-21 00:13:04 +02:00
a24b673f22 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>
Upstream-commit: e440831802a500b28ecf16c2627a294dc31dfeb9
Component: engine
2018-05-15 16:05:04 -07:00
c51303ad17 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 cfdf84d5d04c8ee (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: cfdf84d5d04c ("Update Container Wait")
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: 69b4fe406540c7989bd99b2244ed67ced96e17c7
Component: engine
2018-05-03 10:04:33 -07:00
904bb15bee Merge pull request #36944 from vdemeester/fix-e2e-run
Skip some test on remote daemon for e2e run(s)
Upstream-commit: 765a9f31adb5f9eef197aa7863717a4d8a743122
Component: engine
2018-04-27 05:03:12 -10:00
7dc2c5606a 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>
Upstream-commit: ef2c2040c22eba8ab6ea1033ad64ba9b0095db9b
Component: engine
2018-04-26 16:25:52 +00:00
e77630ac6d restartmanager: do not apply restart policy on created containers
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
Upstream-commit: 75d3214934b397692a2765ef6fd8ce086044831b
Component: engine
2018-04-24 11:41:09 +02:00
e52c8b0018 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>
Upstream-commit: 67535921b32f68863f7a882d2300b59e0bbeffa4
Component: engine
2018-04-21 19:42:20 +00:00
a05c5e914a Move integration-cli/request to internal/test/request…
… and change a bit the method signature

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 42f6fdf059807ecbe66cce90676021363a541154
Component: engine
2018-04-17 16:25:59 +02:00
691aeed45e 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>
Upstream-commit: ab9bb47b05b1dde445a5e4ba78ae97303208dc8b
Component: engine
2018-04-14 16:52:02 +00:00
c4fdce16ba Don't make container mount unbindable
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
Upstream-commit: 4c000662feb3c8e3d63cbcb044a47f627cd9bb45
Component: engine
2018-04-10 15:14:34 -04:00
baa55da752 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>
Upstream-commit: f0d277fe84a72b29c0d2d541c20d5a9c4d7e4884
Component: engine
2018-04-10 16:29:48 +02:00
28e52cd76e Skip some tests in certain condition to run with e2e image
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: e55d6fc8573580f6eea009cd7f1034aa912128ef
Component: engine
2018-03-29 09:10:39 +02:00
d1631a824d Use unique names for container/rename_test.go
Signed-off-by: Catalin Pirvu <pirvu.catalin94@gmail.com>
Upstream-commit: 90b514922bb6405bc06428702b1a55bb248bdac3
Component: engine
2018-03-25 21:16:32 +03:00
5656978b1e 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
Upstream-commit: 57c504799d979caa706142e6f5dc4be4a5b1e3e2
Component: engine
2018-03-23 12:16:53 +09:00
809b43730d 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>
Upstream-commit: 78e4be91332e2237c0fa14eb3ba0fb5b915c3256
Component: engine
2018-03-21 17:47:49 -04:00
3d5d533860 container/nat integration tests use unique names for test containers
Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
Upstream-commit: b4d1547af6b91baa2ffcb8a391c35d9bc5cdc48f
Component: engine
2018-03-20 17:11:03 -04:00
ef1461a872 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>
Upstream-commit: a0052b8f190f38bcdd24e4bf794c3ad6d2fd1b41
Component: engine
2018-03-19 10:56:13 -04:00
0331f04e35 Post migration assertion fixes
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: c9e52bd0da0461e605a3678b85702f83081504a7
Component: engine
2018-03-16 11:03:46 -04:00
60daf5fa97 Automated migration using
gty-migrate-from-testify --ignore-build-tags

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 6be0f709830113966f295401327b027ec2f0bbca
Component: engine
2018-03-16 11:03:43 -04:00
6a0b3c07e8 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>
Upstream-commit: 6e7141c7a2c0de6fa3d6c9dcc56978a81f9d835e
Component: engine
2018-03-15 00:30:11 -07:00
59feac96fd Merge pull request #36569 from kolyshkin/t-etc-hosts
TestLinksEtcHostsContentMatch: use container.Exec()
Upstream-commit: fb95dc7eac3ae177d61f7bd67aea5ddeb94454b8
Component: engine
2018-03-13 15:12:59 +01:00
2052fc8774 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: e6bd20edcbf ("Migrate some integration-cli test to api tests")
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: ad2f88d8ccbd9dd0a8d9c4f96ece3956f60489df
Component: engine
2018-03-12 18:15:16 -07:00
6623004cd4 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: eaa5192856c1 ("Make container resource mounts unbindable")
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: c125e10a0486623ba3badebf974ea6e582373151
Component: engine
2018-03-12 14:49:15 -07:00
1eac9f0c3c Remove unnecessary diff tests
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 038f3add5191240058c7a4154556553c5493ea44
Component: engine
2018-03-09 12:32:50 -05:00
391894bb6c 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>
Upstream-commit: 8a854e933b3dbb26cfce28b920cff61909412c6f
Component: engine
2018-03-05 20:39:42 +00:00
fd6608a9da Merge pull request #36468 from vdemeester/e2e-container-run
Fixes some integration/container tests to run on remote daemon
Upstream-commit: 4b2fb7e394e8ee631394d6c12f8267065f39766b
Component: engine
2018-03-05 12:23:24 -08:00
b917c45482 Merge pull request #36471 from yongtang/03022018-improvement
Improvement in integration tests
Upstream-commit: 3af9b1d395615882dc64df68878139fd5e68712c
Component: engine
2018-03-05 17:54:09 +01:00
85d9dcf398 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>
Upstream-commit: 18dd1d9aba3c79d355abaa7f498b88ad816f7d04
Component: engine
2018-03-05 14:24:01 +01:00
b0676c2968 Merge pull request #36476 from yongtang/03022018-kill_test
Remove unnecessary container.WithName in kill test
Upstream-commit: e3814ece2147b4a6c7f01e6611aa7c886ce26fed
Component: engine
2018-03-05 11:42:30 +01:00
ff4f20efc2 Merge pull request #36459 from yongtang/02282018-export-test
Migrate export tests to api tests
Upstream-commit: e734e8f51597bba3d7c097144d981b85b30dde99
Component: engine
2018-03-03 12:29:53 +09:00
9781623852 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>
Upstream-commit: 1778719d6ac166250acfaebe5dd99b5e9d151c3e
Component: engine
2018-03-03 01:06:49 +00:00
49ec29b887 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>
Upstream-commit: 6ab465804b0b8cec6c5ac278a21151d49e34885d
Component: engine
2018-03-02 19:03:59 +00:00
f51e63d406 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>
Upstream-commit: 4e702cf70d50ee5b0737270f27d9973fd3084c66
Component: engine
2018-03-02 00:44:03 +00:00
59d8a525c8 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>
Upstream-commit: 9045406144413920da49629a181bb787c670197e
Component: engine
2018-03-01 22:51:11 +00:00
c17eb54e99 Merge pull request #36455 from thaJeztah/flip-asserts
Fix "expected" and "actual" being reversed
Upstream-commit: 7459e4cd4fc71dec134e0a90bb317142dcd4270d
Component: engine
2018-03-01 21:31:46 +01:00
82ee559ff8 Fix "expected" and "actual" being reversed
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: a2517cbf62d75c48861337182aa841c5089f8ac4
Component: engine
2018-03-01 14:16:19 +01:00
fb7feb1626 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>
Upstream-commit: 6ad4720c78d6ac61a60a3e7ed1d0c0119c5d103e
Component: engine
2018-02-28 21:35:56 +00:00
5ea7143788 Merge pull request #36434 from dnephin/fix-cp-cli-tests
Migrate some container copy tests to integration
Upstream-commit: 75377ec12c44fed7d5dcb131438ae88d9fe7df84
Component: engine
2018-02-28 12:28:18 +01:00
3b71e84103 Migrate some copy tests to integration
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 00d409f03ed825f623b6ef8ec5a3a91cd26194c2
Component: engine
2018-02-27 16:48:35 -05:00
bedfb491b4 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>
Upstream-commit: 6bd4f4801b244555213f0040b9885033e99d4ae8
Component: engine
2018-02-27 19:20:01 +00:00
2c12cc5798 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>
Upstream-commit: eda311c18f388ed4541dc44dcfba08cd4347a685
Component: engine
2018-02-23 21:23:05 +00:00
088ad71eb5 integration/testUpdateCPUQuota: fix name
The function name should be TestUpdateCPUQuota and not TestUpdateCPUQUota.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: 31825081d4c5e643a150b515547cb2a2ea223de4
Component: engine
2018-02-20 13:36:27 -08:00
133cf88cac 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: 0f9da07b569f0d9
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: cc866470981a1e6a839004f24eb30bb708078068
Component: engine
2018-02-20 13:31:03 -08:00
dbebd52548 Merge pull request #36326 from kolyshkin/integration-exec
Add/use container.Exec() to integration
Upstream-commit: ee9abc212032353e19e5b0f5e6410ad67a0cc9b1
Component: engine
2018-02-20 17:16:09 +01:00
0c0ee07b87 Merge pull request #36330 from vdemeester/migrate-container-list-tests
test: clean/migrate some docker ps cli-only integration tests 
Upstream-commit: 7060a40addd71605862b668c1ec2b889e3540233
Component: engine
2018-02-20 08:44:17 +01:00