Commit graph

946 commits

Author SHA1 Message Date
Sebastiaan van Stijn
b0de11cf30
Add test for status code on conflicting service names
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-11-24 11:53:08 +01:00
Sebastiaan van Stijn
0b7cb16dde
Merge pull request #38102 from selansen/master
VXLAN UDP Port configuration support
2018-11-24 11:50:10 +01:00
selansen
32180ac0c7 VXLAN UDP Port configuration support
This commit contains changes to configure DataPathPort
option. By default we use 4789 port number. But this commit
will allow user to configure port number during swarm init.
DataPathPort can't be modified after swarm init.
Signed-off-by: selansen <elango.siva@docker.com>
2018-11-22 17:35:02 -05:00
zhangyue
5007c36d71 cli: fix images filter when use multi reference filter
Signed-off-by: zhangyue <zy675793960@yeah.net>
2018-11-22 10:33:45 +08:00
maxwell
317f5e0edc Fix log
Signed-off-by: maxwell <csuhp007@gmail.com>
2018-11-11 23:07:43 +08:00
Sebastiaan van Stijn
06a4fd5009
Merge pull request #38141 from thaJeztah/handle_invalid_json
API: properly handle invalid JSON to return a 400 status
2018-11-08 12:22:02 +01:00
Sebastiaan van Stijn
c7b488fbc8
API: properly handle invalid JSON to return a 400 status
The API did not treat invalid JSON payloads as a 400 error, as a result
returning a 500 error;

Before this change, an invalid JSON body would return a 500 error;

```bash
curl -v \
  --unix-socket /var/run/docker.sock \
  -X POST \
  "http://localhost/v1.30/networks/create" \
  -H "Content-Type: application/json" \
  -d '{invalid json'
```

```
> POST /v1.30/networks/create HTTP/1.1
> Host: localhost
> User-Agent: curl/7.52.1
> Accept: */*
> Content-Type: application/json
> Content-Length: 13
>
* upload completely sent off: 13 out of 13 bytes
< HTTP/1.1 500 Internal Server Error
< Api-Version: 1.40
< Content-Type: application/json
< Docker-Experimental: false
< Ostype: linux
< Server: Docker/dev (linux)
< Date: Mon, 05 Nov 2018 11:55:20 GMT
< Content-Length: 79
<
{"message":"invalid character 'i' looking for beginning of object key string"}
```

Empty request:

```bash
curl -v \
  --unix-socket /var/run/docker.sock \
  -X POST \
  "http://localhost/v1.30/networks/create" \
  -H "Content-Type: application/json"
```

```
> POST /v1.30/networks/create HTTP/1.1
> Host: localhost
> User-Agent: curl/7.54.0
> Accept: */*
> Content-Type: application/json
>
< HTTP/1.1 500 Internal Server Error
< Api-Version: 1.38
< Content-Length: 18
< Content-Type: application/json
< Date: Mon, 05 Nov 2018 12:00:18 GMT
< Docker-Experimental: true
< Ostype: linux
< Server: Docker/18.06.1-ce (linux)
<
{"message":"EOF"}
```

After this change, a 400 is returned;

```bash
curl -v \
  --unix-socket /var/run/docker.sock \
  -X POST \
  "http://localhost/v1.30/networks/create" \
  -H "Content-Type: application/json" \
  -d '{invalid json'
```

```
> POST /v1.30/networks/create HTTP/1.1
> Host: localhost
> User-Agent: curl/7.52.1
> Accept: */*
> Content-Type: application/json
> Content-Length: 13
>
* upload completely sent off: 13 out of 13 bytes
< HTTP/1.1 400 Bad Request
< Api-Version: 1.40
< Content-Type: application/json
< Docker-Experimental: false
< Ostype: linux
< Server: Docker/dev (linux)
< Date: Mon, 05 Nov 2018 11:57:15 GMT
< Content-Length: 79
<
{"message":"invalid character 'i' looking for beginning of object key string"}
```

Empty request:

```bash
curl -v \
  --unix-socket /var/run/docker.sock \
  -X POST \
  "http://localhost/v1.30/networks/create" \
  -H "Content-Type: application/json"
```

```
> POST /v1.30/networks/create HTTP/1.1
> Host: localhost
> User-Agent: curl/7.52.1
> Accept: */*
> Content-Type: application/json
>
< HTTP/1.1 400 Bad Request
< Api-Version: 1.40
< Content-Type: application/json
< Docker-Experimental: false
< Ostype: linux
< Server: Docker/dev (linux)
< Date: Mon, 05 Nov 2018 11:59:22 GMT
< Content-Length: 49
<
{"message":"got EOF while reading request body"}
```

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-11-06 21:30:44 +01:00
Akihiro Suda
596cdffb9f mount: add BindOptions.NonRecursive (API v1.40)
This allows non-recursive bind-mount, i.e. mount(2) with "bind" rather than "rbind".

Swarm-mode will be supported in a separate PR because of mutual vendoring.

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2018-11-06 17:51:58 +09:00
Sebastiaan van Stijn
b334198e65
Enable volume tests on Windows
These tests don't seem to have anything Linux-specific,
so enable them on Windows

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-11-02 15:18:26 +01:00
Sebastiaan van Stijn
05e18429cf
Integration test: use filepath.Join() to make path cross-platform
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-11-02 15:18:19 +01:00
Sebastiaan van Stijn
8e8cac8263
Some improvements to TestVolumesInspect
Some improvements in this test;

- use the volume-information that's returned by VolumeCreate as "expected"
- don't use an explict name for the volume, as it was only used to reference
  the volume for inspection
- improve the test-output on failure, so that "expected" and "actual" values
  are printed

Without this patch applied;

    === RUN   TestVolumesInspect
    --- FAIL: TestVolumesInspect (0.02s)
     	volume_test.go:108: assertion failed: false (bool) != true (true bool): Time Volume is CreatedAt not equal to current time
    FAIL

With this patch applied;

    === RUN   TestVolumesInspect
    --- FAIL: TestVolumesInspect (0.02s)
        volume_test.go:95: assertion failed: expression is false: createdAt.Truncate(time.Minute).Equal(now.Truncate(time.Minute)): CreatedAt (2018-11-01 16:15:20 +0000 UTC) not equal to creation time (2018-11-01 16:15:20.2421166 +0000 UTC m=+13.733512701)
    FAIL

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-11-02 15:18:11 +01:00
Sebastiaan van Stijn
1434204647
Fix double "unix://" scheme in TestInfoAPIWarnings
`d.Sock()` already returns the socket-path including the
`unix://` scheme.

Also removed `--iptables=false`, as it didn't really seem
nescessary for this test.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-10-31 14:10:22 +01:00
Sebastiaan van Stijn
cb9d2cb71b
Move support for sysctl options in services to API v1.40
This feature was added in 14da20f5e7,
and was merged after API v1.39 shipped as part of the Docker 18.09
release candidates.

This commit moves the feature to the correct API version.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-10-26 15:39:36 +02:00
Wei Fu
8e25f4ff6d testing: add case for exec closeStdin
add regression case for the issue#37870

Signed-off-by: Wei Fu <fuweid89@gmail.com>
2018-10-23 09:47:48 +08:00
Sebastiaan van Stijn
5d82d77a6d
Merge pull request #37715 from salah-khan/windows-enable-integration
Windows: Start of enabling tests under integration
2018-10-10 21:23:24 +02:00
Sebastiaan van Stijn
750130d748
Remove unneeded check for binary-commits
This check was not important anymore; we're only interested if
the API returns a matching commit for each binary.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-10-10 12:21:20 +02:00
Salahuddin Khan
4c8b1fd5a2 Enabling Windows integration tests
Signed-off-by: Salahuddin Khan <salah@docker.com>
2018-09-26 15:57:40 -07:00
Vincent Demeester
d3cc071bb9 Windows: Start of enabling tests under integration/
- Add windows CI entrypoint script.

Signed-off-by: John Howard <jhoward@microsoft.com>
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-09-26 12:28:22 -07:00
Vincent Demeester
9f296d1e6f
Merge pull request #37701 from dperny/add-swarmkit-sysctl-support
Add support for sysctl options in services
2018-09-26 09:06:22 +02:00
Yong Tang
30b5eb19d4
Merge pull request #37851 from adshmh/migrate-ipc-integration-tests-to-integration-container
migrated ipc integration tests to integration/container
2018-09-22 09:58:56 -07:00
Drew Erny
14da20f5e7 Add support for sysctl options in services
Adds support for sysctl options in docker services.

* Adds API plumbing for creating services with sysctl options set.
* Adds swagger.yaml documentation for new API field.
* Updates the API version history document.
* Changes executor package to make use of the Sysctls field on objects
* Includes integration test to verify that new behavior works.

Essentially, everything needed to support the equivalent of docker run's
`--sysctl` option except the CLI.

Includes a vendoring of swarmkit for proto changes to support the new
behavior.

Signed-off-by: Drew Erny <drew.erny@docker.com>
2018-09-20 10:51:56 -05:00
Yong Tang
ed392603ac
Merge pull request #37486 from adshmh/migrate-docker_cli_secret_create_test-integration-tests-to-integration-secret
migrate create secret integration tests from integration-cli to integration/secret
2018-09-15 06:20:27 -07:00
Yong Tang
3c5317ed39
Merge pull request #37444 from adshmh/migrate-docker_api_create_test-integration-tests-to-integration_container
Refactor and migrate integration tests from integration-cli/docker_api_create_test to integration/container
2018-09-15 06:19:09 -07:00
Arash Deshmeh
febefb850d migrated ipc integration tests to integration/container
Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
2018-09-14 17:19:34 -04:00
Sebastiaan van Stijn
9299561bd3
Merge pull request #37736 from selansen/master
Global Default AddressPool - Update
2018-09-14 18:47:42 +02:00
Vincent Demeester
43b8dc7e1d
Merge pull request #37773 from kolyshkin/fix-TestServiceWithDefaultAddressPoolInit
TestServiceWithDefaultAddressPoolInit: avoid panic
2018-09-14 11:47:29 +02:00
Kir Kolyshkin
69d3a8936b TestServiceWithDefaultAddressPoolInit: avoid panic
Saw this in moby ci:

> 00:22:07.582 === RUN   TestServiceWithDefaultAddressPoolInit
> 00:22:08.887 --- FAIL: TestServiceWithDefaultAddressPoolInit (1.30s)
> 00:22:08.887 	daemon.go:290: [d905878b35bb9] waiting for daemon to start
> 00:22:08.887 	daemon.go:322: [d905878b35bb9] daemon started
> 00:22:08.888 panic: runtime error: index out of range [recovered]
> 00:22:08.889 	panic: runtime error: index out of range
> 00:22:08.889
> 00:22:08.889 goroutine 360 [running]:
> 00:22:08.889 testing.tRunner.func1(0xc42069d770)
> 00:22:08.889 	/usr/local/go/src/testing/testing.go:742 +0x29d
> 00:22:08.890 panic(0x85d680, 0xb615f0)
> 00:22:08.890 	/usr/local/go/src/runtime/panic.go:502 +0x229
> 00:22:08.890 github.com/docker/docker/integration/network.TestServiceWithDefaultAddressPoolInit(0xc42069d770)
> 00:22:08.891 	/go/src/github.com/docker/docker/integration/network/service_test.go:348 +0xb53
> .....

Apparently `out.IPAM.Config[0]` is not there, so to avoid panic, let's
check the size of `out.IPAM.Config` first.

Fixes: f7ad95cab9

[v2: add logging of data returned by NetworkInspect()]
[v3: use assert.Assert to fail immediately]

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2018-09-13 11:56:10 -07:00
Akihiro Suda
112b7dfd57
Merge pull request #37516 from adshmh/migrate-docker_cli_wait_test-to-integration-container
migrate container wait integration tests from integration-cli to integration/container package
2018-09-13 01:55:13 +09:00
selansen
148ff00a0a Global Default AddressPool - Update
Addressing few review comments as part of code refactoring.
Also moved validation logic from CLI to Moby.

Signed-off-by: selansen <elango.siva@docker.com>
2018-09-11 19:02:54 -04:00
Sebastiaan van Stijn
4b18f8c4bf
Merge pull request #37783 from tossmilestone/fix-typo-changelog
Fix various spell errors
2018-09-07 16:54:30 +02:00
Sebastiaan van Stijn
ec99bd6ab8
Merge pull request #37358 from kolyshkin/go111
Bump golang to 1.11.0
2018-09-07 09:35:33 +01:00
Xiaoxi He
5c0d2a0932 Fix some typos
Signed-off-by: Xiaoxi He <xxhe@alauda.io>
2018-09-07 13:13:47 +08:00
Kir Kolyshkin
9b0097a699 Format code with gofmt -s from go-1.11beta1
This should eliminate a bunch of new (go-1.11 related) validation
errors telling that the code is not formatted with `gofmt -s`.

No functional change, just whitespace (i.e.
`git show --ignore-space-change` shows nothing).

Patch generated with:

> git ls-files | grep -v ^vendor/ | grep .go$ | xargs gofmt -s -w

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2018-09-06 15:24:16 -07:00
Kir Kolyshkin
b3165f5b2d integration/build: add TestBuildHugeFile
Add a test case for creating a 8GB file inside a container.
Due to a bug in tar-split this was failing in Docker 18.06.

The file being created is sparse, so there's not much I/O
happening or disk space being used -- meaning the test is
fast and does not require a lot of disk space.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2018-09-05 20:13:57 -07:00
Tibor Vass
8ff7847d1c builder: add prune options to the API
Signed-off-by: Tibor Vass <tibor@docker.com>
2018-09-01 22:01:17 +00:00
Sebastiaan van Stijn
547b993e07
Add warning if REST API is accessible through an insecure connection
The remote API allows full privilege escalation and is equivalent to
having root access on the host. Because of this, the API should never
be accessible through an insecure connection (TCP without TLS, or TCP
without TLS  verification).

Although a warning is already logged on startup if the daemon uses an
insecure configuration, this warning is not very visible (unless someone
decides to read the logs).

This patch attempts to make insecure configuration more visible by sending
back warnings through the API (which will be printed when using `docker info`).

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-08-21 22:03:24 +02:00
selansen
f7ad95cab9 Global Default Address Pool feature support
This feature allows user to specify list of subnets for global
default address pool. User can configure subnet list using
'swarm init' command. Daemon passes the information to swarmkit.
We validate the information in swarmkit, then store it in cluster
object. when IPAM init is called, we pass subnet list to IPAM driver.

Signed-off-by: selansen <elango.siva@docker.com>
2018-08-20 15:07:08 -04:00
Yong Tang
80c92c9b69 Migrate some ipc container test from integration-cli to integration
This fix migrates some ipc container tests from integration-cli
to integration test.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-08-01 21:51:45 +00:00
Vincent Demeester
9149ef67be
Merge pull request #37438 from adshmh/fix-flaky-test-TestRunContainerWithBridgeNone
fix the race condition in the integration test TestRunContainerWithBridgeNone
2018-08-01 09:57:29 +02:00
Vincent Demeester
c2e3657b17
Revert "migrated service integration tests from integration-cli/docker_cli_service_update_test.go to integration/service"
This reverts commit fbaef1b0d3.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-07-27 17:35:52 +02:00
Arash Deshmeh
fbaef1b0d3 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>
2018-07-25 14:49:02 -04:00
Arash Deshmeh
7073aa8a3a migrated container wait integration tests from integration-cli to integration/container package
Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
2018-07-23 17:37:21 -04:00
Arash Deshmeh
cd4d1cfc10 migrate integration tests from integration-cli/docker_api_create_test.go to integration/container
Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
2018-07-18 13:15:04 -04:00
Sebastiaan van Stijn
cc7cda1968
Merge pull request #37483 from thaJeztah/fix-nit-pick
Use constant for task runtime value
2018-07-18 17:31:44 +02:00
Arash Deshmeh
05a9e6239a migrated integration tests from integration-cli/docker_cli_secret_create_test.go to integration/secret
Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
2018-07-17 16:38:37 -04:00
Sebastiaan van Stijn
2b7d34977e
Use constant for task runtime value
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-07-17 20:41:25 +02:00
Sebastiaan van Stijn
352db26d5f
Fix flaky TestExternalGraphDriver/pull test
This test occassionally fails on s390x and Power;

    03:16:04 --- FAIL: TestExternalGraphDriver/pull (1.08s)
    03:16:04 external_test.go:402: assertion failed: error is not nil: Error: No such image: busybox:latest

Most likely these failures are caused due to Docker Hub updating
the busybox:latest image, but not all architectures yet being
available.

Instead of using `:latest`, pull an image by digest, so that
the test doesn't depend on Docker Hub having all architectures
available for `:latest`.

I selected the same digest as is currently used as "frozen image"
in the Dockerfile.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-07-17 10:45:33 +02:00
Arash Deshmeh
0e57ceae0d moved integration tests from docker_cli_config_create_test.go to integration/config
Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
2018-07-13 17:29:02 -04:00
Sebastiaan van Stijn
35f7e7c50a
Fix golint issues
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-07-11 22:19:03 +02:00
Arash Deshmeh
7cda9d8e97 fixed the race condition in the integration test TestRunContainerWithBridgeNone
Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
2018-07-11 10:37:00 -04:00
Yong Tang
e0403604e2 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>
2018-07-04 16:32:18 +00:00
Akihiro Suda
8f709d8948
Merge pull request #37351 from LotusFenn/unique-names-network-service-test
Use unique names in integration/network/service_test.go
2018-06-27 20:32:20 +09:00
Lotus Fenn
f94c97d320 add unique names to integration/network/service_test.go
Signed-off-by: Lotus Fenn <fenn.lotus@gmail.com>
2018-06-27 00:56:52 -07:00
Arash Deshmeh
8b07ec58ea refactored integration/service/network integration tests to use network package
Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
2018-06-26 17:18:22 -04:00
Sebastiaan van Stijn
af626ba08a
Merge pull request #37293 from adshmh/migrate-TestNetworkCreateDelete-to-integration
migrate TestAPINetworkCreateDelete from integration-cli/ to integration/
2018-06-21 19:08:08 -07:00
Arash Deshmeh
dda4128c7e refactor network inspect integration tests to use network package
Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
2018-06-21 09:44:52 -04:00
Arash Deshmeh
1c923b28b8 refactored remaining macvlan integration tests to use network package for creating networks
Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
2018-06-20 17:09:26 -04:00
Arash Deshmeh
6fc9c7e5a9 refactor ipvlan network integration tests to use network.Create
Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
2018-06-16 05:11:35 -04:00
Arash Deshmeh
f542621429 migrate TestAPINetworkCreateDelete from integration-cli/ to integration/
Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
2018-06-15 16:06:45 -04:00
Vincent Demeester
3f405c48ff
Merge pull request #37279 from adshmh/refactor-service-create-integration-tests-use-network-create
Create service integration tests use network package
2018-06-14 12:57:48 +02:00
Sebastiaan van Stijn
d3d58b68c6
Merge pull request #37270 from adshmh/refactor-service-network-integration-tests-use-network-create
refactored service network integration tests to use the network package
2018-06-13 13:11:31 -07:00
Arash Deshmeh
ad46a1f5e7 create service integration tests use network package
Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
2018-06-13 12:10:02 -04:00
Vincent Demeester
3845728524
Update tests to use gotest.tools 👼
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-06-13 09:04:30 +02:00
Arash Deshmeh
694047183a refactored network integration tests under integration/network/service_test.go to use network package
Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
2018-06-12 14:31:01 -04:00
Arash Deshmeh
991d512159 refactor delete network integration tests to use network package
Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
2018-06-09 06:39:22 -04:00
Vincent Demeester
162ba6016d
Merge pull request #37195 from adshmh/refactor-integration-test-create-network-calls-macvlan
Refactor macvlan network integration tests to use network.Create
2018-06-08 09:46:04 +02:00
Sebastiaan van Stijn
f11f249588
Merge pull request #37183 from vdemeester/service-create-init
Add support for `init` on services
2018-06-07 19:22:14 -07:00
Sebastiaan van Stijn
5ff12f6ba1
Merge pull request #37231 from adshmh/use-unique-names-for-integration-tests-service-create
use unique names for resources in create service integration tests
2018-06-07 17:47:07 -07:00
Vincent Demeester
d47c45175b
Merge pull request #37215 from adshmh/integration-container-links-tests-use-unique-names
container links integration tests use unique names
2018-06-07 22:34:12 +02:00
Arash Deshmeh
d5ae23fc11 use unique names for resources in create service integration tests
Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
2018-06-07 12:11:11 -04:00
Vincent Demeester
e401b88e59
Add support for init on services
It's already supported by `swarmkit`, and act the same as
`HostConfig.Init` on container creation.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-06-07 14:17:55 +02:00
Sebastiaan van Stijn
1fe0e49d20
Merge pull request #36644 from jessfraz/rawaccess
api: add MaskedPaths and ReadonlyPaths options
2018-06-06 18:16:16 -07:00
Arash Deshmeh
077247050d integration tests under integration/container/links_linux_test.go use unique names
Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
2018-06-06 06:14:24 -04:00
Jess Frazelle
3694c1e34e
api: add configurable MaskedPaths and ReadOnlyPaths to the API
This adds MaskedPaths and ReadOnlyPaths options to HostConfig for containers so
that a user can override the default values.

When the value sent through the API is nil the default is used.
Otherwise the default is overridden.

Adds integration tests for MaskedPaths and ReadonlyPaths.

Signed-off-by: Jess Frazelle <acidburn@microsoft.com>
2018-06-05 12:33:14 -04:00
Arash Deshmeh
0418893f0b refactored integration tests under integration/network/macvlan to use network.Create
Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
2018-06-05 06:32:24 -04:00
Arash Deshmeh
0e3012cfff Added network package to integration/internal to refactor integration tests calls to client.NetworkCreate
Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
2018-06-05 06:32:24 -04:00
Derek McGowan
52ed3e0896
Update containerd to 1.1
Updates swarmkit, grpc, and all related vendors

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2018-06-04 15:37:03 -07:00
Sebastiaan van Stijn
d7e94d6ea7
Merge pull request #37191 from adshmh/use-unique-names-for-integration-tests-secret
use unique names for resources in integration tests of secret package
2018-06-05 00:06:50 +02:00
Tonis Tiigi
c9ebd2f13b vendor: use dockerfile parser from buildkit
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-06-02 11:10:34 -07:00
Arash Deshmeh
a70794aff0 use unique names for resources in integration tests of integration/secret package
Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
2018-06-01 06:46:52 -04:00
Anda Xu
d8e6f273b5 fix the mis-used skip condition
Signed-off-by: Anda Xu <anda.xu@docker.com>
2018-05-30 17:13:20 -07:00
Tibor Vass
0a94468a5b
Merge pull request #37169 from AntaresS/add-version-checking
add api version checking for tests from new feature
2018-05-30 09:58:45 -10:00
Brian Goff
b85799b63f
Merge pull request #36874 from kolyshkin/stop-timeout
daemon.ContainerStop(): fix for a negative timeout
2018-05-30 13:38:42 -04:00
Anda Xu
8ed0fdebe7 add api version checking for tests from new feature
Signed-off-by: Anda Xu <anda.xu@docker.com>
2018-05-29 15:25:33 -07:00
Yong Tang
76195f8047 Add t.Name() to tests so that service names are unique
This fix adds `t.Name()` to tests in integration/network
so that services created in those tests have unique names.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-05-28 22:57:52 +00:00
Sebastiaan van Stijn
a061b1e2d8
Adjust API version to match correct release
This fix was not yet included in Docker 17.05, so
API version v1.37 was not the right selector (Docker
18.03, 18.04 and 18.05 all support API v1.37).

We should change these checks for engine versions,
or use a different method to skip tests when running
against older engines.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-05-24 02:39:56 +02:00
Sebastiaan van Stijn
f23c00d870
Various code-cleanup
remove unnescessary import aliases, brackets, and so on.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-05-23 17:50:54 +02:00
Anda Xu
84598be35f skip feature/test added that is breaking ee
Signed-off-by: Anda Xu <anda.xu@docker.com>
2018-05-22 17:42:41 -07:00
Anda Xu
b9b4f88870 more fixes on integration
Signed-off-by: Anda Xu <anda.xu@docker.com>
2018-05-22 11:25:25 -07:00
Yong Tang
9bd5d9912f
Merge pull request #37110 from thaJeztah/remove-testutil-errorcontains
Replace deprecated testutil.ErrorContains()
2018-05-21 11:04:45 -07:00
Dennis Chen
476d7872ef 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>
2018-05-21 10:08:27 +08:00
Sebastiaan van Stijn
8974fd47c7
Merge pull request #37011 from arm64b/ReAdd-LABEL-command-4-target-option
Construct and add 'LABEL' command from 'label' option to last stage
2018-05-21 00:15:02 +02:00
Sebastiaan van Stijn
55bebbaecf
Replace deprecated testutil.ErrorContains()
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-05-21 00:13:04 +02:00
Sebastiaan van Stijn
4f8c870d62
Fix some linting issues
These showed locally when running `make validate`. CI doesn't seem to have the
same (possibly it's disabled in the configuration)

    builder/fscache/fscache.go:618::error: github.com/docker/docker/vendor/github.com/tonistiigi/fsutil.StatInfo composite literal uses unkeyed fields (vet)
    client/swarm_unlock_test.go:44::error: github.com/docker/docker/api/types/swarm.UnlockRequest composite literal uses unkeyed fields (vet)
    client/swarm_unlock_test.go:20::error: github.com/docker/docker/api/types/swarm.UnlockRequest composite literal uses unkeyed fields (vet)
    cmd/dockerd/daemon_unix.go:113::error: github.com/docker/docker/cmd/dockerd/hack.MalformedHostHeaderOverride composite literal uses unkeyed fields (vet)
    cmd/dockerd/daemon_unix.go:110::error: github.com/docker/docker/cmd/dockerd/hack.MalformedHostHeaderOverride composite literal uses unkeyed fields (vet)
    daemon/graphdriver/overlay/overlay.go:171::error: github.com/docker/docker/pkg/idtools.IDPair composite literal uses unkeyed fields (vet)
    daemon/graphdriver/overlay/overlay.go:413::error: github.com/docker/docker/pkg/idtools.IDPair composite literal uses unkeyed fields (vet)
    daemon/graphdriver/overlay2/overlay.go:203::error: github.com/docker/docker/pkg/idtools.IDPair composite literal uses unkeyed fields (vet)
    daemon/graphdriver/overlay2/overlay.go:584::error: github.com/docker/docker/pkg/idtools.IDPair composite literal uses unkeyed fields (vet)
    daemon/graphdriver/zfs/zfs.go:109::error: github.com/docker/docker/pkg/idtools.IDPair composite literal uses unkeyed fields (vet)
    daemon/graphdriver/zfs/zfs.go:388::error: github.com/docker/docker/pkg/idtools.IDPair composite literal uses unkeyed fields (vet)
    daemon/volumes_windows.go:27::error: github.com/docker/docker/pkg/idtools.IDPair composite literal uses unkeyed fields (vet)
    integration/service/network_test.go:31::error: github.com/docker/docker/api/types/network.NetworkingConfig composite literal uses unkeyed fields (vet)
    api/server/server.go:129:10⚠️ should not use basic type string as key in context.WithValue (golint)
    integration/service/network_test.go:54::error: github.com/docker/docker/api/types/network.NetworkingConfig composite literal uses unkeyed fields (vet)
    libcontainerd/client_daemon_linux.go:61::error: github.com/docker/docker/pkg/idtools.IDPair composite literal uses unkeyed fields (vet)
    libcontainerd/client_daemon_linux.go:74::error: github.com/docker/docker/pkg/idtools.IDPair composite literal uses unkeyed fields (vet)
    pkg/archive/archive_windows.go:76::error: github.com/docker/docker/pkg/idtools.IDPair composite literal uses unkeyed fields (vet)
    plugin/manager_linux.go:56::error: github.com/docker/docker/pkg/idtools.IDPair composite literal uses unkeyed fields (vet)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-05-17 19:28:27 +02:00
Dennis Chen
f7add4262b Add test case for --label with --target
Add a new test case `TestBuildLabelWithTargets` to cover the Docker builder
with both `--label` and `--target` options.

Signed-off-by: Dennis Chen <dennis.chen@arm.com>
2018-05-17 09:41:06 +08:00
Anda Xu
e440831802 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>
2018-05-15 16:05:04 -07:00
Vincent Demeester
25494e4c74
Fix logging test type
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-05-15 15:04:46 +02:00
Sebastiaan van Stijn
6821ffd1a1
Merge pull request #37028 from cpuguy83/log_plugin_broken_pipe
Fix logging plugin crash unrecoverable
2018-05-15 13:57:01 +02:00
Vincent Demeester
829dcefa9d
Merge pull request #37044 from yongtang/03112018-TestDockerNetworkConnectAlias-name
Avoid unique name usage in TestDockerNetworkConnectAlias
2018-05-15 11:46:11 +02:00
Vincent Demeester
bcd86fc2ac
Merge pull request #37060 from cpuguy83/fix_swagger_gen
Fix swagger volume type generation
2018-05-15 11:46:02 +02:00
Yong Tang
6de3be1366
Merge pull request #37030 from adshmh/refactor-service-create-integration-tests-use-swarm-create-service
Refactor service create integration tests to use swarm CreateService
2018-05-14 14:07:22 -07:00
Brian Goff
e7479e3ab8 Fix logging plugin crash unrecoverable
In cases where a logging plugin has crashed when the daemon tries to
copy the container stdio to the logging plugin it returns a broken pipe
error and any log entries that occurr while the plugin is down are lost.

Fix this by opening read+write in the daemon so logs are not lost while
the plugin is down.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2018-05-14 16:51:56 -04:00
Brian Goff
b16b125bb4 Fix swagger volume type generation
This was broken by bf6a790f00

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2018-05-14 13:46:20 -04:00
Yong Tang
e7b5f4500d Avoid unique name usage in TestDockerNetworkConnectAlias
In TestDockerNetworkConnectAlias the network and container
names used are unique which are not preferred. This
fix address the issue by appending t.Name() so that
names are randomized.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-05-14 16:59:13 +00:00
Abhinandan Prativadi
a059d6f4f5 Fixing network inspect for swarm
Signed-off-by: Abhinandan Prativadi <abhi@docker.com>
2018-05-13 07:31:14 -07:00
Arash Deshmeh
e9a687146a refactor integration tests under integration/service/create_test.go to use swarm.CreateService
Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
2018-05-10 05:45:49 -04:00
Sebastiaan van Stijn
6d20814819
Merge pull request #36803 from adshmh/refactor-network-integration-tests-use-swarm-create-service
refactored network integration tests to make use of swarm.CreateService
2018-05-08 00:21:32 +02:00
Kir Kolyshkin
69b4fe4065 daemon.ContainerStop(): fix for a negative timeout
1. As daemon.ContainerStop() documentation says,

> If a negative number of seconds is given, ContainerStop
> will wait for a graceful termination.

but since commit cfdf84d5d0 (PR #32237) this is no longer the case.

This happens because `context.WithTimeout(ctx, timeout)` is implemented
as `WithDeadline(ctx, time.Now().Add(timeout))`, resulting in a deadline
which is in the past.

To fix, don't use WithDeadline() if the timeout is negative.

2. Add a test case to validate the correct behavior and
as a means to prevent a similar regression in the future.

3. Fix/improve daemon.ContainerStop() and client.ContainerStop()
description for clarity and completeness.

4. Fix/improve DefaultStopTimeout description.

Fixes: cfdf84d5d0 ("Update Container Wait")
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2018-05-03 10:04:33 -07:00
Brian Goff
82d9185470
Merge pull request #36396 from selansen/master
Allow user to specify default address pools for docker networks
2018-05-03 06:34:14 -04:00
Alessandro Boch
173b3c364e Allow user to control the default address pools
- Via daemon flag --default-address-pools base=<CIDR>,size=<int>

Signed-off-by: Elango Siva  <elango@docker.com>
2018-04-30 11:14:08 -04:00
Tibor Vass
765a9f31ad
Merge pull request #36944 from vdemeester/fix-e2e-run
Skip some test on remote daemon for e2e run(s)
2018-04-27 05:03:12 -10:00
Vincent Demeester
ef2c2040c2 Skip some test on remote daemon for e2e run(s)
We really need to run those on the CI too at some point.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Signed-off-by: Tibor Vass <tibor@docker.com>
2018-04-26 16:25:52 +00:00
Sebastiaan van Stijn
18bfe3c128
Merge pull request #36924 from runcom/fix-created-rp
restartmanager: do not apply restart policy on created containers
2018-04-25 21:48:01 +02:00
Antonio Murdaca
75d3214934
restartmanager: do not apply restart policy on created containers
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2018-04-24 11:41:09 +02:00
Kir Kolyshkin
7d62e40f7e 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>
2018-04-23 13:52:44 -07:00
Yong Tang
67535921b3 Some improvement in restart_test.go
This fix consists of some improvement in restart_test.go
by replacing Fatal with assert, so that they are consistent
with other tests in integration/container.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-04-21 19:42:20 +00:00
Arash Deshmeh
8e335e00bb refactored network integration tests to make use of swarm.CreateService
Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
2018-04-21 09:07:57 -04:00
Vincent Demeester
cb8db44395
Make testing helpers as such…
That way, those lines won't be reported in the failure.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-04-20 10:38:43 +02:00
Vincent Demeester
69bab3832c
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>
2018-04-19 11:57:28 +02:00
Vincent Demeester
aa0db6f9e1
Migrate TestAPISwarmServicesPlugin to integration
Also starts to create more "poll/check" function to `internal/test/daemon`.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-04-18 16:18:53 +02:00
Vincent Demeester
42f6fdf059
Move integration-cli/request to internal/test/request…
… and change a bit the method signature

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-04-17 16:25:59 +02:00
Vincent Demeester
062564084a
Move fakecontext, fakegit and fakestorage to internal/test
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-04-17 09:53:09 +02:00
Anusha Ragunathan
abb1661907
Merge pull request #36841 from yongtang/02222018-tag-test
Migrate image tag tests from integration-cli to api tests
2018-04-16 17:53:48 -07:00
Anusha Ragunathan
f9c4e63026
Merge pull request #36838 from vdemeester/integration-fixtures-refactoring
Clean some integration-cli/fixtures package/files
2018-04-16 17:49:29 -07:00
Vincent Demeester
5f56503f58
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>
2018-04-16 10:48:58 +02:00
Vincent Demeester
239a8a5189
Small daemon refactoring and add swarm init/join helpers
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-04-16 10:20:10 +02:00
Yong Tang
ab9bb47b05 Some enhancement in integration tests
This fix converts some `client.ContainerCreate` to `container.Create`,
and removes some unneeded `name` fields when test containers are created.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-04-14 16:52:02 +00:00
Yong Tang
9bcb960508 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>
2018-04-13 14:46:40 +00:00
Brian Goff
76e47a08c5
Merge pull request #36595 from runcom/oom-docker-cp-authz
copy: avoid using all system memory with authz plugins
2018-04-12 13:42:56 -04:00
Sebastiaan van Stijn
6f4bf5629c
Merge pull request #36722 from vdemeester/network-ipvlan-test-migration
Migrate test-integration-cli experimental ipvlan test to integration
2018-04-11 14:51:25 -07:00
Brian Goff
74f8e47352 Limit authz response buffer
When the authz response buffer limit is hit, perform a flush.
This prevents excessive buffer sizes, especially on large responses
(e.g. `/containers/<id>/archive` or `/containers/<id>/export`).

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2018-04-11 15:36:36 -04:00
Sebastiaan van Stijn
ce3c2e2331
Merge pull request #36826 from vdemeester/integration-daemon-swarm-refactoring
Make internal/test/daemon.Daemon swarm aware
2018-04-11 09:33:58 -07:00
Vincent Demeester
83d18cf4e3
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>
2018-04-11 12:10:17 +02:00
Vincent Demeester
a3323d2e43
Move ipvlan and macvlan tests on their own folder…
… making each folder/suites quicker to run

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-04-11 11:14:58 +02:00
Vincent Demeester
0ab6116ce8
Refactor macvlan tests a bit
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-04-11 11:14:54 +02:00
Vincent Demeester
24f9347511
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>
2018-04-11 11:14:47 +02:00
Michael Crosby
4c000662fe Don't make container mount unbindable
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2018-04-10 15:14:34 -04:00
Sebastiaan van Stijn
68dd184c7c
Merge pull request #36824 from vdemeester/integration-daemon-refactoring
Move integration-cli daemon package to internal/test…
2018-04-10 10:06:09 -07:00
Vincent Demeester
f0d277fe84
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>
2018-04-10 16:29:48 +02:00
Vincent Demeester
cbde00b442
Merge pull request #36746 from vdemeester/experimental-build-tests
Migrate test-integration-cli experimental build tests to integration
2018-04-09 10:21:03 +02:00
Arash Deshmeh
69481edc07 integration tests under integration/config use unique names when creating resources
Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
2018-04-06 06:06:02 -04:00
Sebastiaan van Stijn
27749659d5
Bump SwarmKit to 831df679a0b8a21b4dccd5791667d030642de7ff
Changes included:

- Ingress network should not be attachable
- [manager/state] Add fernet as an option for raft encryption
- Log GRPC server errors
- Log leadership changes at manager level
- [state/raft] Increase raft ElectionTick to 10xHeartbeatTick
- Remove the containerd executor
- agent: backoff session when no remotes are available
- [ca/manager] Remove root CA key encryption support entirely
- Fix agent logging race (fixes https://github.com/docker/swarmkit/issues/2576)
- Adding logic to restore networks in order

Also adds github.com/fernet/fernet-go as a new dependency

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-02 15:17:38 -07:00
Vincent Demeester
635f359f8b
Merge pull request #36706 from arm64b/add-defult-timeout-config-func
Add default pollSettings config functions
2018-03-30 19:31:06 +02:00
Vincent Demeester
183076e89d
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>
2018-03-30 13:10:02 +02:00
Vincent Demeester
e55d6fc857 Skip some tests in certain condition to run with e2e image
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-03-29 09:10:39 +02:00
Dennis Chen
b8912feeff Using the default PollSettings function
Using the default PollSettings functions to adjust the timeout
value instead of changing the value each time when needed.

Signed-off-by: Dennis Chen <dennis.chen@arm.com>
2018-03-29 05:00:14 +00:00
Dennis Chen
ee6959addc Add default pollSettings adjustment routines
Add the default function per resource to override the `pollSettings`
which will be re-used where it's needed.

Signed-off-by: Dennis Chen <dennis.chen@arm.com>
2018-03-29 04:47:14 +00:00
Anusha Ragunathan
18d1688530
Merge pull request #36711 from cpuguy83/plugin_mounts_sorting
Don't sort plugin mounts slice
2018-03-28 11:57:38 -07:00
Brian Goff
ec90839ca3 Don't sort plugin mounts slice
This was added as part of a53930a04f 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>
2018-03-28 09:10:43 -04:00
Vincent Demeester
ef5bc60326
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>
2018-03-28 10:47:11 +02:00
Catalin Pirvu
90b514922b Use unique names for container/rename_test.go
Signed-off-by: Catalin Pirvu <pirvu.catalin94@gmail.com>
2018-03-25 21:16:32 +03:00
Akihiro Suda
57c504799d
Merge pull request #36662 from adshmh/use-unique-resource-names-for-container-inspect-ps-stop-integration-tests
Use unique names for test resources of container/inspect, container/ps, container/stop tests
2018-03-23 12:16:53 +09:00
Sebastiaan van Stijn
00c59ed77e
Merge pull request #36647 from adshmh/use-unique-names-for-container-nat-test-containers
use unique names for test containers of container/nat integration tests
2018-03-22 14:03:36 +01:00
Sebastiaan van Stijn
e2bede01e4
Merge pull request #36172 from kolyshkin/systemd-memlimit
Test for systemd cgroupdriver memory setting
2018-03-22 13:36:43 +01:00
Arash Deshmeh
78e4be9133 use unique names for resources used by integration tests container/inspect_test, container/ps_test, container/stop_test
Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
2018-03-21 17:47:49 -04:00
selansen
dabffd806c Fix for Flaky test TestServiceWithPredefinedNetwork
TestServiceWithPredefinedNetwork test case was failing
	at times. To fix the issue, added new API to check
	for services after we clean up all services. Tested
	multiple times and this sould fix flaky issue.

Signed-off-by: selansen <elango.siva@docker.com>
2018-03-21 11:49:23 -04:00
Vincent Demeester
4460472f4e
Merge pull request #36594 from vdemeester/e2e-more-run
integration/*: make e2e run without failure
2018-03-21 08:54:39 +01:00
Arash Deshmeh
b4d1547af6 container/nat integration tests use unique names for test containers
Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
2018-03-20 17:11:03 -04:00
Kir Kolyshkin
4ca5c53610 Test for systemd cgroupdriver memory setting
This is a test case for issue https://github.com/moby/moby/issues/35123,
making sure we can set container's memory limit when using
`native.cgroupdriver=systemd`.

[v2: skip if no systemd present]
[v3: add --iptables=false to avoid flaky tests with t.Parallel()]
[v4: rebase after PR#36507 merge]

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2018-03-19 10:33:03 -07:00
Arash Deshmeh
a0052b8f19 Add the missing call to setupTest to TestNetworkLoopbackNat test function, to avoid leaving behind test containers
Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
2018-03-19 10:56:13 -04:00
Vincent Demeester
6016e79d25
integration/*: make e2e run without failure
… mainly by skipping if daemon is remote.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-03-19 09:47:17 +01:00
Daniel Nephin
c9e52bd0da Post migration assertion fixes
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2018-03-16 11:03:46 -04:00
Daniel Nephin
6be0f70983 Automated migration using
gty-migrate-from-testify --ignore-build-tags

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2018-03-16 11:03:43 -04:00
Vincent Demeester
823de22db6
Merge pull request #36606 from kolyshkin/t-36561
integration/TestExportContainerAfterDaemonRestart: add
2018-03-16 12:07:46 +01:00
Kir Kolyshkin
6e7141c7a2 integration/TestExportContainerAfterDaemonRestart: add
This test case checks that a container created before start
of the currently running dockerd can be exported (as reported
in #36561). To satisfy this condition, either a pre-existing
container is required, or a daemon restart after container
creation.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2018-03-15 00:30:11 -07:00
Brian Goff
834d0e262a Add some tests to the volume store
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2018-03-14 17:17:44 -04:00
Sebastiaan van Stijn
514fb6cf85
Merge pull request #36538 from ctelfer/ingress-fix
Fix automatic removal of ingress sandbox when last service leaves
2018-03-13 20:56:03 +01:00
Sebastiaan van Stijn
fb95dc7eac
Merge pull request #36569 from kolyshkin/t-etc-hosts
TestLinksEtcHostsContentMatch: use container.Exec()
2018-03-13 15:12:59 +01:00
Kir Kolyshkin
ad2f88d8cc TestLinksEtcHostsContentMatch: use container.Exec()
I am not quite sure why but this test is sometimes failing like this:

> 15:21:41 --- FAIL: TestLinksEtcHostsContentMatch (0.53s)
> 15:21:41 	assertions.go:226:
>
> 	Error Trace:	links_linux_test.go:46
> 15:21:41
> 	Error:      	Not equal:
> 15:21:41
> 	            	expected: "127.0.0.1\tlocalhost\n::1\tlocalhost
> ip6-localhost
> ip6-loopback\nfe00::0\tip6-localnet\nff00::0\tip6-mcastprefix\nff02::1\tip6-allnodes\nff02::2\tip6-allrouters\n172.17.0.2\tf53feb6df161\n"
> 15:21:41
> 	            	received: ""

To eliminate some possible failures (like ignoring stderr from `cat` or
its exit code), let's use container.Exec() to read a file from a container.

Fixes: e6bd20edcb ("Migrate some integration-cli test to api tests")
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2018-03-12 18:15:16 -07:00
Kir Kolyshkin
c125e10a04 integration/TestContainerShmNoLeak: use --iptables=false
As mentioned in commit 9e31938, test cases that use t.Parallel()
and start a docker daemon might step on each other toes as they
try to configure iptables during startup, resulting in flaky tests.

To avoid this, --iptables=false should be used while starting daemon.

Fixes: eaa5192856 ("Make container resource mounts unbindable")
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2018-03-12 14:49:15 -07:00
Chris Telfer
805b6a7f74 Add test for ingress removal on service removal
The commit https://github.com/moby/moby/pull/35422 had the result of
accidentally causing the removal of the ingress network when the
last member of a service left the network.  This did not appear
in swarm instances because the swarm manager would still maintain
and return cluster state about the network even though it had
removed its sandbox and endpoint.  This test verifies that after a
service gets added and removed that the ingress sandbox remains
in a functional state.

Signed-off-by: Chris Telfer <ctelfer@docker.com>
2018-03-12 15:19:02 -04:00
Daniel Nephin
038f3add51 Remove unnecessary diff tests
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2018-03-09 12:32:50 -05:00
Sebastiaan van Stijn
0b0af855ae
Merge pull request #36316 from selansen/36247
Fix to address regression caused by PR 30897
2018-03-06 13:40:29 +01:00
Vincent Demeester
2f7a76a6a0
Merge pull request #36444 from yongtang/02142018-events-tests
Migrate events tests to api tests
2018-03-06 08:36:30 +01:00
Yong Tang
e02fa4a679
Merge pull request #36490 from yongtang/03052018-expected-actual
Address `expected` vs `actual` in integration tests
2018-03-05 19:40:53 -08:00
selansen
7cf8b20762 Fix to address regression caused by PR 30897
With the inclusion of PR 30897, creating service for host network
    fails in 18.02. Modified IsPreDefinedNetwork check and return
    NetworkNameError instead of errdefs.Forbidden to address this issue

Signed-off-by: selansen <elango.siva@docker.com>
2018-03-05 19:10:39 -05:00
Yong Tang
8a854e933b Address expected vs actual in integration tests
This fix addresses `expected` vs `actual` in integration tests
so that they match `assert.Equal(t, expected, actual)`

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-03-05 20:39:42 +00:00
Yong Tang
ed58ba99fb 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>
2018-03-05 20:35:14 +00:00
Yong Tang
4b2fb7e394
Merge pull request #36468 from vdemeester/e2e-container-run
Fixes some integration/container tests to run on remote daemon
2018-03-05 12:23:24 -08:00
Vincent Demeester
3af9b1d395
Merge pull request #36471 from yongtang/03022018-improvement
Improvement in integration tests
2018-03-05 17:54:09 +01:00
Yong Tang
3a749157d2 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>
2018-03-05 16:13:48 +00:00
Vincent Demeester
18dd1d9aba
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>
2018-03-05 14:24:01 +01:00
Sebastiaan van Stijn
e3814ece21
Merge pull request #36476 from yongtang/03022018-kill_test
Remove unnecessary container.WithName in kill test
2018-03-05 11:42:30 +01:00
Akihiro Suda
e734e8f515
Merge pull request #36459 from yongtang/02282018-export-test
Migrate export tests to api tests
2018-03-03 12:29:53 +09:00
Yong Tang
1778719d6a Remove unnecessary container.WithName in kill test
This fix removes several unnecessary `container.WithName`
usage in docker kill integration test.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-03-03 01:06:49 +00:00
Yong Tang
6ab465804b Improvement in integration tests
This fix adds several improvement:
1. No need for explicit ContainerRemove as it has been handled in setupTest()
2. Added `container.WithImage` helper function and used it in commit tests.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-03-02 19:03:59 +00:00
Yong Tang
4e702cf70d 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>
2018-03-02 00:44:03 +00:00
Yong Tang
9045406144 Add missing canonical import comment to files in integration tests
The  canonical import comment was added some time ago, though several
newly added files do not have the comment. This fix adds the missing
canonical import comment to files in integration tests

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-03-01 22:51:11 +00:00
Sebastiaan van Stijn
7459e4cd4f
Merge pull request #36455 from thaJeztah/flip-asserts
Fix "expected" and "actual" being reversed
2018-03-01 21:31:46 +01:00
Sebastiaan van Stijn
a2517cbf62
Fix "expected" and "actual" being reversed
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-03-01 14:16:19 +01:00
Yong Tang
6ad4720c78 Enhancement of replacing ContainerCreate with helper funcs in tests
This fix is a minor enhancement to replace several ContainerCreate with
helper funcs of `container.Create` in tests.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-02-28 21:35:56 +00:00
Sebastiaan van Stijn
75377ec12c
Merge pull request #36434 from dnephin/fix-cp-cli-tests
Migrate some container copy tests to integration
2018-02-28 12:28:18 +01:00
Sebastiaan van Stijn
973cf656dd
Merge pull request #36430 from yongtang/02262018-config-test
Migrate config inspect test to api test
2018-02-28 11:50:52 +01:00
Yong Tang
4b99d78207 Migrate config inspect test to api test
This fix migrates config inspect test in integration-cli
to api test.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-02-27 23:25:07 +00:00
Daniel Nephin
00d409f03e Migrate some copy tests to integration
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2018-02-27 16:48:35 -05:00
Yong Tang
6bd4f4801b Migrate several docker rm tests to api tests
This fix migrates several docker rm tests to api tests

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-02-27 19:20:01 +00:00
Vincent Demeester
407e122ac3
Merge pull request #36292 from yongtang/0212-2018-volumes-tests
Migrate volumes tests in integration-cli to api tests
2018-02-27 13:06:06 +01:00
Vincent Demeester
2c24bfd070
Merge pull request #36406 from yongtang/02222018-secret-create-with-labels
Migrate some config secret tests to api test
2018-02-27 10:01:39 +01:00
Yong Tang
d896f87c05 Migrate volumes tests in integration-cli to api tests
This fix migrates volumes tests in integration-cli to api tests
in integration/

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-02-27 05:18:31 +00:00
Vincent Demeester
600475715e
Merge pull request #36338 from tonistiigi/fix-copy-leak
builder: fix layer lifecycle leak
2018-02-26 22:36:40 +01:00