github.com/zhuohuang-hust/src-cbuild@v0.0.0-20230105071821-c7aab3e7c840/mergeCode/runc/tests/integration/kill.bats (about)

     1  #!/usr/bin/env bats
     2  
     3  load helpers
     4  
     5  function setup() {
     6    teardown_busybox
     7    setup_busybox
     8  }
     9  
    10  function teardown() {
    11    teardown_busybox
    12  }
    13  
    14  
    15  @test "kill detached busybox" {
    16  
    17    # run busybox detached
    18    runc run -d --console /dev/pts/ptmx test_busybox
    19    [ "$status" -eq 0 ]
    20  
    21    # check state
    22    wait_for_container 15 1 test_busybox
    23  
    24    testcontainer test_busybox running
    25  
    26    runc kill test_busybox KILL
    27    [ "$status" -eq 0 ]
    28  
    29    retry 10 1 eval "__runc state test_busybox | grep -q 'stopped'"
    30  
    31    runc delete test_busybox
    32    [ "$status" -eq 0 ]
    33  }