Commit Graph

5064 Commits

Author SHA1 Message Date
a97e7a41c8 pkg/mount: implement/use filter for mountinfo parsing
Functions `GetMounts()` and `parseMountTable()` return all the entries
as read and parsed from /proc/self/mountinfo. In many cases the caller
is only interested only one or a few entries, not all of them.

One good example is `Mounted()` function, which looks for a specific
entry only. Another example is `RecursiveUnmount()` which is only
interested in mount under a specific path.

This commit adds `filter` argument to `GetMounts()` to implement
two things:
 1. filter out entries a caller is not interested in
 2. stop processing if a caller is found what it wanted

`nil` can be passed to get a backward-compatible behavior, i.e. return
all the entries.

A few filters are implemented:
 - `PrefixFilter`: filters out all entries not under `prefix`
 - `SingleEntryFilter`: looks for a specific entry

Finally, `Mounted()` is modified to use `SingleEntryFilter()`, and
`RecursiveUnmount()` is using `PrefixFilter()`.

Unit tests are added to check filters are working.

[v2: ditch NoFilter, use nil]
[v3: ditch GetMountsFiltered()]
[v4: add unit test for filters]
[v5: switch to gotestyourself]

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: bb934c6aca3e77541dd4fd51b9ab2706294dadda
Component: engine
2018-04-19 14:48:09 -07:00
8348a70a7d 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>
Upstream-commit: 69bab3832ce1d72dd1d3ed2f2b53143ec9ff102c
Component: engine
2018-04-19 11:57:28 +02:00
1a74ffcae2 Merge pull request #36865 from vdemeester/integration-move-swarm-plugin-test
Migrate TestAPISwarmServicesPlugin to integration
Upstream-commit: f1783da7361ab3dc985df12446357e6c4c9ef388
Component: engine
2018-04-18 21:15:59 -07:00
320288f128 Merge pull request #36637 from cpuguy83/no_global_driver_store
No global volume driver store
Upstream-commit: 6cd806aa53de41e6f04346150d08e19ec63311e0
Component: engine
2018-04-18 16:32:23 -04:00
a6beebd548 Migrate TestAPISwarmServicesPlugin to integration
Also starts to create more "poll/check" function to `internal/test/daemon`.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: aa0db6f9e1d0fd0420271f419d0d225089a95bbd
Component: engine
2018-04-18 16:18:53 +02:00
8f56510165 Remove old/uneeded volume migration from vers 1.7
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 0023abbad34282762d5bd17302776d2a8521fffc
Component: engine
2018-04-17 14:06:53 -04: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
3d6d872b1c Add api helpers to internal/test/daemon.Daemon
Porting helpers from `integration-cli/daemon.Daemon` to this struct
and use the API instead of the cli.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 9722214c8add2a83f6c4974848139cadc79d9f0e
Component: engine
2018-04-17 16:24:31 +02:00
a425bbca33 Move fakecontext, fakegit and fakestorage to internal/test
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 062564084a22f71cf5807ae5dfad7d29afb12e04
Component: engine
2018-04-17 09:53:09 +02:00
f4b8a312a4 Merge pull request #36841 from yongtang/02222018-tag-test
Migrate image tag tests from integration-cli to api tests
Upstream-commit: abb1661907fa5e831872a7f99f1af2dcc88724bf
Component: engine
2018-04-16 17:53:48 -07:00
84f41cfc7e Merge pull request #36838 from vdemeester/integration-fixtures-refactoring
Clean some integration-cli/fixtures package/files
Upstream-commit: f9c4e630269be438cddfe843c727c21c3343f1c2
Component: engine
2018-04-16 17:49:29 -07:00
c2c6cea1b0 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>
Upstream-commit: 5f56503f583f21d655394f755f71849381bd58c7
Component: engine
2018-04-16 10:48:58 +02:00
bd6e299583 Small daemon refactoring and add swarm init/join helpers
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 239a8a518904dfb51fe62087d8702519c20ce808
Component: engine
2018-04-16 10:20:10 +02:00
10abb9454f 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>
Upstream-commit: 9bcb960508a6066811cffcca1e35ca44d7f1cf94
Component: engine
2018-04-13 14:46:40 +00:00
af04bf6300 Move and refactor integration-cli/registry to internal/test
- Move the code from `integration-cli` to `internal/test`.
- Use `testingT` and `assert` when creating the registry.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 66de2e6e3b6d927a3396743cd7c363aa9f7b776e
Component: engine
2018-04-13 10:45:34 +02:00
0a52018901 Merge pull request #36722 from vdemeester/network-ipvlan-test-migration
Migrate test-integration-cli experimental ipvlan test to integration 
Upstream-commit: 6f4bf5629cf030ee9c941534847effdcbdae9790
Component: engine
2018-04-11 14:51:25 -07:00
975c16f6d2 Merge pull request #36826 from vdemeester/integration-daemon-swarm-refactoring
Make internal/test/daemon.Daemon swarm aware
Upstream-commit: ce3c2e23315a8745dca792a39aa496d9b33689ea
Component: engine
2018-04-11 09:33:58 -07:00
4059b74760 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>
Upstream-commit: 83d18cf4e3e84055f7034816eed2a10c04e777ca
Component: engine
2018-04-11 12:10:17 +02:00
2c7fcaadfb 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>
Upstream-commit: 24f934751120ea420b7ba4d2e314df805f3eff06
Component: engine
2018-04-11 11:14:47 +02:00
59714fb174 remove the retries for service update
Signed-off-by: Anda Xu <anda.xu@docker.com>
Upstream-commit: 7380935331f0c35315003578258f6c1f47c1a586
Component: engine
2018-04-10 17:17:02 -07:00
1f461d4e5c Merge pull request #36824 from vdemeester/integration-daemon-refactoring
Move integration-cli daemon package to internal/test…
Upstream-commit: 68dd184c7c7201030f52c39e55bee170df365d60
Component: engine
2018-04-10 10:06:09 -07: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
6d9f00fbde Merge pull request #36746 from vdemeester/experimental-build-tests
Migrate test-integration-cli experimental build tests to integration
Upstream-commit: cbde00b44273a584bed2ee3513db68924b4a6dba
Component: engine
2018-04-09 10:21:03 +02:00
2cf9f7eb88 Always make sysfs read-write with privileged
It does not make any sense to vary this based on whether the
rootfs is read only. We removed all the other mount dependencies
on read-only eg see #35344.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
Upstream-commit: a729853bc712910574a7417f67764ec8c523928b
Component: engine
2018-04-06 16:17:18 +01:00
61213d110b 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>
Upstream-commit: 183076e89df64928bd2e94ad0da9725b482367cd
Component: engine
2018-03-30 13:10:02 +02:00
d785136a3a Fix a misused network object name
A minor nit. `test01` never been created and used in
`TestDockerNetworkInspectCustomSpecified()` function, so correct it.

Signed-off-by: Dennis Chen <dennis.chen@arm.com>
Upstream-commit: f041953d04bffa2be05466173f02dd016c68286d
Component: engine
2018-03-30 09:47:41 +00: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
8cca58175d Merge pull request #36711 from cpuguy83/plugin_mounts_sorting
Don't sort plugin mounts slice
Upstream-commit: 18d16885308c35cf38db03b39a779198704a8f42
Component: engine
2018-03-28 11:57:38 -07:00
fb7d4261c9 Don't sort plugin mounts slice
This was added as part of a53930a04fa81b082aa78e66b342ff19cc63cc5f 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>
Upstream-commit: ec90839ca302ca53a7d55e4c7f79e7b4779f5e15
Component: engine
2018-03-28 09:10:43 -04:00
e5e13f7dec 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>
Upstream-commit: ef5bc603266b9fa5df525319d67329ebc14a8ee7
Component: engine
2018-03-28 10:47:11 +02:00
aac739f262 Migrate DockerTrustSuite to docker/cli e2e tests
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 5433ceb12ead305d8c85e8e27c4b4d842ef88ae0
Component: engine
2018-03-19 09:26:35 +01: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
496c3cdf9d integration-cli/TestSlowStdinClosing: increase timeout
I noticed this test failed on Windows:

> 17:46:24 docker_cli_run_test.go:4361:
> 17:46:24 c.Fatal("running container timed out") // cleanup in teardown

I also noticed that in general tests are running slower on Windows,
for example TestStartAttachSilent (which runs a container with
`busybox echo test` and then starts it again) took 29.763s.
This means a simple container start can easily take 15s, which
explains the above failure.

Double the timeout from 15s to 30s.

Fixes: 4e262f6387 ("Fix race on sending stdin close event")
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: 5043639645123f2728c81c9a55fea525475ec324
Component: engine
2018-03-12 20:35:28 -07:00
671826c75d [integration] skip ppc64le oom tests for now
These tests were enabled by changing a config option on the ci
machines, instead of from a patch, so let me disable them
for now on ppc64le and open up another patch to enable them, where I can find
out what the issues are with them.

Signed-off-by: Christopher Jones <tophj@linux.vnet.ibm.com>
Upstream-commit: 620ddc78a1437feaa42f40853ef586d268991620
Component: engine
2018-03-08 17:51:37 -06:00
f51e800a06 Remove duplicate TestServiceUpdatePort
The TestAPIServiceUpdatePort test performs exactly
the same steps.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 36e1646e4f010ea033643c6df3d9c3dccc166ed2
Component: engine
2018-03-06 16:17:13 +01:00
cb84ae24c4 Merge pull request #36444 from yongtang/02142018-events-tests
Migrate events tests to api tests
Upstream-commit: 2f7a76a6a0959109e4438952c88c824078cea074
Component: engine
2018-03-06 08:36:30 +01:00
02ba73152d 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>
Upstream-commit: ed58ba99fb28ceac56063b7f003f38b597ddef80
Component: engine
2018-03-05 20:35:14 +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
dec1b3c995 Merge pull request #36407 from agawish/36395-mount-print
36395 mount print
Upstream-commit: 8830ef804fec52f3087d9c24a8583ca9954e0967
Component: engine
2018-03-06 02:31:21 +09:00
bcdb133cb4 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>
Upstream-commit: 3a749157d2c2b320fea49f7aa4d4eb634f52662f
Component: engine
2018-03-05 16:13:48 +00: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
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
3521e40e1a Remove docker_cli_secret_inspect_test.go
as the test (TestSecretInspectMultiple) seems to have been covered pretty well in cli:
https://github.com/docker/cli/blob/master/cli/command/secret/inspect_test.go

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 3d38adb20c619b87edab72e51ff0fd1cf6e08691
Component: engine
2018-02-28 17:16:47 +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
c453879121 Merge pull request #36430 from yongtang/02262018-config-test
Migrate config inspect test to api test
Upstream-commit: 973cf656ddb75656fd3225854be13a911377eda6
Component: engine
2018-02-28 11:50:52 +01:00
2c1f22484b Merge pull request #36375 from arm64b/frozen-busybox-latest-glibc
Frozen busybox latest glibc
Upstream-commit: 3e0299f58c580dd356163cce0d9ca2e686ff1d15
Component: engine
2018-02-28 10:55:08 +01:00
64a7496544 Merge pull request #36293 from yongtang/02122018-rm-tests
Migrate several docker rm tests to api tests
Upstream-commit: 8fe1589615318c4761b314a18fdb0de2fb5e0d56
Component: engine
2018-02-28 09:25:49 +01:00
35e67f98e4 Merge pull request #36427 from vdemeester/micro-clean-docker-cli-build-test
Clean some docker_cli_build_tests that are cli-only
Upstream-commit: f571eb1720de2bca5875b6a107f543249858b688
Component: engine
2018-02-28 08:20:51 +01:00
f4c3a36fa1 Merge pull request #36267 from Microsoft/jjh/removeservicing
Windows: Remove servicing mode
Upstream-commit: 1346a2c89a11f2d111ff20f46d557f1f9ccbbeb7
Component: engine
2018-02-28 01:15:03 +01:00