Skip to content

Commit 8e54977

Browse files
committed
testsuite: add flux ion-resource tests
1 parent 3c5fcd9 commit 8e54977

File tree

2 files changed

+48
-0
lines changed

2 files changed

+48
-0
lines changed

t/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ set(ALL_TESTS
8585
t4011-match-duration.t
8686
t4012-set-status.t
8787
t4013-unreservable.sh
88+
t4014-match-grow.t
8889
t5000-valgrind.t
8990
t5100-issues-test-driver.t
9091
t6000-graph-size.t

t/t4014-match-grow.t

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#!/bin/sh
2+
#set -x
3+
4+
test_description='Test the basic functionality of resource-match-grow-allocation
5+
6+
Ensure that the match (allocate) handler within the resource module works
7+
'
8+
9+
. `dirname $0`/sharness.sh
10+
11+
grug="${SHARNESS_TEST_SRCDIR}/data/resource/grugs/tiny.graphml"
12+
jobspec="${SHARNESS_TEST_SRCDIR}/data/resource/jobspecs/basics/test001.yaml"
13+
14+
#
15+
# test_under_flux is under sharness.d/
16+
#
17+
test_under_flux 1
18+
19+
#
20+
# print only with --debug
21+
#
22+
test_debug '
23+
echo ${grug} &&
24+
echo ${jobspec}
25+
'
26+
27+
test_expect_success 'loading resource module with a tiny machine config works' '
28+
load_resource \
29+
load-file=${grug} prune-filters=ALL:core \
30+
load-format=grug subsystems=containment policy=high
31+
'
32+
33+
test_expect_success 'match-grow works with a 1-node, 1-socket jobspec' '
34+
output=$( flux ion-resource match allocate ${jobspec} ) &&
35+
jobid=$(echo ${output} | awk "{print \$6}") &&
36+
flux ion-resource match grow_allocation ${jobspec} ${jobid}
37+
'
38+
39+
test_expect_failure 'match-grow fails with nonexistent jobid' '
40+
flux ion-resource match grow_allocation ${jobspec} 10000000
41+
'
42+
43+
test_expect_success 'removing resource works' '
44+
remove_resource
45+
'
46+
47+
test_done

0 commit comments

Comments
 (0)