Commit Graph

55 Commits

Author SHA1 Message Date
45b389fec8 Replace some checkers and assertions with gotest.tools
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 6345208b9b067f19f7792edcc675f59a617a3ca5)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 9a4d7bb0e25169fa7d48e24777c683587c29c25a
Component: engine
2019-04-17 23:10:05 +02:00
7f2bfe773c Test: Replace NewClient() with NewClientT()
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 2cb7b73a1bdbf2e7ea6da7d0c050b303c2c4f5dc)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: bb221587404be76f404062618e7d947f4d1bd39b
Component: engine
2019-04-17 21:34:09 +02: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
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
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
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
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
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
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
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
49adb54d71 Remove duplicate calls for getting an APIClient
Remove request.SockRequest
Remove request.SockRequestHijack
Remove request.SockRequestRaw()
Remove deprecated ParseHost
Deprecate and unexport more helpers

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 0a91ba2d8cfe16df0ba37c1e283c8e3dbbb086d4
Component: engine
2018-02-20 17:27:24 -05:00
82570b7d22 Migrate some calls to new client function
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 6977f468bbcf43864a5acf6c89c331a9180169e5
Component: engine
2018-02-08 16:21:45 +01:00
be83c11fb0 Add canonical import comment
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 4f0d95fa6ee7f865597c03b9e63702cdcb0f7067
Component: engine
2018-02-05 16:51:57 -05:00
621388138c Golint: remove redundant ifs
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: b4a63139696aea2c73ec361a9af8b36a118f0423
Component: engine
2018-01-15 00:42:25 +01:00
1377e81acb Added support for swarm service isolation mode
Signed-off-by: Simon Ferquel <simon.ferquel@docker.com>
Upstream-commit: f28cb422e69bd4239401e6ea32b65b56485d6691
Component: engine
2017-10-30 16:16:18 +01:00
044d7f995b Update libcontainerd to use containerd 1.0
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
Upstream-commit: ddae20c032058a0fd42c34c2e9750ee8f6296ac8
Component: engine
2017-10-20 07:11:37 -07:00
402a69d8fb Cleanup daemon.LoadBusybox() to use the API instead of client
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 98a4613017df2b7de045d93e25a376fd00baeb0c
Component: engine
2017-08-25 17:24:25 -04:00
e8bff97a66 Update tests to use icmd
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 92427b3a8146e048c4b85e5ece1530da97d8472d
Component: engine
2017-08-25 12:07:30 -04:00
8ae7aa2322 Merge pull request #34583 from tklauser/win-event-functions
Use windows event functions from golang.org/x/sys/windows
Upstream-commit: 2cea2f5469871c16564c900c5b27cee102ebff0b
Component: engine
2017-08-25 07:43:03 -07:00
e48013ec36 Stop using deprecated SockRequest
Signed-off-by: Stanislav Bondarenko <stanislav.bondarenko@gmail.com>
Upstream-commit: 0fd5a654280ef509a6512f84981f28d559869b90
Component: engine
2017-08-23 17:10:04 -04:00
f5c5b5cc38 Remove RunCommandPipelineWithOutput
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: e885af2a6b6b9f88a8b419d225b1425ec3d9416e
Component: engine
2017-08-22 17:15:26 -04:00
56e5cffbc1 Remove testutil.ReadBody
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 4f304e72a2e4451b043ab1a73a6c44894333c5c7
Component: engine
2017-08-22 17:15:26 -04:00
4f846a2e15 Use event functions from golang.org/x/sys/windows
Use CreateEvent, OpenEvent (which both map to the respective *EventW
function) and PulseEvent from golang.org/x/sys instead of local copies.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Upstream-commit: e942513ac46656c3f54cd103e990e2b7bd5c2b14
Component: engine
2017-08-21 12:58:09 +02:00
e95f4619cd [project] change syscall to /x/sys/unix|windows
Changes most references of syscall to golang.org/x/sys/
Ones aren't changes include, Errno, Signal and SysProcAttr
as they haven't been implemented in /x/sys/.

Signed-off-by: Christopher Jones <tophj@linux.vnet.ibm.com>

[s390x] switch utsname from unsigned to signed

per 33267e036f
char in s390x in the /x/sys/unix package is now signed, so
change the buildtags

Signed-off-by: Christopher Jones <tophj@linux.vnet.ibm.com>
Upstream-commit: 069fdc8a083cb1663e4f86fe3fd9b9a1aebc3e54
Component: engine
2017-07-11 08:00:32 -04:00
c782cb6c44 Make plugin emit strongly typed, consumable events
Enables other subsystems to watch actions for a plugin(s).

This will be used specifically for implementing plugins on swarm where a
swarm controller needs to watch the state of a plugin.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 72c3bcf2a533a827402945e3a55872e2db4fb024
Component: engine
2017-07-06 14:26:06 -04:00
53e0ae35b8 Add integration test coverage for configs
Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: d2c5b6ee9f5240e23aa9fa0f374b89a9726d2200
Component: engine
2017-05-11 10:18:44 -07:00
cb7f296afd Introduce cli.Wait* fuctions
These replace `wait*` functions from `docker_utils_test.go` and work
more or less like other `cli` functions.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: db35c2a5a8d93cfeac9e75a3add60ae7c64a5856
Component: engine
2017-04-14 19:27:33 +02:00
499e804f82 cli: Allow service's networks to be updated
Resolve networks IDs on the client side.

Avoid filling in deprecated Spec.Networks field.

Sort networks in the TaskSpec for update stability.

Add an integration test for changing service networks.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: 0f2669a63834844fb0ef5c017f517d8c321ad3c7
Component: engine
2017-04-07 16:46:25 -07:00
fd940e1e8e Deprecate --graph flag; Replace with --data-root
Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
Upstream-commit: 261ef1fa27c4dfefa5f686b0a4ef354a43040e58
Component: engine
2017-03-30 11:24:56 +02:00
4340eba05a make secret update support name and id prefix
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: 9d30525a04e2d4efe51ac9e6c114ce36276aafa8
Component: engine
2017-03-07 16:01:21 +08:00
fea75fa014 Update request.* signature to remove the host
99.9% of use case for request call are using daemonHost. This makes it
default and adds a `request.DoOnHost` function to be able to specify
the host for specific, more complex use cases.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: b11ba1231ef0ac99279ed5dcd76d81413d7d63b5
Component: engine
2017-03-06 16:41:33 +01:00
324d1b77a6 Merge pull request #29775 from AkihiroSuda/integration-cli-on-swarm
[EXPERIMENTAL] Integration Test on Swarm (completes in about 5 minutes, with 10 Swarm nodes)
Upstream-commit: 01ed606439976e8a159c2a8406228ac52941ae47
Component: engine
2017-03-01 21:16:05 +01:00
b8d05e7498 Convert request.SockRequestRaw to appropriate methods
`request.SockRequestRaw` is deprecated, let's use appropriate methods
for those. This is a first pass, `SockRequest` still needs to be removed.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: f85ee17810ca55a3104f8a7d8945bd16ac526dd0
Component: engine
2017-02-28 17:12:30 +01:00
e642076136 [EXPERIMENTAL] Integration Test on Swarm
This commit adds contrib/integration-cli-on-swarm/integration-cli-on-swarm.sh,
which enables IT to be running in parallel, using Swarm-mode and Funker.

Please refer to contrib/integration-cli-on-swarm/README.md

The test takes almost 5 to 6 minutes, with 10 n1-standard-4 GCE instances.

  $ ./contrib/integration-cli-on-swarm/integration-cli-on-swarm.sh --push-worker-image example.gcr.io/foo/bar --replicas 30 --shuffle
  2016/12/29 08:32:15 Loaded 1618 tests (30 chunks)
  2016/12/29 08:32:15 Executing 30 chunks in parallel, against "integration-cli-worker"
  2016/12/29 08:32:15 Executing chunk 0 (contains 54 test filters)
  ..
  2016/12/29 08:34:34 Finished chunk 28 [1/30] with 54 test filters in 2m19.098068003s, code=0.
  2016/12/29 08:34:38 Finished chunk 12 [2/30] with 54 test filters in 2m23.088569511s, code=0.
  2016/12/29 08:34:48 Finished chunk 10 [3/30] with 54 test filters in 2m33.880679079s, code=0.
  2016/12/29 08:34:54 Finished chunk 20 [4/30] with 54 test filters in 2m39.973747028s, code=0.
  2016/12/29 08:35:11 Finished chunk 18 [5/30] with 54 test filters in 2m56.28384361s, code=0.
  2016/12/29 08:35:11 Finished chunk 29 [6/30] with 52 test filters in 2m56.54047088s, code=0.
  2016/12/29 08:35:15 Finished chunk 1 [7/30] with 54 test filters in 3m0.285044426s, code=0.
  2016/12/29 08:35:22 Finished chunk 6 [8/30] with 54 test filters in 3m7.211775338s, code=0.
  2016/12/29 08:35:24 Finished chunk 25 [9/30] with 54 test filters in 3m9.938413009s, code=0.
  2016/12/29 08:35:30 Finished chunk 27 [10/30] with 54 test filters in 3m15.219834368s, code=0.
  2016/12/29 08:35:36 Finished chunk 9 [11/30] with 54 test filters in 3m21.615434162s, code=0.
  2016/12/29 08:35:41 Finished chunk 13 [12/30] with 54 test filters in 3m26.576907401s, code=0.
  2016/12/29 08:35:45 Finished chunk 17 [13/30] with 54 test filters in 3m30.290752537s, code=0.
  2016/12/29 08:35:53 Finished chunk 2 [14/30] with 54 test filters in 3m38.148423321s, code=0.
  2016/12/29 08:35:55 Finished chunk 24 [15/30] with 54 test filters in 3m40.09669137s, code=0.
  2016/12/29 08:35:57 Finished chunk 8 [16/30] with 54 test filters in 3m42.299945108s, code=0.
  2016/12/29 08:35:57 Finished chunk 22 [17/30] with 54 test filters in 3m42.946558809s, code=0.
  2016/12/29 08:35:59 Finished chunk 23 [18/30] with 54 test filters in 3m44.232557165s, code=0.
  2016/12/29 08:36:02 Finished chunk 3 [19/30] with 54 test filters in 3m47.112051358s, code=0.
  2016/12/29 08:36:11 Finished chunk 15 [20/30] with 54 test filters in 3m56.340656645s, code=0.
  2016/12/29 08:36:11 Finished chunk 11 [21/30] with 54 test filters in 3m56.882401231s, code=0.
  2016/12/29 08:36:22 Finished chunk 19 [22/30] with 54 test filters in 4m7.551093516s, code=0.
  2016/12/29 08:36:23 Finished chunk 21 [23/30] with 54 test filters in 4m8.221093446s, code=0.
  2016/12/29 08:36:25 Finished chunk 16 [24/30] with 54 test filters in 4m10.450451705s, code=0.
  2016/12/29 08:36:27 Finished chunk 5 [25/30] with 54 test filters in 4m12.162272692s, code=0.
  2016/12/29 08:36:28 Finished chunk 14 [26/30] with 54 test filters in 4m13.977801031s, code=0.
  2016/12/29 08:36:29 Finished chunk 0 [27/30] with 54 test filters in 4m14.34086812s, code=0.
  2016/12/29 08:36:49 Finished chunk 26 [28/30] with 54 test filters in 4m34.437085539s, code=0.
  2016/12/29 08:37:14 Finished chunk 7 [29/30] with 54 test filters in 4m59.22902721s, code=0.
  2016/12/29 08:37:20 Finished chunk 4 [30/30] with 54 test filters in 5m5.103469214s, code=0.
  2016/12/29 08:37:20 Executed 30 chunks in 5m5.104379119s. PASS: 30, FAIL: 0.

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
Upstream-commit: 28797019b3f0eb288c4b201237cb992ec148dd4c
Component: engine
2017-02-28 02:10:09 +00:00
e290b2d1c4 Remove most of the runCommandWithOutput from integration tests
There is 5 calls left, that use StdinPipe that is not yet supported by
icmd.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: ecbb0e62f66da7d698c4f4583f36b927d8cfa811
Component: engine
2017-01-30 10:54:06 +01:00
f757a1d4b1 Minor GoDoc fixup in integration-cli
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 089e1c1c5b74dd794c4cb6db86240e175000edc0
Component: engine
2017-01-24 18:03:30 +01:00
9cbd4394d2 Improve the error print of image inspect
Signed-off-by: Yanqiang Miao <miao.yanqiang@zte.com.cn>
Upstream-commit: cc9ed0a31b0656c58ad7953f2c54d46258380443
Component: engine
2017-01-24 11:07:20 +08:00
bdb483e4e4 Clean more build utils in integration cli
- Remove deprecated buildImage* functions
- Rename buildImageNew to buildImage
- Use *check.C in fakeContext* setup and in getIdByName

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: c10f6ef43f884306eb3ef60b2d19fdc931cf34cc
Component: engine
2017-01-17 15:42:38 +01:00
24c4a881f8 Fix leaked connections in integration tests
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: 1e98fb5ad91b956005059ae2148b1dda6fdf372c
Component: engine
2017-01-11 14:48:48 -08:00
44a6bbe938 Add a new request package in integration-cli
The goal is to remove function from `docker_utils.go` and setup
simple, one-responsability package that can be well tested ; and to
ease writing request.

This moves all the calls to `sockRequest` (and similar methods) to
their counterpart in the `request` package.

This introduce `request.Do` to write easier request (with functional
argument to easily augment the request) with some pre-defined function
for the most used http method (i.e. `request.Get`, `request.Post` and
`request.Delete`).

Few of the `sockRequest` call have been moved to `request.Do` (and
`Get`, etc.) to showcase the usage of the package. There is still a
whole lot to do.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: d69d4799a312dfcae63442e290ae6667afd1a038
Component: engine
2017-01-03 11:49:30 +01:00
2758f0996d Remove pkg/integration and move it to testutil or integration-cli
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 33968e6c7df164fff0a882c50ae7f4f7e6190e4b
Component: engine
2016-12-30 18:26:34 +01:00
a767ec924e Merge pull request #29721 from coolljt0725/follow_29365
Follow up #29365, fix fail to remove container after restart
Upstream-commit: 36ed7d58bb19e46445c81b6a00a7b75a6280e654
Component: engine
2016-12-30 00:13:13 +01:00
0f363a44c6 Introduce a environment package in integration-cli
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 433e2e8a1eb84ad7bb39b5206b2fdf6ac9da7b27
Component: engine
2016-12-29 11:00:50 +01:00
2ac27c5a50 Follow up #29365, fix fail to remove container after restart
Call daemon.Mount will increase the refcount of mounted path,
for those previous running containers, `Mount` call will make
the refcount to 2. see
https://github.com/docker/docker/blob/v1.13.0-rc4/daemon/graphdriver/counter.go#L38
```
	if !m.check {
		m.check = true
		if c.checker.IsMounted(path) {
			m.count++
		}
	}
	m.count++

```
graphdrive could restore on reboot after #22541, call
daemon.Mount to resore the graphdriver is not necessary.

And call `daemon.Mount` on restorting will mount all the containers
mounted layer even if it was stop.

This fix call Mount and then Unmount to get `BaseFs`

Signed-off-by: Lei Jitang <leijitang@huawei.com>
Upstream-commit: 77c725eac2820b3d5b4252f5c25bbf305657d72a
Component: engine
2016-12-28 20:08:03 -05:00
44fa4f8ae7 duplicated the
Signed-off-by: Jie Luo <luo612@zju.edu.cn>

typo

Signed-off-by: Jie Luo <luo612@zju.edu.cn>

fix some typos

Signed-off-by: Jie Luo <luo612@zju.edu.cn>
Upstream-commit: ea2dd4b5d0b41552d047814d9e39ddaa3662ab41
Component: engine
2016-12-21 20:16:19 +08:00
67834a4b9f Merge pull request #29470 from cyli/ask-for-unlock-key-only-if-locked
Check if a swarm is locked before asking a user to enter their unlock key
Upstream-commit: 0d5a715931c514dd9fdc77927105bdf049411b2b
Component: engine
2016-12-20 13:21:47 -08:00
0a2ba8aaae Merge pull request #29378 from aaronlehmann/swarm-plugins
Support v2 plugins in swarm mode
Upstream-commit: eb59c6d587ab5d3a49f044b4399046c0979bd1af
Component: engine
2016-12-19 11:07:06 +01:00
d791b713a3 Before asking a user for the unlock key when they run docker swarm unlock, actually
check to see if the node is part of a swarm, and if so, if it is unlocked first.
If neither of these are true, abort the command.

Signed-off-by: Ying Li <ying.li@docker.com>
Upstream-commit: a6a0880a22e2b135d8a20a46b9ba34c7a9cf2f10
Component: engine
2016-12-16 17:16:55 -08:00
dd03359697 Add integration test for volume plugins on swarm
Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: 45990d6e6144daaaf53b09325e7576f0cbec74f3
Component: engine
2016-12-16 10:45:47 -08:00