Skip to content

Commit 9c1b48d

Browse files
committed
testsuite: add reproducer for issue #5266
Problem: The flux-resource tests in the testsuite don't include a reproducer for issue #5266: --include=HOSTS is incorrect when some ranks are excluded by configuration. Add a reproducer for this issue and ensure the correct hosts are selected by the -i, --include option.
1 parent e037b01 commit 9c1b48d

File tree

1 file changed

+79
-0
lines changed

1 file changed

+79
-0
lines changed

t/t2350-resource-list.t

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,85 @@ test_expect_success 'flux-resource list: --include works with hostnames' '
103103
test_debug "cat include-hosts.out" &&
104104
grep "^2 pi\[3,0\]" include-hosts.out
105105
'
106+
test_expect_success 'flux-resource list: -i works with excluded hosts #5266' '
107+
cat <<-'EOF' >corona.json &&
108+
{
109+
"all": {
110+
"execution": {
111+
"R_lite": [
112+
{
113+
"children": {
114+
"core": "0-47",
115+
"gpu": "0-7"
116+
},
117+
"rank": "4-124"
118+
}
119+
],
120+
"expiration": 0,
121+
"nodelist": [
122+
"corona[171-207,213-296]"
123+
],
124+
"properties": {
125+
"pbatch": "20-124",
126+
"pdebug": "4-19"
127+
},
128+
"starttime": 0
129+
},
130+
"version": 1
131+
},
132+
"allocated": {
133+
"execution": {
134+
"R_lite": [
135+
{
136+
"children": {
137+
"core": "0-47",
138+
"gpu": "0-7"
139+
},
140+
"rank": "20-27,29-34,36-75,78-84,86-87,90-97,99-111,113-124"
141+
}
142+
],
143+
"expiration": 0,
144+
"nodelist": [
145+
"corona[187-194,196-201,203-207,213-247,250-256,258-259,262-269,271-283,285-296]"
146+
],
147+
"properties": {
148+
"pbatch": "20-27,29-34,36-75,78-84,86-87,90-97,99-111,113-124"
149+
},
150+
"starttime": 0
151+
},
152+
"version": 1
153+
},
154+
"down": {
155+
"execution": {
156+
"R_lite": [
157+
{
158+
"children": {
159+
"core": "0-47",
160+
"gpu": "0-7"
161+
},
162+
"rank": "5,9,28,35,76-77,85,88-89,98,112"
163+
}
164+
],
165+
"expiration": 0,
166+
"nodelist": [
167+
"corona[172,176,195,202,248-249,257,260-261,270,284]"
168+
],
169+
"properties": {
170+
"pbatch": "28,35,76-77,85,88-89,98,112",
171+
"pdebug": "5,9"
172+
},
173+
"starttime": 0
174+
},
175+
"version": 1
176+
}
177+
}
178+
EOF
179+
NODELIST="corona[176,249,260-261,270,284]" &&
180+
flux resource list -s all -o "{nodelist}" -ni $NODELIST \
181+
--from-stdin < corona.json >corona.output &&
182+
test_debug "cat corona.output" &&
183+
test "$(cat corona.output)" = "$NODELIST"
184+
'
106185
test_expect_success 'flux-resource list: --include works with invalid host' '
107186
flux resource list -s all -o "{nnodes} {nodelist}" -ni pi7 \
108187
--from-stdin < $INPUT >include-invalid-hosts.out &&

0 commit comments

Comments
 (0)