summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoffrey F <joffrey@docker.com>2015-02-11 12:16:36 -0800
committerJoffrey F <joffrey@docker.com>2015-02-11 12:16:36 -0800
commitcab37b604a81b8c98c10845e3342f7939fef7020 (patch)
tree6bfe4b18b44cc88551d83847beb8b3cd2b888251
parentdb825d84a8810c3a772df2cfe9172040581cc39d (diff)
downloaddocker-py-pid_mode.tar.gz
pid_mode integration testspid_mode
-rw-r--r--tests/integration_test.py31
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/integration_test.py b/tests/integration_test.py
index edee039..b6ea674 100644
--- a/tests/integration_test.py
+++ b/tests/integration_test.py
@@ -1060,6 +1060,37 @@ class TestPauseUnpauseContainer(BaseTestCase):
self.assertEqual(state['Paused'], False)
+class TestCreateContainerWithHostPidMode(BaseTestCase):
+ def runTest(self):
+ ctnr = self.client.create_container(
+ 'busybox', 'true', host_config=create_host_config(
+ pid_mode='host'
+ )
+ )
+ self.assertIn('Id', ctnr)
+ self.tmp_containers.append(ctnr['Id'])
+ self.client.start(ctnr)
+ inspect = self.client.inspect_container(ctnr)
+ self.assertIn('HostConfig', inspect)
+ host_config = inspect['HostConfig']
+ self.assertIn('PidMode', host_config)
+ self.assertEqual(host_config['PidMode'], 'host')
+
+
+class TestStartContainerWithHostPidMode(BaseTestCase):
+ def runTest(self):
+ ctnr = self.client.create_container(
+ 'busybox', 'true'
+ )
+ self.assertIn('Id', ctnr)
+ self.tmp_containers.append(ctnr['Id'])
+ self.client.start(ctnr, pid_mode='host')
+ inspect = self.client.inspect_container(ctnr)
+ self.assertIn('HostConfig', inspect)
+ host_config = inspect['HostConfig']
+ self.assertIn('PidMode', host_config)
+ self.assertEqual(host_config['PidMode'], 'host')
+
#################
# LINKS TESTS #
#################