Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
t/flux-jobspec: test that valid jobspec is created
- Loading branch information
1 parent
dc57b7a
commit 5ba92b8
Showing
2 changed files
with
61 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,59 @@ | ||
#!/bin/sh | ||
|
||
test_description='Test the flux-jobspec command' | ||
|
||
. `dirname $0`/sharness.sh | ||
|
||
JOBSPEC=${SHARNESS_TEST_SRCDIR}/jobspec | ||
VALIDATE=${JOBSPEC}/validate.py | ||
SCHEMA=${FLUX_SOURCE_DIR}/src/modules/job-ingest/schemas/jobspec.jsonschema | ||
MINI_SCHEMA=${JOBSPEC}/minimal-schema.json | ||
|
||
validate_emission() { | ||
flux jobspec $@ | ${VALIDATE} --schema ${SCHEMA} | ||
} | ||
|
||
validate_minimal_emission() { | ||
flux jobspec $@ | ${VALIDATE} --schema ${MINI_SCHEMA} | ||
} | ||
|
||
test_expect_success 'flux-jobspec srun with no args emits valid canonical jobspec' ' | ||
validate_emission srun sleep 1 | ||
' | ||
|
||
test_expect_success 'flux-jobspec srun with no args emits minimal jobspec' ' | ||
validate_minimal_emission srun sleep 1 | ||
' | ||
|
||
test_expect_success 'flux-jobspec srun with just num_tasks emits valid canonical jobspec' ' | ||
validate_emission srun -n4 sleep 1 | ||
' | ||
|
||
test_expect_success 'flux-jobspec srun with just num_tasks emits minimal jobspec' ' | ||
validate_minimal_emission srun -n4 sleep 1 | ||
' | ||
|
||
test_expect_success 'flux-jobspec srun with just cores_per_task emits valid canonical jobspec' ' | ||
validate_emission srun -c4 sleep 1 | ||
' | ||
|
||
test_expect_success 'flux-jobspec srun with just cores_per_task emits minimal jobspec' ' | ||
validate_minimal_emission srun -c4 sleep 1 | ||
' | ||
|
||
test_expect_success 'flux-jobspec srun without num_nodes emits valid canonical jobspec' ' | ||
validate_emission srun -n4 -c1 sleep 1 | ||
' | ||
|
||
test_expect_success 'flux-jobspec srun without num_nodes emits minimal jobspec' ' | ||
validate_minimal_emission srun -n4 -c1 sleep 1 | ||
' | ||
|
||
test_expect_success 'flux-jobspec srun with all args emits valid canonical jobspec' ' | ||
validate_emission srun -N4 -n4 -c1 sleep 1 | ||
' | ||
|
||
test_expect_success 'flux-jobspec srun with all args emits minimal jobspec' ' | ||
validate_minimal_emission srun -N4 -n4 -c1 sleep 1 | ||
' | ||
test_done |