diff options
author | Joffrey F <joffrey@docker.com> | 2017-12-13 19:06:29 -0800 |
---|---|---|
committer | Joffrey F <joffrey@docker.com> | 2017-12-13 19:06:29 -0800 |
commit | 445cb18723fe4e9aa3f98020b001842cc9ee8273 (patch) | |
tree | 5f93b11979221a0f43b450d7f1bd9c0dd6cedaee | |
parent | d7bc8ac2b8507b93097f164ab994a138f9d6bab1 (diff) | |
download | docker-py-445cb18723fe4e9aa3f98020b001842cc9ee8273.tar.gz |
Add integration test for CPU realtime options
Signed-off-by: Joffrey F <joffrey@docker.com>
-rw-r--r-- | tests/integration/api_container_test.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/integration/api_container_test.py b/tests/integration/api_container_test.py index f03ccdb..5e30eee 100644 --- a/tests/integration/api_container_test.py +++ b/tests/integration/api_container_test.py @@ -464,6 +464,20 @@ class CreateContainerTest(BaseAPIIntegrationTest): config = self.client.inspect_container(ctnr) assert config['HostConfig']['InitPath'] == "/usr/libexec/docker-init" + @requires_api_version('1.24') + @pytest.mark.xfail(not os.path.exists('/sys/fs/cgroup/cpu.rt_runtime_us'), + reason='CONFIG_RT_GROUP_SCHED isn\'t enabled') + def test_create_with_cpu_rt_options(self): + ctnr = self.client.create_container( + BUSYBOX, 'true', host_config=self.client.create_host_config( + cpu_rt_period=1000, cpu_rt_runtime=500 + ) + ) + self.tmp_containers.append(ctnr) + config = self.client.inspect_container(ctnr) + assert config['HostConfig']['CpuRealtimeRuntime'] == 500 + assert config['HostConfig']['CpuRealtimePeriod'] == 1000 + class VolumeBindTest(BaseAPIIntegrationTest): def setUp(self): |