forked from flux-framework/flux-accounting
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[WIP] t: add tests for jobs sent back to PRIORITY
Problem: There are no tests for pending jobs that are sent back to PRIORITY after a Flux restart. Add some tests.
- Loading branch information
Showing
2 changed files
with
64 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
#!/bin/bash | ||
|
||
test_description='test reloading job-manager with pending jobs' | ||
|
||
. `dirname $0`/sharness.sh | ||
MULTI_FACTOR_PRIORITY=${FLUX_BUILD_DIR}/src/plugins/.libs/mf_priority.so | ||
SUBMIT_AS=${SHARNESS_TEST_SRCDIR}/scripts/submit_as.py | ||
DB_PATH=$(pwd)/FluxAccountingTest.db | ||
|
||
test_under_flux 1 job | ||
|
||
flux setattr log-stderr-level 1 | ||
|
||
test_expect_success 'allow guest access to testexec' ' | ||
flux config load <<-EOF | ||
[exec.testexec] | ||
allow-guests = true | ||
EOF | ||
' | ||
|
||
test_expect_success 'create flux-accounting DB' ' | ||
flux account -p $(pwd)/FluxAccountingTest.db create-db | ||
' | ||
|
||
test_expect_success 'start flux-accounting service' ' | ||
flux account-service -p ${DB_PATH} -t | ||
' | ||
|
||
test_expect_success 'load multi-factor priority plugin' ' | ||
flux jobtap load -r .priority-default ${MULTI_FACTOR_PRIORITY} | ||
' | ||
|
||
test_expect_success 'check that mf_priority plugin is loaded' ' | ||
flux jobtap list | grep mf_priority | ||
' | ||
|
||
test_expect_success 'add some banks to the DB' ' | ||
flux account add-bank root 1 && | ||
flux account add-bank --parent-bank=root A 1 | ||
' | ||
|
||
test_expect_success 'add an association to the DB' ' | ||
flux account add-user --username=user1 --userid=5001 --bank=A | ||
' | ||
|
||
test_expect_success 'send flux-accounting DB information to the plugin' ' | ||
flux account-priority-update -p $(pwd)/FluxAccountingTest.db | ||
' | ||
|
||
test_expect_success 'stop scheduler from allocating resources to jobs' ' | ||
flux queue stop | ||
' | ||
|
||
test_expect_success 'submit job and make sure it is pending' ' | ||
job=$(flux python ${SUBMIT_AS} 5001 sleep 60) && | ||
flux job wait-event -vt 5 ${job} priority | ||
' | ||
|
||
test_expect_success 'cancel job' ' | ||
flux cancel ${job} | ||
' | ||
|
||
test_done |