Skip to content

Commit 6e1c779

Browse files
committed
testsuite: add coverage for instance size override
Problem: there is no test coverage for broker bootstrap with a PMI size less than the actual size. Add some tests.
1 parent aff2d5f commit 6e1c779

File tree

2 files changed

+53
-0
lines changed

2 files changed

+53
-0
lines changed

t/Makefile.am

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ TESTSCRIPTS = \
9595
t0022-jj-reader.t \
9696
t0023-jobspec1-validate.t \
9797
t0026-flux-R.t \
98+
t0033-size-override.t \
9899
t1000-kvs.t \
99100
t1001-kvs-internals.t \
100101
t1003-kvs-stress.t \

t/t0033-size-override.t

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
#!/bin/sh
2+
#
3+
4+
test_description='Test instance size override'
5+
6+
. `dirname $0`/sharness.sh
7+
8+
test_expect_success 'size override fails if too small' '
9+
test_must_fail flux broker \
10+
-Sbroker.rc1_path= -Sbroker.rc3_path= \
11+
-Ssize=1,-Sbroker.quorum=1 /bin/true 2>toosmall.err &&
12+
grep "may only be increased" toosmall.err
13+
'
14+
test_expect_success 'an instance can be started with an extra rank' '
15+
flux broker \
16+
-Sbroker.rc1_path= -Sbroker.rc3_path= \
17+
-Ssize=2 -Sbroker.quorum=1 \
18+
flux overlay status --no-pretty >overlay.out
19+
'
20+
test_expect_success 'flux overlay status shows the extra rank offline' '
21+
grep "1 extra0: offline" overlay.out
22+
'
23+
test_expect_success 'an instance can be started with PMI plus extra' '
24+
flux start -s2 -o,-Stbon.topo=kary:0 \
25+
-o,-Sbroker.rc1_path=,-Sbroker.rc3_path= \
26+
-o,-Ssize=3,-Sbroker.quorum=2 \
27+
flux overlay status --no-pretty >overlay2.out
28+
'
29+
test_expect_success 'flux overlay status shows the extra rank offline' '
30+
grep "2 extra0: offline" overlay2.out
31+
'
32+
test_expect_success 'create config with fake resources' '
33+
cat >fake.toml <<-EOT
34+
[resource]
35+
noverify = true
36+
[[resource.config]]
37+
hosts = "a,b,c"
38+
cores = "0"
39+
EOT
40+
'
41+
test_expect_success 'start full 2-broker instance with one extra rank' '
42+
flux start -s2 -o,-Ssize=3,-Sbroker.quorum=2,-cfake.toml \
43+
flux resource status -s offline -no {nnodes} >offline.out
44+
'
45+
test_expect_success 'flux resource status reports one node offline' '
46+
cat >offline.exp <<-EOT &&
47+
1
48+
EOT
49+
test_cmp offline.exp offline.out
50+
'
51+
52+
test_done

0 commit comments

Comments
 (0)