Skip to content

Commit 93d2de0

Browse files
grondomergify[bot]
authored andcommitted
testuite: test hidden batch/alloc --add-brokers option
Problem: The --add-brokers option to flux-batch and alloc is not tested. Add a couple simple tests to t2714-python-cli-batch.t.
1 parent 7ba8f98 commit 93d2de0

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

t/t2714-python-cli-batch.t

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,4 +272,32 @@ test_expect_success 'flux batch: multiline --add-file requires name=' '
272272
test_must_fail flux batch --dry-run directives6.sh >d6.out 2>&1 &&
273273
grep "file name missing" d6.out
274274
'
275+
test_expect_success 'flux batch: hidden --add-brokers option requires -N' '
276+
test_must_fail flux batch -n4 --add-brokers=1 --dry-run --wrap true
277+
'
278+
test_expect_success 'flux batch: hidden --add-brokers option works' '
279+
cat <<-EOF >add-brokers.sh &&
280+
#!/bin/sh
281+
# flux: -N4 --output=add-brokers.out --error=add-brokers.err
282+
# flux: --conf=tbon.topo=kary:2
283+
# flux: --add-brokers=2
284+
#
285+
flux resource list -s free -no {nnodes}
286+
flux resource status -s exclude -no {ranks}
287+
flux exec -lr 1-2 flux getattr tbon.parent-endpoint \
288+
| sed s#://.*## | sort
289+
flux run -N4 true
290+
EOF
291+
cat <<-EOF >add-brokers.expected &&
292+
4
293+
1-2
294+
1: ipc
295+
2: ipc
296+
EOF
297+
id=$(flux batch add-brokers.sh) &&
298+
flux job wait-event $id clean &&
299+
test_debug "cat add-brokers.err" &&
300+
test_debug "cat add-brokers.out" &&
301+
test_cmp add-brokers.expected add-brokers.out
302+
'
275303
test_done

0 commit comments

Comments
 (0)