summaryrefslogtreecommitdiff
path: root/tests/integration_test.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/integration_test.py')
-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 #
#################