diff --git a/t/t1001-mf-priority-basic.t b/t/t1001-mf-priority-basic.t index badefcb16..ec4476989 100755 --- a/t/t1001-mf-priority-basic.t +++ b/t/t1001-mf-priority-basic.t @@ -123,4 +123,31 @@ test_expect_success 'reject job when invalid bank format is passed in' ' grep "unable to unpack bank arg" invalid_fmt.out ' +test_expect_success 'create a fake payload with an empty fairshare key-value pair' ' + cat <<-EOF >empty_fairshare.py + import flux + import pwd + import getpass + + username = getpass.getuser() + userid = pwd.getpwnam(username).pw_uid + # create a JSON payload + data = {"userid": str(userid), "bank": "account4", "default_bank": "account3", "fairshare": "", "max_jobs": "10"} + flux.Flux().rpc("job-manager.mf_priority.rec_update", data).get() + EOF +' + +test_expect_success 'update plugin with sample test data' ' + flux python empty_fairshare.py +' + +test_expect_success 'submit a job with new bank and empty fairshare results in a held job' ' + jobid=$(flux mini submit --setattr=system.bank=account4 -n1 hostname) && + flux job wait-event -f json $jobid priority | jq '.context.priority' > job7.test && + cat <<-EOF >job7.expected && + 0 + EOF + test_cmp job7.expected job7.test +' + test_done