Skip to content

Commit

Permalink
testsuite: cover test_must_fail_or_be_terminated
Browse files Browse the repository at this point in the history
Problem: there is no test coverage for the test_must_fail_or_be_terminated
shell function.

Add some tests.
  • Loading branch information
garlick committed Oct 3, 2024
1 parent 8b8387c commit b7b0c6c
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions t/t0001-basic.t
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,18 @@ test_expect_success 'test run_timeout with success' '
test_expect_success 'run_timeout fails if exec fails' '
test_must_fail run_timeout 1 /nonexistent/executable
'
test_expect_success 'test_must_fail_or_be_terminated fails on success' '
test_must_fail test_must_fail_or_be_terminated true
'
test_expect_success 'test_must_fail_or_be_terminated succeeds on nonzero exit' '
test_must_fail_or_be_terminated false
'
test_expect_success 'test_must_fail_or_be_terminated succeeds on SIGTERM' '
test_must_fail_or_be_terminated sh -c "kill \$\$"
'
test_expect_success 'test_must_fail_or_be_terminated fails on SIGHUP' '
test_must_fail test_must_fail_or_be_terminated sh -c "kill -HUP \$\$"
'
test_expect_success 'we can find a flux binary' '
flux --help >/dev/null
'
Expand Down

0 comments on commit b7b0c6c

Please sign in to comment.