From 5aa817a8836bd4c4e34ad2b4a0f9c3ffcadb22b7 Mon Sep 17 00:00:00 2001 From: Jim Garlick Date: Tue, 9 Oct 2018 13:15:11 -0700 Subject: [PATCH] testsuite: cover ingest priority --- t/t2200-job-ingest.t | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/t/t2200-job-ingest.t b/t/t2200-job-ingest.t index 008cd5e85a07..ad9bde768d62 100755 --- a/t/t2200-job-ingest.t +++ b/t/t2200-job-ingest.t @@ -78,6 +78,32 @@ test_expect_success 'job-ingest: job announced to job manager' ' grep -q userid=$(id -u) jobman.out ' +test_expect_success 'job-ingest: priority stored in KVS' ' + jobid=$(${SUBMITBENCH} ${JOBSPEC}/valid/basic.yaml) && + kvsdir=$(flux job id --to=kvs-active $jobid) && + jobpri=$(flux kvs get --json ${kvsdir}.priority) && + test $jobpri -eq 16 +' + +test_expect_success 'job-ingest: instance owner can submit priority=31' ' + jobid=$(${SUBMITBENCH} --priority=31 ${JOBSPEC}/valid/basic.yaml) && + kvsdir=$(flux job id --to=kvs-active $jobid) && + jobpri=$(flux kvs get --json ${kvsdir}.priority) && + test $jobpri -eq 31 +' + +test_expect_success 'job-ingest: priority range is enforced' ' + test_must_fail ${SUBMITBENCH} --priority=32 \ + ${JOBSPEC}/valid/basic.yaml && + test_must_fail ${SUBMITBENCH} --priority="-1" \ + ${JOBSPEC}/valid/basic.yaml +' + +test_expect_success 'job-ingest: guest cannot submit priority=17' ' + ! FLUX_HANDLE_ROLEMASK=0x2 \ + ${SUBMITBENCH} --priority=17 ${JOBSPEC}/valid/basic.yaml +' + test_expect_success 'job-ingest: valid jobspecs accepted' ' test_valid ${JOBSPEC}/valid/* '