diff --git a/t/issues/t1182-exclude-with-down-ranks.sh b/t/issues/t1182-exclude-with-down-ranks.sh new file mode 100755 index 000000000..176b75ee9 --- /dev/null +++ b/t/issues/t1182-exclude-with-down-ranks.sh @@ -0,0 +1,69 @@ +#!/bin/bash -e +# +# Ensure Fluxion marks all ranks down even if some ranks are excluded +# + +log() { printf "issue#1182: $@\n" >&2; } + +# Need a few ranks for this test, so start a new instance of size=4 +if test "$ISSUE_1182_ACTIVE" != "t"; then + export ISSUE_1182_ACTIVE=t + log "Re-launching test script under flux-start" + exec flux start -s 4 $0 +fi + +cat <<'EOF' >rcheck.py +import sys +import flux +from flux.resource.list import ResourceListRPC + +h = flux.Flux() + +rpc1 = ResourceListRPC(h, "resource.sched-status", nodeid=0) +rpc2 = ResourceListRPC(h, "sched.resource-status", nodeid=0) + +rset = rpc1.get() +fluxion = rpc2.get() + +def symmetric_diff(a, b): + return (a|b) - (a&b) + +diff = symmetric_diff(rset.down, fluxion.down) +if diff.ranks: + print("difference detected between fluxion and core down ranks:") + print(f"hosts: {diff.nodelist}") + print(f"ranks: {diff.ranks}") + sys.exit(1) +sys.exit(0) +EOF + +log "Unloading modules..." +flux module remove sched-simple +flux module remove resource + +# Exclude rank 0 +flux config load <