Commit Graph

5110 Commits

Author SHA1 Message Date
cfcd7a95da migrated service integration tests from integration-cli/docker_cli_service_update_test.go to integration/service
Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
Upstream-commit: fbaef1b0d3c5656a8aa5f0424b89c118ca277427
Component: engine
2018-07-25 14:49:02 -04:00
4a2ba80f95 Merge pull request #37457 from adshmh/migrate-docker_cli_config_create_test-integration-tests-to-integration-config
moved integration tests from docker_cli_config_create_test.go to integration/config
Upstream-commit: a5495f289aafafac8a01c62f2a9cb44856658ece
Component: engine
2018-07-16 14:00:44 +02:00
14ed98c1a4 moved integration tests from docker_cli_config_create_test.go to integration/config
Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
Upstream-commit: 0e57ceae0dd42491ed81538bf4d9164218080b66
Component: engine
2018-07-13 17:29:02 -04:00
5fea4ae591 Fix flakyness in TestDockerNetworkInternalMode
Instead of waiting for the DNS to fail, try to access
a specific external IP and verify that 100% of the pakcets
are being lost.

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
Upstream-commit: a2bb2144b3e0d49ac615976bfac462a307d85f0e
Component: engine
2018-07-13 11:43:38 -07:00
882263fbf1 Merge pull request #37422 from thaJeztah/fix-linting-errors
Fix some golint and ineffassign issues
Upstream-commit: f9470d8189e25c297c6c7bd9ac592b6e5acd951e
Component: engine
2018-07-13 00:25:46 +02:00
dc41641256 Fix error string in docker CLI test
Signed-off-by: Sandeep Bansal <sabansal@microsoft.com>
Upstream-commit: 76ace9bb5e2c5ecdd02046956ab00f76c3b25a3a
Component: engine
2018-07-11 23:02:44 -07:00
a174fffcfe Fix ineffassign linting
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: ddd8a6572d36a6d0db2aa21d697018f419a7b424
Component: engine
2018-07-11 22:18:45 +02:00
c8c1e95dc9 Merge pull request #37394 from yongtang/07052018-ipcmode
Migrate some ipcmode tests to integration
Upstream-commit: aba2735e3fe66333ac1064bed3b476f30b1d1c00
Component: engine
2018-07-06 10:00:03 +02:00
bf53bc318d 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>
Upstream-commit: e0403604e26868b1546a766ab0b40b6cb1677ee6
Component: engine
2018-07-04 16:32:18 +00:00
08169a61e4 Update tests w/ new libnetwork contraints
The TestDockerNetworkIPAMMultipleNetworks test allocates several
networks simultaneously with overlapping IP addresses.  Libnetwork now
forbids this.  Adjust the test case to use distinct IP ranges for the
networks it creates.

Signed-off-by: Chris Telfer <ctelfer@docker.com>
Upstream-commit: efb7909befa0fe2236148543a6d50e2563bf386c
Component: engine
2018-06-29 15:15:52 -04:00
3c9ebe0c45 Merge pull request #37293 from adshmh/migrate-TestNetworkCreateDelete-to-integration
migrate TestAPINetworkCreateDelete from integration-cli/ to integration/
Upstream-commit: af626ba08a4e11b0e140e7512ac2740b09833c29
Component: engine
2018-06-21 19:08:08 -07:00
e1cb6f43e5 Fix TestDaemonNoSpaceLeftOnDeviceError
This test is testing if any "no space left on device" errors
that occur during `docker pull` will not be masked by other
errors. To test for this, a new loopback-device was created,
and used as `--data-dir` ("/var/lib/docker").

However, `/var/lib/docker` is used for storing various
other things, including a `cache.db` database, used by
BuildKit, which is created during startup of the daemon.
Creation of that file failed (due to `--data-dir` path
being on a mount with limited size), which caused daemon
start to fail before the test was able to run.

This patch changes the size-limited mount to be used for
the storage-driver directory only, so that the test is
not affected by other parts of the code attempting to
write files in it.

To have a predictable path; the daemon used in this test
is configured to use the `vfs` storage-driver.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 754aeb28fdb9dd3aafb7705224e57f28281db264
Component: engine
2018-06-19 16:14:12 -07:00
79590fda36 migrate TestAPINetworkCreateDelete from integration-cli/ to integration/
Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
Upstream-commit: f5426214295cb59d54ece5a24d4720e31947981b
Component: engine
2018-06-15 16:06:45 -04:00
4cadaa03f8 Update tests to use gotest.tools 👼
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 38457285242e57306c5b7ee652c7ccbb9fbd6713
Component: engine
2018-06-13 09:04:30 +02:00
e027a9c59e Merge pull request #37151 from tonistiigi/experimental-buildkit
Experimental BuildKit support
Upstream-commit: c752b0991e31ba9869ab6a0661af57e9423874fb
Component: engine
2018-06-12 13:31:48 -07:00
36f219fce9 Upgrade imdario/mergo to v0.3.5
Mainly to get inline with `docker/cli` version of that dependency

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: f929f15dd6e316402394143eeb60ad9ba95a81cb
Component: engine
2018-06-11 15:30:46 +02:00
f05bfde667 integration-cli: fix error message for non-buildkit
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: b1942bc015f0ec6258c39748032171c09bf562ab
Component: engine
2018-06-10 10:05:31 -07:00
e010ecad6a integration-cli: fix health test
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: 1f09adbe163f008e36dffa45c8f4b43605d7426e
Component: engine
2018-06-10 10:05:29 -07:00
b617d4ac86 builder: have TestBuildDockerignoringBadExclusion pass with buildkit
Signed-off-by: Tibor Vass <tibor@docker.com>
Upstream-commit: 9cc49b4ab91d1083932b952dec7475c46732b5b5
Component: engine
2018-06-10 10:05:28 -07:00
6f67597200 builder: Add TODOBuildkit test requirement, specifically for TestBuildCancellationKillsSleep
Signed-off-by: Tibor Vass <tibor@docker.com>
Upstream-commit: 60a911dfcab2304825e4e8f53999866cfc42d4d8
Component: engine
2018-06-10 10:05:28 -07:00
1986a1408c Merge pull request #37172 from zq-david-wang/resizefix2
Fix race condition between exec start and resize.
Upstream-commit: 5e11f66cb6de472d11647e8b1a744afc941859ad
Component: engine
2018-06-08 15:43:25 -07:00
87cfb7e0a8 Fix race condition between exec start and resize
Signed-off-by: David Wang <00107082@163.com>
Upstream-commit: e6783656f917c5a8b8c6f346b4ff840d97b1b6ce
Component: engine
2018-06-08 11:07:48 +08:00
2452577cb1 Merge pull request #37194 from AntaresS/fix-test-failure
fix a failed test
Upstream-commit: ca25df3b54300e897d96029dcc4f86b8c4215a27
Component: engine
2018-06-05 02:38:04 +02:00
0e7017a3ae Merge pull request #36688 from cpuguy83/volumes_service
Extract volume interaction to a volumes service
Upstream-commit: 5037c5a8ce762b46638378b7a7d1081572eadba1
Component: engine
2018-06-05 02:16:20 +02:00
82d56e0c15 fix a failed test
Signed-off-by: Anda Xu <anda.xu@docker.com>
Upstream-commit: 1d9973c0d4c51362e8c5b38e585a025c90baf085
Component: engine
2018-06-04 14:29:00 -07:00
2f23577c7a vendor: use dockerfile parser from buildkit
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: c9ebd2f13b3aab49c2d90cc38dcf2cd0d059697f
Component: engine
2018-06-02 11:10:34 -07:00
2c7c1d708b Alternative failure mitigation of TestExecInteractiveStdinClose
Begin to copy the data until the command to exit and any coping to
stdin or copy from stdout/stderr has completed.
Also adding defense code to trim the possible '\x00' null value.

Signed-off-by: Dennis Chen <dennis.chen@arm.com>
Upstream-commit: 386e0f36c42593ef434517448ccfac5262f958d6
Component: engine
2018-05-28 11:25:31 +08:00
feb51dbad1 Extract volume interaction to a volumes service
This cleans up some of the package API's used for interacting with
volumes, and simplifies management.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: e4b6adc88e967971de634596654d9bc33e7bd7e0
Component: engine
2018-05-25 14:21:07 -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
66dfe0e944 TestContainerAPITop: fix flakyness
The following failure is seen in CI from time to time:

> FAIL: docker_api_containers_test.go:435: DockerSuite.TestContainerAPITop
>
> docker_api_containers_test.go:453:
>     c.Assert(top.Processes[0][10], checker.Equals, "/bin/sh -c top")
> ... obtained string = "top"
> ... expected string = "/bin/sh -c top"

The test case expects two processes in the output:

1. /bin/sh -c top
2. top

in the given order.

Now, "ps aux" output is sorted by PID*, and so since the "top" is a child
of "/bin/sh -c top" it has a higher PID and will come second as expected
by the test... unless the PIDs on the system are exhausted and PID rollover
happens, in which case PID of "top" will be lower than that of "/bin/sh".

Fix: sort output by process name.

* - in fact it is not sorted, but is being printed in the same order as
    the kernel list PID entries in /proc directory, which appears to be
    sorted by PID (see ls -1 -U /proc).

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: 0823ab70990fa4cbf520726013e75c264e6c5231
Component: engine
2018-05-22 18:11:36 -07:00
717e3937b9 more fixes on integration
Signed-off-by: Anda Xu <anda.xu@docker.com>
Upstream-commit: b9b4f888703a20ddd7670c1b978dcb1621fa210f
Component: engine
2018-05-22 11:25:25 -07:00
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