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