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 6, 2025
1 parent 65073ce commit 96f53a0
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 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,27 @@ 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 --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 --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 96f53a0

Please sign in to comment.