Skip to content

Commit

Permalink
testsuite: add tests for flux hostlist -F, --find
Browse files Browse the repository at this point in the history
Problem: There are no tests of `flux hostlist -F, --find`.

Add some to t2814-hostlist-cmd.t.
  • Loading branch information
grondo committed Feb 28, 2025
1 parent 63d5c4d commit 454df2a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions t/t2814-hostlist-cmd.t
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,15 @@ test_expect_success 'flux-hostlist -n errors with invalid index' '
test_must_fail flux hostlist -n 10 foo[1-10] &&
test_must_fail flux hostlist -n 1,10 foo[1-10]
'
test_expect_success 'flux-hostlist -F, --find=HOSTS works' '
test "$(flux hostlist -F foo1 foo[1-10])" = "0" &&
test "$(flux hostlist -F foo10 foo[1-10])" = "9" &&
test "$(flux hostlist -F foo[1-2] foo[1-10])" = "0 1"
'
test_expect_success 'flux-hostlist -F, --find=HOSTS fails if host not found' '
test_must_fail flux hostlist -F foo1 foo[2-10] &&
test_must_fail flux hostlist -F foo[1-10] foo[2-10]
'
test_expect_success 'flux-hostlist -x, --exclude works' '
test "$(flux hostlist -x foo1 foo[0-10])" = "foo[0,2-10]" &&
test "$(flux hostlist -x foo[0-9] foo[0-10])" = "foo10"
Expand Down

0 comments on commit 454df2a

Please sign in to comment.