Skip to content

Commit 0318236

Browse files
committed
testsuite: test shell output truncation
Problem: The job shell should truncate standard output at 10M, but there is no test for this in the testsuite. Add tests that stdout and stderr are truncated at this size. Use the LONGTEST prereq since this test takes some time.
1 parent ae06ddf commit 0318236

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

t/t2606-job-shell-output-redirection.t

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,4 +348,15 @@ test_expect_success 'job-shell: shell errors are captured in error file' '
348348
test_expect_code 127 flux run --error=test.err nosuchcommand &&
349349
grep "nosuchcommand: No such file or directory" test.err
350350
'
351+
test_expect_success LONGTEST 'job-shell: output to kvs is truncated at 10MB' '
352+
dd if=/dev/urandom bs=10240 count=800 | base64 --wrap 79 >expected &&
353+
flux run cat expected >output 2>truncate.error &&
354+
test_debug "cat truncate.error" &&
355+
grep "stdout.*truncated" truncate.error
356+
'
357+
test_expect_success LONGTEST 'job-shell: stderr to kvs is truncated at 10MB' '
358+
dd if=/dev/urandom bs=10240 count=800 | base64 --wrap 79 >expected &&
359+
flux run sh -c "cat expected >&2" >truncate2.error 2>&1 &&
360+
grep "stderr.*truncated" truncate2.error
361+
'
351362
test_done

0 commit comments

Comments
 (0)