| 1 | ## oils_failures_allowed: 2
|
| 2 | ## compare_shells: dash bash-4.4 mksh zsh
|
| 3 |
|
| 4 | # Tests for builtins having to do with killing a process
|
| 5 |
|
| 6 | #### Kills the process with SIGTERM
|
| 7 | # Test 1: Basic SIGTERM
|
| 8 | sleep 0.1 &
|
| 9 | pid=$!
|
| 10 | kill -15 $pid
|
| 11 | wait $pid
|
| 12 | echo $? # Should be 143 (128 + SIGTERM)
|
| 13 | ## STDOUT:
|
| 14 | 143
|
| 15 | ## END
|
| 16 | # For some reason mksh doesn't return the same as the others.
|
| 17 | ## OK mksh stdout: 0
|
| 18 |
|
| 19 | #### Kills the process with SIGKILL
|
| 20 | # Test 2: Basic SIGKILL
|
| 21 | sleep 0.1 &
|
| 22 | pid=$!
|
| 23 | kill -9 $pid
|
| 24 | wait $pid
|
| 25 | echo $? # Must be 137 (128 + SIGKILL)
|
| 26 | ## STDOUT:
|
| 27 | 137
|
| 28 | ## END
|