Commit Graph

22 Commits

Author SHA1 Message Date
Vincent Demeester db35c2a5a8 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>
2017-04-14 19:27:33 +02:00
Josh Hawn 261ef1fa27 Deprecate --graph flag; Replace with --data-root
Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
2017-03-30 11:24:56 +02:00
Vincent Demeester b11ba1231e
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>
2017-03-06 16:41:33 +01:00
Sebastiaan van Stijn 01ed606439 Merge pull request #29775 from AkihiroSuda/integration-cli-on-swarm
[EXPERIMENTAL] Integration Test on Swarm (completes in about 5 minutes, with 10 Swarm nodes)
2017-03-01 21:16:05 +01:00
Vincent Demeester f85ee17810
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>
2017-02-28 17:12:30 +01:00
Akihiro Suda 28797019b3 [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>
2017-02-28 02:10:09 +00:00
Vincent Demeester ecbb0e62f6 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>
2017-01-30 10:54:06 +01:00
Sebastiaan van Stijn 089e1c1c5b Minor GoDoc fixup in integration-cli
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-01-24 18:03:30 +01:00
Yanqiang Miao cc9ed0a31b Improve the error print of image inspect
Signed-off-by: Yanqiang Miao <miao.yanqiang@zte.com.cn>
2017-01-24 11:07:20 +08:00
Vincent Demeester c10f6ef43f
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>
2017-01-17 15:42:38 +01:00
Tonis Tiigi 1e98fb5ad9 Fix leaked connections in integration tests
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2017-01-11 14:48:48 -08:00
Vincent Demeester d69d4799a3
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>
2017-01-03 11:49:30 +01:00
Vincent Demeester 33968e6c7d
Remove pkg/integration and move it to testutil or integration-cli
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-12-30 18:26:34 +01:00
Sebastiaan van Stijn 36ed7d58bb Merge pull request #29721 from coolljt0725/follow_29365
Follow up #29365, fix fail to remove container after restart
2016-12-30 00:13:13 +01:00
Vincent Demeester 433e2e8a1e
Introduce a environment package in integration-cli
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-12-29 11:00:50 +01:00
Lei Jitang 77c725eac2 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>
2016-12-28 20:08:03 -05:00
Jie Luo ea2dd4b5d0 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>
2016-12-21 20:16:19 +08:00
Vincent Demeester cf2ea76138
Remove some fmt.Printf from integration-cli/daemon…
… to flood a little bit less the integration cli output. Now use any
testing framework that has a LogF function.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-12-14 10:52:51 +01:00
Vincent Demeester e857785df4
Fixing win2lin builds by adding a testRequires to DockerDaemonSuite
The success of the win2lin CI before was really "by chance" on the
DockerDaemonSuite : the DockerDaemonSuite was panicking when starting
the daemon on the first non-skipped test.The suite panicked but as
the error returned from `StartWithBusybox` was nil, the test kept
going and was OK because the client had all the correct environment
variables set up to discuss with the remote daemon.

Then, as the suite panicked, no more test attached on the
DockerDaemonSuite ran (that's why on win2lin, `DockerDaemonSuite` was
only composed by 5 tests !). The really bad thing is, we didn't get
any report of the panic on the suite (go-check hiding something
somewhere).

As DockerDaemonSuite needs to run test on the same host as it's
running, this adds a `SameHostDaemon` requirement to the Suite.

This changes also make sure `TestRestartContainerWithRestartPolicy`
does left weirdies behind it.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-12-13 12:04:53 +01:00
Vincent Demeester c502fb49dc Use *check.C in StartWithBusybox, Start, Stop and Restart…
… to make sure it doesn't fail. It also introduce StartWithError,
StopWithError and RestartWithError in case we care about the
error (and want the error to happen).

This removes the need to check for error and make the intent more
clear : I want a deamon with busybox loaded on it — if an error occur
it should fail the test, but it's not the test code that has the
responsability to check that.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-12-12 09:46:47 +01:00
Vincent Demeester f4a34a1f06 Remove check.C field from daemon and Use errors package
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-12-09 22:26:42 +01:00
Vincent Demeester 48de91a33f Extract daemon to its own package
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-12-09 22:26:42 +01:00