Commit graph

950 commits

Author SHA1 Message Date
Sebastiaan van Stijn
bba833928c
Merge pull request #38487 from LinuxMercedes/error-on-empty-dockerfile
Error on empty dockerfile
2019-01-15 21:41:12 +01:00
Vincent Demeester
cd60e8a752
Merge pull request #38547 from yongtang/waitAndAssert
Replace waitAndAssert in config_test.go with poll.WaitOn
2019-01-15 15:27:19 +01:00
Sebastiaan van Stijn
e21f50cbf0
Merge pull request #38572 from yongtang/assert.NilError
Replace t.Fatal(err) with assert.NilError(t, err)
2019-01-15 15:16:57 +01:00
Vincent Demeester
b5be9f63eb
Merge pull request #38567 from thaJeztah/use_the_skip
TestCgroupDriverSystemdMemoryLimit: use skip.If()
2019-01-15 09:10:57 +01:00
Vincent Demeester
38015177d8
Merge pull request #38557 from thaJeztah/remove_duplicated_code
Integration tests: remove some duplicated code, and preserve context
2019-01-15 09:03:45 +01:00
Yong Tang
52475f8dd5 Replace t.Fatal(err) with assert.NilError(t, err)
So that they are consistent with integration tests style

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2019-01-15 04:58:30 +00:00
Yong Tang
68e266ee3a Replace waitAndAssert in config_test.go with poll.WaitOn
This fix replaces waitAndAssert in config_test.go with poll.WaitOn
so that the testing is consistent with all other tests in integration.

Also, config_test.go uses to wait and sleep for 2 * (1 minutes) to get the task
info. This fix combined those two sleep and wait for 1 mins. Think 1 min
is enough for config test.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2019-01-15 03:54:52 +00:00
linuxmercedes
18c7e8b927 Test: dockerfiles with no instructions are detected
Signed-off-by: Natasha Jarus <linuxmercedes@gmail.com>
2019-01-14 20:01:00 -06:00
Akihiro Suda
8472e04f79
Merge pull request #38555 from yongtang/assert.NilError
Replace t.Fatal(err) with assert.NilError(err)
2019-01-15 10:51:42 +09:00
Sebastiaan van Stijn
5f788fbf56
Add Cache-Control headers to disable caching /_ping endpoint
The result of this endpoint should not be cached, so it's better to
explicitly disable caching.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-01-14 22:03:23 +01:00
Sebastiaan van Stijn
c11be31710
TestCgroupDriverSystemdMemoryLimit: use skip.If()
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-01-14 17:11:36 +01:00
Brian Goff
beef00cb26
Merge pull request #38558 from thaJeztah/pass_client_instead_of_daemon
GetRunningTasks: pass client instead of daemon
2019-01-14 03:50:15 -08:00
Sebastiaan van Stijn
a3f626d101
Merge pull request #38543 from thaJeztah/save_the_environment
Fix: plugin-tests discarding current environment
2019-01-14 10:36:11 +01:00
Sebastiaan van Stijn
56a68c15f8
Integration tests: remove some duplicated code, and preserve context
This introduces `NoTasksForService` and `NoTasks` poller checks, that
can be used to check if no tasks are left in general, or for a specific
service.

Some redundant checks were also removed from some tests.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-01-14 04:53:27 +01:00
Sebastiaan van Stijn
60d93aab2e
Refactor TestInspectNetwork
Clean up and refactor this test;

- make `serviceRunningTasksCount` to use a `desired-state` filter
- use subtests, and inline the `validNetworkVerbose` checks; also use
  asserts for the individual checks, so that any failure will log exactly
  what failed
- remove helper functions that are no longer needed

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-01-14 04:30:17 +01:00
Sebastiaan van Stijn
8172edf04c
GetRunningTasks: pass client instead of daemon
Tests generally already have a client instance, so it
probably makes more sense to just pass it, and make
this utility a bit more flexible to use.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-01-14 02:30:40 +01:00
Yong Tang
32f6aeee8a Replace t.Fatal(err) with assert.NilError(err)
so that they are consistent with other places

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2019-01-13 21:36:25 +00:00
Yong Tang
28b7824caa Remove code duplication and consolidate networkIsRemoved
This fix removes code duplication and consolidates networkIsRemoved
into one place.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2019-01-12 23:01:21 +00:00
Sebastiaan van Stijn
b84bff7f8a
Fix: plugin-tests discarding current environment
By default, exec uses the environment of the current process, however,
if `exec.Env` is not `nil`, the environment is discarded:

e73f489494/src/os/exec/exec.go (L57-L60)

> If Env is nil, the new process uses the current process's environment.

When adding a new environment variable, prepend the current environment,
to make sure it is not discarded.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-01-12 13:06:25 +01:00
Sebastiaan van Stijn
2a5405bedd
Run volume-tests again remote daemons as well
These tests should not require a local daemon; they may fail if
the local and remote system's clocks are out of sync with more
than a minute though, but that's something we should prevent from
happening :-)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-01-10 10:18:22 +01:00
Sebastiaan van Stijn
3f2ecb5452
Merge pull request #38515 from yongtang/01082019-oll.WaitOn
Use poll.WaitOn in authz_plugin_test.go
2019-01-09 16:10:52 +01:00
Sebastiaan van Stijn
156b2abd0c
Merge pull request #38472 from thaJeztah/remove_debugging_code
TestBuildMultiStageParentConfig: remove unneeded sleep and ImageList call
2019-01-09 08:41:01 +01:00
Brian Goff
9dd43415ae
Merge pull request #38499 from olljanat/change_serviceIsUpdated2
Fix flaky test TestServiceUpdateSecrets
2019-01-08 20:46:28 -08:00
Yong Tang
0492b0997b Use poll.WaitOn in authz_plugin_test.go
This fix uses poll.WaitOn to replace customerized
implementation in authz_plugin_test.go

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2019-01-09 03:08:47 +00:00
Olli Janatuinen
b868ada474 integration: Corrected service update tests logic
Tests which will re-deploy containers uses function serviceIsUpdated() to
make sure that service update really reached state UpdateStateCompleted.

Tests which will not re-deploy container uses function
serviceSpecIsUpdated to make sure that service version is increased.

Signed-off-by: Olli Janatuinen <olli.janatuinen@gmail.com>
2019-01-08 20:01:29 +02:00
Sebastiaan van Stijn
263e28a830
Fix some minor wording / issues
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-01-07 13:57:01 +01:00
Sebastiaan van Stijn
69c0b7e476
Simplify skip checks
These tests are run on a local Linux daemon only, so no need
to do a platform-check.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-01-07 13:56:57 +01:00
Sebastiaan van Stijn
84224935ea
Only build IPCmode tests on Linux
These tests can only be run on a local Linux daemon, so there's
no need to build them on Windows

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-01-07 13:56:52 +01:00
Sebastiaan van Stijn
a3948d17d3
Improve consistency in "skip"
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-01-07 13:56:46 +01:00
Yong Tang
545d00e752
Merge pull request #38416 from thaJeztah/fix_build_session_test
Fix TestBuildWithSession, TestBuildSquashParent using wrong daemon during test
2019-01-06 14:29:15 -08:00
Akihiro Suda
f5238762a8
Merge pull request #38480 from thaJeztah/run_slow_test_parallel
Run TestImportExtremelyLargeImageWorks in parallel
2019-01-07 00:37:47 +09:00
Sebastiaan van Stijn
8edcd4c3cd integration: wait for service update to be completed
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-01-05 15:07:12 +02:00
Sebastiaan van Stijn
2ee53a42db
Merge pull request #38490 from kolyshkin/test-rename-anon-ct
TestRenameAnonymousContainer: fix error msg
2019-01-05 12:50:16 +01:00
Sebastiaan van Stijn
55b5b8de79
Merge pull request #38486 from thaJeztah/dont_use_deprecated_envclient
Remove use of deprecated client.NewEnvClient()
2019-01-05 11:23:19 +01:00
Yong Tang
b958b430aa
Merge pull request #38417 from thaJeztah/replace_newclient
Test: Replace NewClient() with NewClientT()
2019-01-04 23:37:00 -08:00
Sebastiaan van Stijn
ae3ca7bb97
Run TestImportExtremelyLargeImageWorks in parallel
This is a slow test, taking over two minutes to complete,
so spin up a new daemon for this test and run it in parallel

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-01-04 01:51:52 +01:00
Kir Kolyshkin
2ca6896aee TestRenameAnonymousContainer: fix error msg
A recent CI run shows a (seemingly random) failure from this test:

> 00:14:37.289 --- FAIL: TestRenameAnonymousContainer (1.75s)
> 00:14:37.289 rename_test.go:169: assertion failed: 0 (int) != 1 (inspect.State.ExitCode int): container baac251d5a1cb2221ffedf6f10acbad166b90e3549601e96d908e76762675a81 exited with the wrong exitcode: {ContainerJSONBase:0xc0007a4840 Mounts:[] Config:0xc000714500 NetworkSettings:0xc000235b00}

Apparently, printing the whole `inspect` value does not make any sense.
Let's output `inspect.State.Error` instead, maybe it will help to
figure out what is going on here.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2019-01-03 14:01:17 -08:00
Sebastiaan van Stijn
c8ff5ecc09
Remove use of deprecated client.NewEnvClient()
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-01-03 22:49:00 +01:00
Sebastiaan van Stijn
0de62d9bbc
Integration: use testenv.APIClient()
A client is already created in testenv.New(), so we can just
as well use that one, instead of creating a new client.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-01-03 11:53:41 +01:00
Sebastiaan van Stijn
4d88a95d67
Don't mix t.Parallel() wth environment.ProtectAll()
`testEnv` is a package-level variable, so protecting / restoring
`testEnv` in parallel will result in "concurrent map write" errors.

This patch removes `t.Parallel()` from tests that use this
functionality (through `defer setupTest(t)()`).

Note that _subtests_ can still be run in parallel, as the defer
will be called after all subtests have completed.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-01-03 11:53:31 +01:00
Vincent Demeester
3f7898cfcd
Merge pull request #38451 from thaJeztah/skip_test_info_warnings
Skip TestInfoAPIWarnings on remote daemons
2019-01-03 11:00:53 +01:00
Sebastiaan van Stijn
f9fedf1308
TestBuildMultiStageParentConfig: remove unneeded sleep and ImageList call
The `time.Sleep()` and `apiclient.ImageList()` were added in d3cc071bb9,
but appear to be debugging-code and not needed for the test.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-01-02 13:50:09 +01:00
Akihiro Suda
27234ffe3e
Merge pull request #37564 from adshmh/migrate-docker_cli_service_update_test-to-integration-service-fixed-flake
migrate service update integration tests from integration-cli to integration/service package
2019-01-01 04:12:10 +09:00
Sebastiaan van Stijn
056840c2a6
Skip TestInfoAPIWarnings on remote daemons
This test starts a new daemon, which will fail when testing
against a remote daemon;

    --- FAIL: TestInfoAPIWarnings (0.00s)
        info_test.go:53: failed to start daemon with arguments [-H=0.0.0.0:23756 -H=unix:///tmp/docker-integration/d5153ebcf89ef.sock] : [d5153ebcf89ef] could not find docker binary in $PATH: exec: "dockerd": executable file not found in $PATH

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-12-29 20:46:33 +01:00
Sebastiaan van Stijn
53bb992c3b
Merge pull request #38445 from thaJeztah/dont_use_deprecated_withdialer
Replace deprecated client.WithDialer()
2018-12-29 10:47:22 +01:00
Sebastiaan van Stijn
8d3feccfa9
Replace deprecated client.WithDialer()
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-12-28 16:10:32 +01:00
Arash Deshmeh
be151a73f0
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>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-12-24 20:28:00 +01:00
Sebastiaan van Stijn
9a3911ced8
Fix TestBuildWithSession, TestBuildSquashParent using wrong daemon during test
These tests were spinning up a new daemon, but after the daemon was spun up,
the default test-daemon was used by the client.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-12-24 13:03:54 +01:00
Olli Janatuinen
153171e9dd Added support for maximum replicas per node to services
Signed-off-by: Olli Janatuinen <olli.janatuinen@gmail.com>
2018-12-24 02:04:15 +02:00
Sebastiaan van Stijn
2cb7b73a1b
Test: Replace NewClient() with NewClientT()
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-12-22 15:53:02 +01:00
Brian Goff
3e44f58966
Merge pull request #38142 from thaJeztah/fix_api_return_code
API: Add test for status code on conflicting service names
2018-12-10 15:40:42 -08:00
Aleksa Sarai
f38ac72bca
oci: add integration tests for kernel.domainname configuration
This also includes a few refactors of oci_linux_test.go.

Signed-off-by: Aleksa Sarai <asarai@suse.de>
2018-11-30 19:44:50 +11:00
Yong Tang
ee74cd777a Skip KernelMemoryTCP if version is less than 1.40
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-11-26 21:04:27 +00:00
Yong Tang
f023816608 Add memory.kernelTCP support for linux
This fix tries to address the issue raised in 37038 where
there were no memory.kernelTCP support for linux.

This fix add MemoryKernelTCP to HostConfig, and pass
the config to runtime-spec.

Additional test case has been added.

This fix fixes 37038.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-11-26 21:03:08 +00:00
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