Skip to content

Commit f74c170

Browse files
committed
t: add Flux instance tests for rv1_shorthand
Problem: there are no tests for the rv1_shorthand format being used by a Flux instance, only by the resource-query utility. Add tests.
1 parent ceb5ebe commit f74c170

File tree

1 file changed

+51
-2
lines changed

1 file changed

+51
-2
lines changed

t/t1029-resource-force-load-format.t

Lines changed: 51 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ test_description='Test the rv1exec_force load format'
77
echo \
88
'#!/bin/sh
99
10+
set -e
11+
1012
flux module remove -f sched-simple &&
1113
flux module remove -f sched-fluxion-qmanager &&
1214
flux module remove -f sched-fluxion-resource &&
@@ -17,11 +19,26 @@ flux module load sched-fluxion-resource load-format="${1}" &&
1719
flux module load sched-fluxion-qmanager
1820
' > load_nonsense_scheduling_key.sh
1921

20-
chmod +x load_nonsense_scheduling_key.sh
22+
echo \
23+
'#!/bin/sh
24+
25+
set -e
26+
27+
flux module remove -f sched-simple &&
28+
flux module remove -f sched-fluxion-qmanager &&
29+
flux module remove -f sched-fluxion-resource &&
30+
flux module reload resource &&
31+
flux module load sched-fluxion-resource &&
32+
flux module load sched-fluxion-qmanager &&
33+
flux module list
34+
$@
35+
' > load_fluxion.sh
36+
37+
chmod +x load_nonsense_scheduling_key.sh load_fluxion.sh
2138

2239
test_under_flux 2
2340

24-
test_expect_success 'load resource with load-format-rv1exec_force' '
41+
test_expect_success 'load resource with load-format=rv1exec_force' '
2542
flux module remove -f sched-simple &&
2643
reload_resource load-format=rv1exec_force &&
2744
reload_qmanager
@@ -43,6 +60,38 @@ test_expect_success 'without rv1exec_force, job fails' '
4360
flux job attach $(flux job last) 2>&1 | grep "module exiting abnormally"
4461
'
4562

63+
test_expect_success 'load resource with match-format=rv1_shorthand' '
64+
reload_resource load-format=rv1exec_force match-format=rv1_shorthand &&
65+
reload_qmanager
66+
'
67+
68+
test_expect_success 'jobs run with shorthand jgf' '
69+
jobid=$(flux submit -n1 true) &&
70+
flux job wait-event -vt 5 ${jobid} alloc &&
71+
flux job info ${jobid} R | jq -e ".scheduling.graph.metadata.complete == true" &&
72+
flux job attach ${jobid} &&
73+
jobid=$(flux submit -N1 true) &&
74+
flux job wait-event -vt 5 ${jobid} alloc &&
75+
flux job info ${jobid} R | jq -e ".scheduling.graph.metadata.complete == false" &&
76+
flux job attach ${jobid}
77+
'
78+
79+
test_expect_success 'flux instances started with shorthand jgf can run jobs' '
80+
flux alloc -t5s -N1 ./load_fluxion.sh flux run -n1 -c1 echo hello &&
81+
flux job attach $(flux job last) &&
82+
flux job info $(flux job last) R | jq -e ".scheduling.graph.metadata.complete == false" &&
83+
flux job info $(flux job last) R | jq .scheduling.graph | test_must_fail grep core
84+
'
85+
86+
test_expect_success 'scheduler can be reloaded with jgf_shorthand jobs' '
87+
jobid=$(flux submit -t15s -N1 flux start ./load_fluxion.sh sleep 10) &&
88+
reload_resource load-format=rv1exec_force match-format=rv1_shorthand &&
89+
reload_qmanager &&
90+
flux cancel ${jobid} &&
91+
flux job info ${jobid} R | jq -e ".scheduling.graph.metadata.complete == false" &&
92+
flux job info ${jobid} R | jq .scheduling.graph | test_must_fail grep core
93+
'
94+
4695
test_expect_success 'remove manually loaded modules' '
4796
remove_qmanager && remove_resource
4897
'

0 commit comments

Comments
 (0)