Commit Graph

5079 Commits

Author SHA1 Message Date
b179a3fc0d 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>
Upstream-commit: 476d7872efb60b1ef1bc7d9d83952f9dbc8f8798
Component: engine
2018-05-21 10:08:27 +08:00
72379c4a70 Merge pull request #37076 from arm64b/TestExecInteractiveStdinClose
Fix flaky test case of `TestExecInteractiveStdinClose`
Upstream-commit: b7b6b6929c6436145bd12e6fef7efb7d01fa170b
Component: engine
2018-05-16 09:51:28 +02:00
42dc03897a Fix flaky test case of TestExecInteractiveStdinClose
This issue has been reported by issue #36877.

The purpose of this test case is for the regression test of #12546,
so we only need to make sure the essential of the testing is still
in the way to check that while not disturbed by some testing noises,
which is exactly what this PR want to do.

Signed-off-by: Dennis Chen <dennis.chen@arm.com>
Upstream-commit: 96abf9f59ebd350cc9a70034b4d30279e6ae04e4
Component: engine
2018-05-16 10:01:44 +08: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
64899bb9a0 Merge pull request #36612 from kolyshkin/t-attach
TestPostContainersAttach: minor improvements
Upstream-commit: bd5eb6b402524d103b91960cebae38bda7d8da12
Component: engine
2018-05-08 03:26:25 +02:00
9e5bd57003 Add tests related to hcsshim recycle bin skipping
Signed-off-by: John Stephens <johnstep@docker.com>
Upstream-commit: 72192f5052667118c2f83282f8f8c3df8cbf514b
Component: engine
2018-05-03 13:37:18 -07:00
7fc438fe9a TestPostContainerAttach: minor improvements
When this test fails, the error looks like this:

> FAIL: docker_api_attach_test.go:98: DockerSuite.TestPostContainersAttach
> docker_api_attach_test.go:211:
>     c.Assert(actualStdout.Bytes(), checker.DeepEquals, []byte("hello\nsuccess"), check.Commentf("Attach didn't return the expected data from stdout"))
> ... obtained []uint8 = []byte{0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73}
> ... expected []uint8 = []byte{0x68, 0x65, 0x6c, 0x6c, 0x6f, 0xa, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73}
> ... Attach didn't return the expected data from stdout

Let's use strings for comparisons to make the output more readable.

While at it,
- get the container's stderr as well, and make sure it's empty;
- check that stdcopy.StdCopy() did not return an error, except for
  the timeout which is expected;
- move/remove comments, simplify var names.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: ecc54889c9a233d558b578dfd48eb5d84506a62a
Component: engine
2018-05-03 10:15:48 -07:00
0e7b49da2e Add --target name case sensitive test code for multi-stage build
Add testing code to cover the `--target` name case sensitive
issue reported by issue #36956.

Signed-off-by: Dennis Chen <dennis.chen@arm.com>
Upstream-commit: a95fabc70efacc1ff6c0c62c490cf551215bc503
Component: engine
2018-05-01 11:31:52 +08:00
e3af8e0774 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>
Upstream-commit: 7d62e40f7e4f3c17d229a7687d6fcca5448de813
Component: engine
2018-04-23 13:52:44 -07:00
554b5427fa Merge pull request #36091 from kolyshkin/mount
pkg/mount improvements
Upstream-commit: 53982e3fc1642f2605189cea48bc6de7b9318611
Component: engine
2018-04-21 11:03:54 +02:00
5b320bf640 Merge pull request #36744 from kolyshkin/t-enospc
TestDaemonNoSpaceLeftOnDeviceError: simplify
Upstream-commit: 7d9cbfa96f7d43764eb44422ac0a848f96d0484d
Component: engine
2018-04-20 15:40:39 +02:00
625b8ccfec Merge pull request #36875 from vdemeester/integration-cli-some-fixme
[test/integration-cli] small cleanups of FIXME(s)
Upstream-commit: 4da83efdfbbbb8a69ae155fc1998cfbc7b070b1c
Component: engine
2018-04-19 20:31:27 -04:00
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
f40401e83b Remove daemon.BuildImageWithOut and use cli helpers function
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 5d2afe4f51edc4c8393c4cbee7b478f7dc1e88ab
Component: engine
2018-04-18 16:45:55 +02: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
917c353f43 Add a Cleanup function that cleans exec root and swarm files
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 3b01e92c9a34036b891853402888dcf461836ef8
Component: engine
2018-04-18 16:14:50 +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
fe76970085 TestDaemonNoSpaceLeftOnDeviceError: simplify
There is no need to perform a separate losetup step; mount (even
the one in busybox!) is smart enough to set up a loopback device
all by itself (even without -o loop present!). More to say, while
doing this, it sets LO_FLAGS_AUTOCLEAR flag for the kernel to
delete the loopback device as soon as its fs is unmounted (this
is supposed to work since kernel 2.6.25).

Also, remove mount options (-t ext4, -o loop,rw) as they are
either defaults (rw) or mount is smart enough to figure out.
Leave -n so it won't do unnecessary write to container's /etc/mtab.

While at it, touch up some comments.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: a978fd22daefcc68d37c46177a545f7e1dfc6d9e
Component: engine
2018-03-30 09:14:49 -07: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