Skip to content

Commit afcb43a

Browse files
committed
testsuite: ensure jobs submitted as root are rejected
Problem: No tests in the testsuite ensure that jobs submitted as user root are rejected by the job-ingest module. Add a test to t2201-job-cmd.t that ensures this is the case.
1 parent 0709e59 commit afcb43a

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

t/t2201-job-cmd.t

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,17 @@ test_expect_success HAVE_FLUX_SECURITY 'flux-job: submit ignores security-config
9595
signed.json >submit-signed.out 2>&1 &&
9696
grep "Ignoring security config" submit-signed.out
9797
'
98+
test_expect_success HAVE_FLUX_SECURITY 'flux-job: submit as root fails' '
99+
flux run --dry-run -n1 hostname | \
100+
flux python \
101+
${SHARNESS_TEST_SRCDIR}/scripts/sign-as.py 0 >signed0.json &&
102+
( export FLUX_HANDLE_USERID=0 &&
103+
test_must_fail \
104+
flux job submit --flags=signed signed0.json 2>signed0.err \
105+
) &&
106+
test_debug "cat signed0.err" &&
107+
grep "submission of jobs as user root not supported" signed0.err
108+
'
98109
test_expect_success 'flux-job: can submit jobspec on stdin with -' '
99110
flux job submit - <basic.json
100111
'

0 commit comments

Comments
 (0)