diff options
author | Joffrey F <joffrey@docker.com> | 2017-05-17 18:12:26 -0700 |
---|---|---|
committer | Joffrey F <joffrey@docker.com> | 2017-06-16 17:02:59 -0700 |
commit | 1ea6618b09e3a74531a0fed1d44a5d698afe2339 (patch) | |
tree | 201b69c54d324bebac1588e5560d0289fa450f33 /tests/integration/api_healthcheck_test.py | |
parent | 8645d1d41b69763b7dfb4dd0cbe3a3ab2d7f5321 (diff) | |
download | docker-py-healthcheck-start-period.tar.gz |
Add support for start_period in Healthcheck spechealthcheck-start-period
Signed-off-by: Joffrey F <joffrey@docker.com>
Diffstat (limited to 'tests/integration/api_healthcheck_test.py')
-rw-r--r-- | tests/integration/api_healthcheck_test.py | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/tests/integration/api_healthcheck_test.py b/tests/integration/api_healthcheck_test.py index afe1dea..211042d 100644 --- a/tests/integration/api_healthcheck_test.py +++ b/tests/integration/api_healthcheck_test.py @@ -28,8 +28,8 @@ class HealthcheckTest(BaseAPIIntegrationTest): container = self.client.create_container( BUSYBOX, 'top', healthcheck=dict( test="true", - interval=1*SECOND, - timeout=1*SECOND, + interval=1 * SECOND, + timeout=1 * SECOND, retries=1, )) self.tmp_containers.append(container) @@ -41,10 +41,27 @@ class HealthcheckTest(BaseAPIIntegrationTest): container = self.client.create_container( BUSYBOX, 'top', healthcheck=dict( test="false", - interval=1*SECOND, - timeout=1*SECOND, + interval=1 * SECOND, + timeout=1 * SECOND, retries=1, )) self.tmp_containers.append(container) self.client.start(container) wait_on_health_status(self.client, container, "unhealthy") + + @helpers.requires_api_version('1.29') + def test_healthcheck_start_period(self): + container = self.client.create_container( + BUSYBOX, 'top', healthcheck=dict( + test="echo 'x' >> /counter.txt && " + "test `cat /counter.txt | wc -l` -ge 3", + interval=1 * SECOND, + timeout=1 * SECOND, + retries=1, + start_period=3 * SECOND + ) + ) + + self.tmp_containers.append(container) + self.client.start(container) + wait_on_health_status(self.client, container, "healthy") |