@@ -1060,6 +1060,37 @@ def runTest(self):
1060
1060
self .assertEqual (state ['Paused' ], False )
1061
1061
1062
1062
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
+
1063
1094
#################
1064
1095
# LINKS TESTS #
1065
1096
#################
0 commit comments