|
| 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