Commit graph

35958 commits

Author SHA1 Message Date
Tonis Tiigi
21cce932b0
builder: add workaround for gcr auth issue
GCR does not currently support 401 response from blob endpoints.
This detects the case where no manifest requests have been
performed for the current resolver and does a dummy request
to enable authorization.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit bcd8298c35)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-05-07 15:38:48 -07:00
Andrew Hsu
d2cfbce3f3
Merge pull request #201 from andrewhsu/ln
[18.09] bump libnetwork 872f0a8
2019-04-23 13:17:26 -07:00
Sebastiaan van Stijn
5354408039 bump libnetwork 872f0a83c98add6cae255c8859e29532febc0039 (18.09 branch)
full diff: c9029898e3...872f0a83c9

- docker/libnetwork#2354 [18.09 backport] Cleanup the cluster provider when the agent is closed
  - backport of docker/libnetwork#2307 Fix for problem where agent is stopped and does not restart
  - fixes docker/for-linux#495 Docker swarm overlay networking not working after --force-new-cluster
- docker/libnetwork#2369 [18.09 BACKPORT] Pick a random host port if the user does not specify a host port
  - backport of docker/libnetwork#2368 (windows) Pick a random host port if the user does not specify a host port

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-04-23 16:51:31 +00:00
Andrew Hsu
82a2b8882e
Merge pull request #198 from thaJeztah/18.09_backport_test_updates
[18.09 backport] test-fixes and updates, and fix images filter when use multi reference filter
2019-04-23 09:49:55 -07:00
Sebastiaan van Stijn
e2352b11c7
Merge pull request #191 from thaJeztah/18.09_backport_windows_ci_fixes
[18.09 backport] windows.ps1 fixes
2019-04-22 00:28:49 +02:00
Stefan Scherer
04d0295c0c
Use current windows servercore image
Signed-off-by: Stefan Scherer <stefan.scherer@docker.com>
(cherry picked from commit aad7e9797b)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-04-18 18:06:44 +02:00
Stefan Scherer
e4bc7d2fc0
Improve 'no matching manifest' error
Signed-off-by: Stefan Scherer <scherer_stefan@icloud.com>
(cherry picked from commit 4b9db209fe)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 6099336ae61ca43cafe9420f3188c796cb0812bc)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-04-18 18:05:04 +02:00
Sebastiaan van Stijn
7e65b6978b
Migrate some remaining Manifest V1 tests
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-04-18 00:26:43 +02:00
Sebastiaan van Stijn
9a4d7bb0e2
Replace some checkers and assertions with gotest.tools
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 6345208b9b)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-04-17 23:10:05 +02:00
Sebastiaan van Stijn
8fcca0be3f
Remove some checkers to discourage usage
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 86f2ac4a6b)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-04-17 23:09:59 +02:00
16yuki0702
45dd95610a
Fix typo
Signed-off-by: Hiroyuki Sasagawa <hs19870702@gmail.com>
(cherry picked from commit a28843150a)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-04-17 23:09:57 +02:00
Kir Kolyshkin
b60ecd32a1
TestSwarmContainerEndpointOptions: fix debug
In case of failure, stale out was printed.

Fixes: 6212ea669b

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit 1921753b4b)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-04-17 23:09:54 +02:00
Kir Kolyshkin
b228a498d5
TestDaemonRestartIpcMode: modernize
Move the test case from integration-cli to integration.

The test logic itself has not changed, except these
two things:

* the new test sets default-ipc-mode via command line
  rather than via daemon.json (less code);
* the new test uses current API version.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit 9fd765f07c)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-04-17 23:09:51 +02:00
Kir Kolyshkin
2c546aace4
integration: add/use WithRestartPolicy
NOTE TestUpdateRestartPolicy is left as is as otherwise
it will decrease its readability.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit f664df01d1)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-04-17 23:09:48 +02:00
Kir Kolyshkin
ed48a92a58
integration/internal/container/ops: rm unused code
Since container.Create() already initializes HostConfig
to be non-nil, there is no need for this code. Remove it.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit 17022b3ad2)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-04-17 23:09:45 +02:00
Kir Kolyshkin
f982379928
TestUpdateRestartWithAutoRemove: use WithAutoRemove
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit 39eaf1ef97)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-04-17 23:09:43 +02:00
Sebastiaan van Stijn
26f7e0a8b0
Make TestEventsFilterLabels less flaky
This test sometimes failed because the number of events received did not
match the expected number:

    FAIL: docker_cli_events_test.go:316: DockerSuite.TestEventsFilterLabels

    docker_cli_events_test.go:334:
        c.Assert(len(events), checker.Equals, 3)
    ... obtained int = 2
    ... expected int = 3

This patch makes the test more stable, by:

- use a wider range between `--since` and `--until`. These options were set
  so that the client detaches after events were received, but the actual
  range should not matter. Changing the range will cause more events to be
  returned, but we're specifically looking for the container ID's, so this
  should not make a difference for the actual test.
- use `docker create` instead of `docker run` for the containers. the
  containers don't have to be running to trigger an event; using `create`
  speeds up the test.
- check the exit code of the `docker create` to verify the containers were
  succesfully created.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 0e15c02465)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-04-17 23:09:40 +02:00
Sebastiaan van Stijn
954425f8bd
reduce flakiness of TestSwarmLockUnlockCluster and TestSwarmJoinPromoteLocked
I noticed that this test failed, because the node was in status "pending".

The test checks for the node's status immediately after it was restarted, so
possibly it needs some time to unlock.

    14:07:10 FAIL: docker_cli_swarm_test.go:1128: DockerSwarmSuite.TestSwarmLockUnlockCluster
    ...
    14:07:10 docker_cli_swarm_test.go:1168:
    14:07:10     checkSwarmLockedToUnlocked(c, d)
    14:07:10 docker_cli_swarm_test.go:1017:
    14:07:10     c.Assert(getNodeStatus(c, d), checker.Equals, swarm.LocalNodeStateActive)
    14:07:10 ... obtained swarm.LocalNodeState = "pending"
    14:07:10 ... expected swarm.LocalNodeState = "active"

This patch adds a `waitAndAssert` for the node's status, with a 1 second timeout.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 973ca00d60)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-04-17 23:09:37 +02:00
Sebastiaan van Stijn
3304d91f1e
Remove SameHostDaemon, use testEnv.IsLocalDaemon instead
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 43b15e924f)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-04-17 23:09:35 +02:00
Sebastiaan van Stijn
008cc8ee49
Remove unused ExperimentalDaemon, NotS390X, NotPausable requirement checks
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 362f737e1c)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-04-17 23:09:32 +02:00
Kir Kolyshkin
553b09684c
integration-cli/Test*Swarm*: use same args on restart
When starting docker daemons for swarm testing, we disable iptables
and use lo for communication (in order to avoid network conflicts).

The problem is, these options are lost on restart, that can lead
to any sorts of network conflicts and thus connectivity issues
between swarm nodes.

Fix this. This does not fix issues with swarm test failures, but
it seems they appear are less often after this one.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit 2ed512c7fa)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-04-17 23:09:23 +02:00
Kir Kolyshkin
2b498de104
TestAPISwarmLeaderElection: add some debug
......

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit 06afc2d1e6)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-04-17 23:09:20 +02:00
Kir Kolyshkin
6ec991ec83
docker_cli_swarm_test: factor out common code
This is repeated 6 times in different tests, with slight
minor variations. Let's factor it out, for clarity.

While at it, simplify the code: instead of more complex
parsing of "docker swarm init|update --autolock" output (1)
and checking if the key is also present in
"docker swarm unlock-key" output (2), get the key
from (2) and check it is present in (1).

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit 24cbb98971)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-04-17 23:09:17 +02:00
Kir Kolyshkin
784a89354b
internal/test/daemon: don't leak timers
A timer is leaking on every daemon start and stop.
Probably nothing major, but given the amount of
daemon starts/stops during tests, it's better to
be accurate about it.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit 6016520162)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-04-17 23:09:14 +02:00
Kir Kolyshkin
2a02a2e9da
docker_cli_swarm_test.go: rm unused arg
Since commit 17173efbe0 checkSwarmLockedToUnlocked() no longer
require its third argument, so remove it.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit 66cb1222d6)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-04-17 23:09:12 +02:00
Kir Kolyshkin
90cb9b6545
integration-cli: fix netns test cleanup
1. Using MNT_FORCE flag does not make sense for nsfs. Using MNT_DETACH
though might help.

2. When -check.vv is added to TESTFLAGS, there are a lot of messages
like this one:

> unmount of /tmp/dxr/d847fd103a4ba/netns failed: invalid argument

and some like

> unmount of /tmp/dxr/dd245af642d94/netns failed: no such file or directory

The first one means directory is not a mount point, the second one
means it's gone. Do ignore both of these.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit 73baee2dcf)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-04-17 23:09:09 +02:00
Kir Kolyshkin
d52a18f352
TestStartReturnCorrectExitCode: show error
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit 0d59f4305c)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-04-17 23:09:06 +02:00
John Howard
533b0f602d
Windows: Go1.11: Use long path names in build context (TestBuildSymlinkBreakout)
Signed-off-by: John Howard <jhoward@microsoft.com>
(cherry picked from commit b1b9937bc7)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-04-17 23:09:04 +02:00
Kir Kolyshkin
17ae129697
integration-cli: fix TestAttachDetach, rm TestAttachDetachTruncatedID
It looks like the logic of the test became wrong after commit
ae0883c ("Move TestAttachDetach to integration-cli").

The original logic was:
* (a few first steps skipped for clarity)
* send escape sequence to "attach";
* check "attach" is exiting (i.e. escape sequence works);
* check the container is still alive;
* kill the container.

Also, timeouts were big at that time, in the order of seconds.

The logic after the above mentioned commit and until now is:
* ...
* send escape sequence to "attach";
* check the container is running (why shouldn't it?);
* kill the container;
* checks that the "attach" has exited.

So, from the "let's check detach using escape sequence is working"
the test became something like "let's check that attach is gone
once we kill the container".

Let's fix the above test, also increasing the timeout waiting
for attach to exit (which fails from time to time on power CI).

Now, the second test, TestAttachDetachTruncatedID, does the exact
same thing, except it uses a truncated container ID. It does not
seem to be of much value, so let's remove it.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit 9f3a343a51)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-04-17 23:09:01 +02:00
Brian Goff
1efe4720fe
Completely remove d.NewClient from testing tools
Favor `d.NewClientT` instead.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
(cherry picked from commit e063099f91)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-04-17 23:08:59 +02:00
Sebastiaan van Stijn
fd6a4681ee
Remove use of deprecated client.NewClient()
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 3a4bb96ab7)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-04-17 23:08:56 +02:00
Sebastiaan van Stijn
93de0314c7
Use assert.NilError() instead of assert.Assert()
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 3449b12cc7)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-04-17 23:08:54 +02:00
Sebastiaan van Stijn
092315055a
Add missing error-check in TestAPISwarmManagerRestore
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 2e326eba70)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-04-17 23:08:51 +02:00
Yong Tang
cdb40114b4
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>
(cherry picked from commit 0492b0997b)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-04-17 23:08:49 +02:00
Sebastiaan van Stijn
2c1307fc90
Replace deprecated client.WithDialer()
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 8d3feccfa9)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-04-17 23:08:46 +02:00
Sebastiaan van Stijn
8299d037ca
integration-cli: remove deprecated daemonHost() utility
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 3105ca26dc)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-04-17 23:08:44 +02:00
Sebastiaan van Stijn
8f6421457d
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>
(cherry picked from commit 56a68c15f8)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-04-17 23:08:41 +02:00
Sebastiaan van Stijn
046352162f
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>
(cherry picked from commit 60d93aab2e)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-04-17 23:08:39 +02:00
Yong Tang
dd20556e03
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>
(cherry picked from commit 28b7824caa)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-04-17 23:08:37 +02:00
Sebastiaan van Stijn
b9102e2a6b
Remove use of deprecated client.NewEnvClient()
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit c8ff5ecc09)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-04-17 23:08:34 +02:00
Sebastiaan van Stijn
0a234f6a71
Fix some minor wording / issues
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 263e28a830)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-04-17 23:08:32 +02:00
Sebastiaan van Stijn
bb6db57acc
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>
(cherry picked from commit 69c0b7e476)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-04-17 23:08:29 +02:00
Sebastiaan van Stijn
b4c0a7efd4
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>
(cherry picked from commit 84224935ea)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-04-17 23:08:26 +02:00
Sebastiaan van Stijn
cdedf9ae3e
Improve consistency in "skip"
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit a3948d17d3)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-04-17 23:08:23 +02:00
Sebastiaan van Stijn
e438d4799d
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>
(cherry picked from commit 0de62d9bbc)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-04-17 23:04:49 +02:00
Sebastiaan van Stijn
05ecb140c4
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>
(cherry picked from commit 4d88a95d67)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-04-17 21:34:30 +02:00
Sebastiaan van Stijn
bb22158740
Test: Replace NewClient() with NewClientT()
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 2cb7b73a1b)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-04-17 21:34:09 +02:00
zhangyue
8a614d1b24
cli: fix images filter when use multi reference filter
Signed-off-by: zhangyue <zy675793960@yeah.net>
(cherry picked from commit 5007c36d71)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-04-17 21:32:23 +02:00
Arash Deshmeh
6a1983ea75
migrated ipc integration tests to integration/container
Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
(cherry picked from commit febefb850d)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-04-17 21:32:18 +02:00
Xiaoxi He
0b46144ff7
Fix some typos
Signed-off-by: Xiaoxi He <xxhe@alauda.io>
(cherry picked from commit 5c0d2a0932)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-04-17 21:32:10 +02:00