@@ -840,6 +840,36 @@ def test_kill_with_signal(self):
840
840
self .assertIn ('Running' , state )
841
841
self .assertEqual (state ['Running' ], False , state )
842
842
843
+ def test_kill_with_signal_name (self ):
844
+ id = self .client .create_container (BUSYBOX , ['sleep' , '60' ])
845
+ self .client .start (id )
846
+ self .tmp_containers .append (id )
847
+ self .client .kill (id , signal = 'SIGKILL' )
848
+ exitcode = self .client .wait (id )
849
+ self .assertNotEqual (exitcode , 0 )
850
+ container_info = self .client .inspect_container (id )
851
+ self .assertIn ('State' , container_info )
852
+ state = container_info ['State' ]
853
+ self .assertIn ('ExitCode' , state )
854
+ self .assertNotEqual (state ['ExitCode' ], 0 )
855
+ self .assertIn ('Running' , state )
856
+ self .assertEqual (state ['Running' ], False , state )
857
+
858
+ def test_kill_with_signal_integer (self ):
859
+ id = self .client .create_container (BUSYBOX , ['sleep' , '60' ])
860
+ self .client .start (id )
861
+ self .tmp_containers .append (id )
862
+ self .client .kill (id , signal = 9 )
863
+ exitcode = self .client .wait (id )
864
+ self .assertNotEqual (exitcode , 0 )
865
+ container_info = self .client .inspect_container (id )
866
+ self .assertIn ('State' , container_info )
867
+ state = container_info ['State' ]
868
+ self .assertIn ('ExitCode' , state )
869
+ self .assertNotEqual (state ['ExitCode' ], 0 )
870
+ self .assertIn ('Running' , state )
871
+ self .assertEqual (state ['Running' ], False , state )
872
+
843
873
844
874
class PortTest (helpers .BaseTestCase ):
845
875
def test_port (self ):
0 commit comments