/
t0021-flux-jobspec.t
executable file
·59 lines (44 loc) · 1.75 KB
/
t0021-flux-jobspec.t
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
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