Skip to content

Commit

Permalink
testsuite: add tests for per-node/task output redirection
Browse files Browse the repository at this point in the history
Problem: There are no tests for per-node/task output file redirection
using the equivalent mustache templates.

Add some tests to t2606-job-shell-output-redirection.t.
  • Loading branch information
grondo committed Jan 7, 2025
1 parent d2fc4e4 commit 1ac0e90
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions t/t2606-job-shell-output-redirection.t
Original file line number Diff line number Diff line change
Expand Up @@ -403,4 +403,29 @@ test_expect_success 'job-shell: invalid output.mode emits warning' '
test_debug "cat inval.out" &&
grep "ignoring invalid output.mode=foo" inval.err
'
test_expect_success 'job-shell: per-node output works' '
flux run -N4 -n4 --output=per-node.{{node.id}} \
sh -c "flux getattr rank" &&
ls -l per-node.* &&
for rank in $(seq 0 3); do test $(cat per-node.${rank}) -eq $rank; done
'
test_expect_success 'job-shell: per-task output works' '
flux run -N4 -n8 --output=per-task.{{task.id}} \
printenv FLUX_TASK_RANK &&
ls -l per-task.* &&
for rank in $(seq 0 7); do test $(cat per-task.${rank}) -eq $rank; done
'
test_expect_success 'job-shell: log messages are sent to correct output files' '
flux run -N4 -o verbose=2 --output=per-log.{{node.id}} hostname &&
grep flux-shell per-log.0 &&
grep flux-shell per-log.1 &&
grep flux-shell per-log.2 &&
grep flux-shell per-log.3
'
test_expect_success 'job-shell: pty output is saved in correct output files' '
flux run -N4 -n8 -o pty -o cpu-affinity=off \
--output=pty-output.{{task.id}} echo foo &&
grep . pty-output.* &&
for rank in $(seq 0 7); do grep foo pty-output.${rank}; done
'
test_done

0 comments on commit 1ac0e90

Please sign in to comment.