diff options
| author | Joffrey F <joffrey@docker.com> | 2016-08-03 18:00:29 -0700 |
|---|---|---|
| committer | Joffrey F <joffrey@docker.com> | 2016-08-03 18:00:29 -0700 |
| commit | 1f055796a8992da041280401025792cc8fb22336 (patch) | |
| tree | 123fb2872bc5622128522988d3154c67f1b60659 /tests/integration | |
| parent | 07563cfe3f565b57b955455d2ce2b350ed34883b (diff) | |
| download | docker-py-1f055796a8992da041280401025792cc8fb22336.tar.gz | |
Add new init_swarm test with custom spec
Signed-off-by: Joffrey F <joffrey@docker.com>
Diffstat (limited to 'tests/integration')
| -rw-r--r-- | tests/integration/swarm_test.py | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/tests/integration/swarm_test.py b/tests/integration/swarm_test.py index 734d470..969e05e 100644 --- a/tests/integration/swarm_test.py +++ b/tests/integration/swarm_test.py @@ -29,7 +29,7 @@ class SwarmTest(helpers.BaseTestCase): @requires_api_version('1.24') def test_init_swarm_force_new_cluster(self): - pytest.skip('Test stalls the engine on 1.12') + pytest.skip('Test stalls the engine on 1.12.0') assert self.client.init_swarm('eth0') version_1 = self.client.inspect_swarm()['Version']['Index'] @@ -44,6 +44,18 @@ class SwarmTest(helpers.BaseTestCase): self.client.init_swarm('eth0') @requires_api_version('1.24') + def test_init_swarm_custom_raft_spec(self): + spec = self.client.create_swarm_spec( + snapshot_interval=5000, log_entries_for_slow_followers=1200 + ) + assert self.client.init_swarm( + advertise_addr='eth0', swarm_spec=spec + ) + swarm_info = self.client.inspect_swarm() + assert swarm_info['Spec']['Raft']['SnapshotInterval'] == 5000 + assert swarm_info['Spec']['Raft']['LogEntriesForSlowFollowers'] == 1200 + + @requires_api_version('1.24') def test_leave_swarm(self): assert self.client.init_swarm('eth0') with pytest.raises(docker.errors.APIError) as exc_info: |
