From cab37b604a81b8c98c10845e3342f7939fef7020 Mon Sep 17 00:00:00 2001 From: Joffrey F Date: Wed, 11 Feb 2015 12:16:36 -0800 Subject: pid_mode integration tests --- tests/integration_test.py | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) 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 # ################# -- cgit v1.2.1