Skip to content

Commit 8b53824

Browse files
committed
t: add tests for rv1exec_force load format
Problem: there are no tests for the `rv1exec_force` load format. Add basic sanity checks.
1 parent 88c6752 commit 8b53824

File tree

2 files changed

+51
-0
lines changed

2 files changed

+51
-0
lines changed

t/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ set(ALL_TESTS
3131
t1026-rv1-partial-release.t
3232
t1027-rv1-partial-release-brokerless-resources.t
3333
t1028-rv1-partial-release-across-racks.t
34+
t1029-resource-force-load-format.t
3435
t2317-resource-shrink.t
3536
t3000-jobspec.t
3637
t3001-resource-basic.t
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
#!/bin/sh
2+
3+
test_description='Test the rv1exec_force load format'
4+
5+
. $(dirname $0)/sharness.sh
6+
7+
echo \
8+
'#!/bin/sh
9+
10+
flux module remove -f sched-simple &&
11+
flux module remove -f sched-fluxion-qmanager &&
12+
flux module remove -f sched-fluxion-resource &&
13+
flux kvs get resource.R | jq ".scheduling = \"nonsense\"" > local_R &&
14+
flux kvs put resource.R="$(cat local_R)" &&
15+
flux module reload resource &&
16+
flux module load sched-fluxion-resource load-format="${1}" &&
17+
flux module load sched-fluxion-qmanager
18+
' > load_nonsense_scheduling_key.sh
19+
20+
chmod +x load_nonsense_scheduling_key.sh
21+
22+
test_under_flux 2
23+
24+
test_expect_success 'load resource with load-format-rv1exec_force' '
25+
flux module remove -f sched-simple &&
26+
reload_resource load-format=rv1exec_force &&
27+
reload_qmanager
28+
'
29+
30+
test_expect_success 'init Fluxion with nonsense in R .scheduling key' '
31+
./load_nonsense_scheduling_key.sh rv1exec_force
32+
'
33+
34+
test_expect_success 'job can run' '
35+
jobid=$(flux submit -n1 true) &&
36+
flux job wait-event -vt 5 ${jobid} clean &&
37+
flux module list | grep sched-fluxion-resource
38+
'
39+
40+
test_expect_success 'without rv1exec_force, job fails' '
41+
test_must_fail flux alloc -t5s -N1 -n1 ./load_nonsense_scheduling_key.sh rv1exec &&
42+
flux job attach $(flux job last) 2>&1 | grep -e grow_resource_db_jgf -e "Invalid argument" &&
43+
flux job attach $(flux job last) 2>&1 | grep "module exiting abnormally"
44+
'
45+
46+
test_expect_success 'remove manually loaded modules' '
47+
remove_qmanager && remove_resource
48+
'
49+
50+
test_done

0 commit comments

Comments
 (0)