Skip to content

Commit 660e8b7

Browse files
committed
t2602-job-shell.t: adjust job shell TMPDIR tests
Problem: The job shell TMPDIR tests in t2602-job-shell.t do not align with current expected behavior of the shell tmpdir plugin. Revise the test for a bad TMPDIR to ensure the job succeeds and TMPDIR is reset to /tmp. Add a test to ensure that an unset TMPDIR is preserved within a job.
1 parent 06ebd99 commit 660e8b7

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

t/t2602-job-shell.t

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -279,12 +279,14 @@ test_expect_success 'job-shell: creates missing TMPDIR by default' '
279279
TMPDIR=$(pwd)/mytmpdir flux mini run true &&
280280
test -d mytmpdir
281281
'
282-
283-
test_expect_success 'job-shell: job fails if missing TMPDIR cannot be created' '
284-
! TMPDIR=/baddir flux mini run true 2>badtmp.err &&
285-
grep exception badtmp.err
282+
test_expect_success 'job-shell: uses /tmp if TMPDIR cannot be created' '
283+
TMPDIR=/baddir flux mini run printenv TMPDIR >badtmp.out 2>badtmp.err &&
284+
test_debug "cat badtmp.out badtmp.err" &&
285+
grep /tmp badtmp.out
286+
'
287+
test_expect_success 'job-shell: unset TMPDIR stays unset' '
288+
flux mini run --env=-TMPDIR sh -c "test -z \$TMPDIR"
286289
'
287-
288290
test_expect_success 'job-shell: FLUX_JOB_TMPDIR is set and is a directory' '
289291
flux mini run sh -c "test -d \$FLUX_JOB_TMPDIR"
290292
'

0 commit comments

Comments
 (0)