Skip to content

Commit cab37b6

Browse files
committed
pid_mode integration tests
1 parent db825d8 commit cab37b6

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

tests/integration_test.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1060,6 +1060,37 @@ def runTest(self):
10601060
self.assertEqual(state['Paused'], False)
10611061

10621062

1063+
class TestCreateContainerWithHostPidMode(BaseTestCase):
1064+
def runTest(self):
1065+
ctnr = self.client.create_container(
1066+
'busybox', 'true', host_config=create_host_config(
1067+
pid_mode='host'
1068+
)
1069+
)
1070+
self.assertIn('Id', ctnr)
1071+
self.tmp_containers.append(ctnr['Id'])
1072+
self.client.start(ctnr)
1073+
inspect = self.client.inspect_container(ctnr)
1074+
self.assertIn('HostConfig', inspect)
1075+
host_config = inspect['HostConfig']
1076+
self.assertIn('PidMode', host_config)
1077+
self.assertEqual(host_config['PidMode'], 'host')
1078+
1079+
1080+
class TestStartContainerWithHostPidMode(BaseTestCase):
1081+
def runTest(self):
1082+
ctnr = self.client.create_container(
1083+
'busybox', 'true'
1084+
)
1085+
self.assertIn('Id', ctnr)
1086+
self.tmp_containers.append(ctnr['Id'])
1087+
self.client.start(ctnr, pid_mode='host')
1088+
inspect = self.client.inspect_container(ctnr)
1089+
self.assertIn('HostConfig', inspect)
1090+
host_config = inspect['HostConfig']
1091+
self.assertIn('PidMode', host_config)
1092+
self.assertEqual(host_config['PidMode'], 'host')
1093+
10631094
#################
10641095
# LINKS TESTS #
10651096
#################

0 commit comments

Comments
 (0)