Commit Graph

37 Commits

Author SHA1 Message Date
48cfcaddd4 Merge pull request #24878 from dongluochen/swarmConstraintTest
Add integration test for constraints
Upstream-commit: f35c4343f32aff4fb4f261e1dedb4200410d53b4
Component: engine
2016-08-01 17:45:23 -06:00
8eb814c15b Remove testRequires(c, Network) from swarm integration tests
Since 24237 has been merged, it is not necessary to require network
for swarm integration tests (`integration-cli/docker_api_swarm_test.go`)
any more.

This fix removes testRequires(c, Network) from swarm integration
tests.

This fix could be verified by disable networking, and all related
tests pass.

This fix is related to 24547, 24490, 24237.

This fix fixes 24547.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 85c9ef8a47fcf552ae9f436e7c00340dacf03030
Component: engine
2016-07-30 09:59:30 -07:00
3e830fffcd integration: drain node before stop in TestApiSwarmForceNewCluster
It's too long to wait for reschedule.

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: 307b7b0d151e949024e7ab7ad276b174802a75f2
Component: engine
2016-07-29 10:44:30 -07:00
8e586b192e Merge pull request #25077 from cpuguy83/fix_TestApiSwarmRestartCluster
Fix race in `TestApiSwarmRestartCluster`
Upstream-commit: 262063531a4845c436b64deff9a7fca9f90c0c13
Component: engine
2016-07-28 10:15:31 -07:00
49967c7276 Merge pull request #25104 from cpuguy83/fix_TestApiSwarmRaftQuorum
fix race in TestApiSwarmRaftQuorum
Upstream-commit: e07ff10f706a5bb9aa403c8d56876b09f9cba857
Component: engine
2016-07-27 12:50:09 +02:00
ce6c596db3 Merge pull request #25107 from stevvooe/cleanup-leader-election-test
integration-cli: cleanup leader election tests
Upstream-commit: ef63637b995b07a08b6cb326dc8953b927e9df1d
Component: engine
2016-07-27 12:47:33 +02:00
9f01f14280 integration-cli: cleanup leader election tests
Ensure convergence before moving on with testing leader election
conditions. This reduce the flakiness of this test when run in different
environments.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
Upstream-commit: 946e23776be78510799f3f242f7b9f7acbbfd357
Component: engine
2016-07-26 19:12:27 -07:00
025360735d fix race in TestApiSwarmRaftQuorum
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 4a856d7a87c65dd8c537a45443c72698f056cf13
Component: engine
2016-07-26 21:32:56 -04:00
2d9c640d4f Specify a lower restart delay for swarm integration tests
If no restart delay is specified for a swarm service, the default
restart delay is 5 seconds. This is a reasonable value for actual
deployments - one example of where it's useful is that if a bad image is
specified, the orchestrator will wait 5 seconds between attempts to
restart it instead of restarting it in a tight loop.

In integration tests, this 5 second delay is dead time. The tests run
faster if the delay is reduced. Set it to 100 ms to avoid the waste of
time.

This appears to speed up a few tests:

DockerSwarmSuite.TestApiSwarmForceNewCluster 37.241s -> 34.323s
DockerSwarmSuite.TestApiSwarmRestartCluster  22.038s -> 15.545s
DockerSwarmSuite.TestApiSwarmServicesMultipleAgents 24.456s -> 19.853s
DockerSwarmSuite.TestApiSwarmServicesStateReporting 19.240s -> 10.049s

...a small step towards making the Swarm integration tests run in a
reasonable amount of time.

Also, change the update delay for the rolling update test from 8 seconds
to 4 seconds, which should be sufficient to differentiate between
batches of updated tasks. This reduces the runtime for
DockerSwarmSuite.TestApiSwarmServicesUpdate from 28s to 20s.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: c93c6492589504ed9474922f7c98f9ecb24df77f
Component: engine
2016-07-26 12:12:43 -07:00
5a19e582d6 Fix race in TestApiSwarmRestartCluster
In `TestApiSwarmRestartCluster`, it's calling `checkClusterHealth`.
`checkClusterHealth` calls `d.info()`, which will return an error if
there is no cluster leader... problem is `checkClusterHealth` is doing a
nil error assertion w/o giving any time for a leader to be elected.

This moves the `d.info()` call into a `waitAndAssert` using the default
reconciliation timeout.

It also moves some other checks into a `waitAndAssert` to give the
cluster enough time to come back up.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: fdcde8bb65acf2c459e93678bf2659139ef5e918
Component: engine
2016-07-26 14:37:18 -04:00
f72c6bff06 Add failure action for rolling updates
This changes the default behavior so that rolling updates will not
proceed once an updated task fails to start, or stops running during the
update. Users can use docker service inspect --pretty servicename to see
the update status, and if it pauses due to a failure, it will explain
that the update is paused, and show the task ID that caused it to pause.
It also shows the time since the update started.

A new --update-on-failure=(pause|continue) flag selects the
behavior. Pause means the update stops once a task fails, continue means
the old behavior of continuing the update anyway.

In the future this will be extended with additional behaviors like
automatic rollback, and flags controlling parameters like how many tasks
need to fail for the update to stop proceeding. This is a minimal
solution for 1.12.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: 57ae29aa74e77ade3c91b1c77ba766512dae9ab4
Component: engine
2016-07-25 08:51:19 -07:00
2150ea40b1 Split advertised address from listen address
There are currently problems with "swarm init" and "swarm join" when an
explicit --listen-addr flag is not provided. swarmkit defaults to
finding the IP address associated with the default route, and in cloud
setups this is often the wrong choice.

Introduce a notion of "advertised address", with the client flag
--advertise-addr, and the daemon flag --swarm-default-advertise-addr to
provide a default. The default listening address is now 0.0.0.0, but a
valid advertised address must be detected or specified.

If no explicit advertised address is specified, error out if there is
more than one usable candidate IP address on the system. This requires a
user to explicitly choose instead of letting swarmkit make the wrong
choice. For the purposes of this autodetection, we ignore certain
interfaces that are unlikely to be relevant (currently docker*).

The user is also required to choose a listen address on swarm init if
they specify an explicit advertise address that is a hostname or an IP
address that's not local to the system. This is a requirement for
overlay networking.

Also support specifying interface names to --listen-addr,
--advertise-addr, and the daemon flag --swarm-default-advertise-addr.
This will fail if the interface has multiple IP addresses (unless it has
a single IPv4 address and a single IPv6 address - then we resolve the
tie in favor of IPv4).

This change also exposes the node's externally-reachable address in
docker info, as requested by #24017.

Make corresponding API and CLI docs changes.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: a0ccd0d42fdb0dd2005f67604cb81a5a6b26787e
Component: engine
2016-07-24 09:23:07 -07:00
21e679771f Add integration test for constraints.
Signed-off-by: Dong Chen <dongluo.chen@docker.com>
Upstream-commit: 1b1a7f29e5d54a1c9ff892ccc8cf627c08f47ec9
Component: engine
2016-07-21 18:08:49 -07:00
b141a44de0 Replace secrets with join tokens
Implement the proposal from
https://github.com/docker/docker/issues/24430#issuecomment-233100121

Removes acceptance policy and secret in favor of an automatically
generated join token that combines the secret, CA hash, and
manager/worker role into a single opaque string.

Adds a docker swarm join-token subcommand to inspect and rotate the
tokens.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: 2cc5bd33eef038bf5721582e2410ba459bb656e9
Component: engine
2016-07-21 15:23:03 -07:00
0938c99ecd Merge pull request #24563 from dperny/test-leader-election
Added leader election test
Upstream-commit: ea59668046e1c842b311732fc280701da1056ace
Component: engine
2016-07-20 16:02:09 -07:00
6c22592de6 Test rolling update.
Signed-off-by: Dong Chen <dongluo.chen@docker.com>
Upstream-commit: d327765a62a99dc63e9a8c16ac291861cee066f3
Component: engine
2016-07-19 12:09:30 -07:00
35b05741e6 Added leader election test
Signed-off-by: Drew Erny <drew.erny@docker.com>
Upstream-commit: 3489e76513b76e6429075dbbcb6acb3341e42293
Component: engine
2016-07-19 11:29:27 -07:00
ecd1805a72 Added test for leader proxying
Signed-off-by: Drew Erny <drew.erny@docker.com>
Upstream-commit: d305aa48ddcd17244ca408c59a40e2ef2392f414
Component: engine
2016-07-18 13:18:02 -07:00
f0e9eeb33f Merge pull request #24465 from LK4D4/restart_cluster_test
integration-cli: add test for restarting entire swarm cluster
Upstream-commit: 08a2fd7e2e95c235225e796b8b6d4c89478394ea
Component: engine
2016-07-12 13:12:33 -07:00
944503693f Add API test for empty services list
Signed-off-by: Ralf Sippl <ralf.sippl@gmail.com>
Upstream-commit: 65e72133a11ea3e6873f62039956bbd70548a5a7
Component: engine
2016-07-12 17:31:44 +02:00
b2f48d18dd integration-cli: add test for restarting entire swarm cluster
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: ae4137ae3cc6ee479f5e7f86f9859b485473285a
Component: engine
2016-07-11 14:48:57 -07:00
113ca78a6b Use waitAndAssert to test node state changes
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: f02ec39e99bfd36f34a965f78d853e19234e513b
Component: engine
2016-07-11 10:01:14 -07:00
dd59a5931c integration-cli: fix --net=none tests
Example:

21:28:01 [d68573521] waiting for daemon to start
21:28:01 [d68573521] daemon started
21:28:01 docker_api_swarm_test.go:163:
21:28:01     c.Assert(d1.Init(map[string]bool{"worker": true}, ""),
checker.IsNil)
21:28:01 ... value *errors.errorString =
&errors.errorString{s:"initializing swarm: invalid statuscode 500,
\"{\\\"message\\\":\\\"could not determine local IP address: dial udp
8.8.8.8:53: connect: network is unreachable\\\"}\\n\"} ("initializing
swarm: invalid statuscode 500, \"{\\\"message\\\":\\\"could not
determine local IP address: dial udp 8.8.8.8:53: connect: network is
unreachable\\\"}\\n\"")
21:28:01
21:28:01 [d68573521] exiting daemon"}

Signed-off-by: Antonio Murdaca <runcom@redhat.com>
Upstream-commit: 9fadb8fd6a09c8982dc8a44125f4d21c33c8c394
Component: engine
2016-07-10 15:56:02 +02:00
727d754fd1 Add more complicated demotion testcases
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: a3f1577365f7b2ed99d1801c909bfaa69c048c92
Component: engine
2016-07-08 13:33:40 -07:00
d93f3c954e Fix test case for docker_api_swarm_test.go
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
Upstream-commit: 6dfba780cc490ef7579e95169b5c71617f8e5a47
Component: engine
2016-07-07 21:01:55 +01:00
c644a729dc Add test for force-new-cluster
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: 1acb8ef82572c52994b1ff00fe5c86aac53be4b8
Component: engine
2016-06-24 13:57:11 -07:00
76181c2413 Switch node management tests to api types
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: 22b34d64496c9b6ebae5e2b4a98ecd9a172cc557
Component: engine
2016-06-24 11:51:43 -07:00
4bcb0e068c Increase test timeouts for node state changes
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: 2e5da4434126309f2395cc3d5b2013674155ae5c
Component: engine
2016-06-23 17:30:42 -07:00
8c9dd4362c Unify swarm init and update options
Add api side validation and defaults for init and
join requests.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: fb3eb1c27ef5520571c599ead8a72b343748db39
Component: engine
2016-06-21 16:34:32 -07:00
20fc079713 Don’t try to restore swarm from incomplete state
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: ded1d9af38cb467dadab0521936174eef0d4bc9e
Component: engine
2016-06-18 19:43:47 -07:00
79ea0079e7 Merge pull request #23644 from tonistiigi/fix-leave-delete
Fix removing containers on leaving from pending state
Upstream-commit: f4de3f314e1e965056447d5ea6203ca4b66bb6e0
Component: engine
2016-06-17 01:40:45 +00:00
dae11af952 Fix removing containers on leaving from pending state
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: 826f6f07031abc4dea6f71ed69d33a4e0789ee11
Component: engine
2016-06-16 16:08:15 -07:00
10f6f936be Return membership status on join without timeout
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: 1973cee0cd86da3c7b7002a3fed7af2557df538c
Component: engine
2016-06-16 15:27:08 -07:00
f2801c549b Add api tests for secret update
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: aed7667bee243b0e0d1aa480e3bb52bae894cfe5
Component: engine
2016-06-16 13:21:55 -07:00
db7d3c4eb4 Update drain test
With the rolling update there can be a possibility
that the container count matches the update has
completely finished yet.

The actual bug for the flakiness was fixed with the
swarmkit update.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: b38408fd0287a5d6eda4f8083b83806faf5d5cbd
Component: engine
2016-06-14 17:25:17 -07:00
bd9cd01452 Temporarily skip flaky part of the drain test
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: 32f18616c70c52298ea7e07529acba852aa87c86
Component: engine
2016-06-14 10:20:40 -07:00
7a33d63cb2 Swarm integration tests
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Signed-off-by: Victor Vieux <vieux@docker.com>
Upstream-commit: 0d88d5b64b69a451d374e322b2abe64140a6cd1c
Component: engine
2016-06-13 22:16:18 -07:00