Skip to content

Commit 0a20853

Browse files
committed
testsuite: ensure empty sets in resource list include queue names
Problem: There are no tests that ensure `flux resource list` includes queue names (if configured) in output when there are no resources in a given state. Add some tests to t2350-resource-list.t.
1 parent 34545a7 commit 0a20853

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

t/t2350-resource-list.t

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -541,6 +541,32 @@ test_expect_success 'flux resource list --queue works for a queue with no constr
541541
test $(grep "allocated 1" queue-every.out | grep -c debug) -eq 1 &&
542542
test $(grep "allocated 1" queue-every.out | grep -c every) -eq 2
543543
'
544+
test_expect_success 'flux resource list includes queue names for empty sets' '
545+
# There are no nodes in 'down' state in this test, so use that:
546+
flux resource list -s down -no "{queue} {state} {nnodes}" \
547+
>queue-empty1.out &&
548+
cat <<-EOF >queue-empty1.expected &&
549+
every down 0
550+
batch down 0
551+
debug down 0
552+
EOF
553+
test_cmp queue-empty1.expected queue-empty1.out
554+
'
555+
test_expect_success 'flux resource list includes queue names for empty sets (single)' '
556+
flux resource list -q batch -s down -no "{queue} {state} {nnodes}" \
557+
>queue-batch-down.out &&
558+
cat <<-EOF >queue-batch-down.expected &&
559+
batch down 0
560+
EOF
561+
test_cmp queue-batch-down.expected queue-batch-down.out
562+
'
563+
test_expect_success 'flux resource list includes queue names for empty sets (multiple)' '
564+
flux resource list -q batch,debug \
565+
-s down -no "{queue} {state} {nnodes}" \
566+
>queue-batch,debug-down.out &&
567+
grep "debug down 0" queue-batch,debug-down.out &&
568+
grep "batch down 0" queue-batch,debug-down.out
569+
'
544570
test_expect_success 'cleanup jobs' '
545571
flux cancel $(cat job2A.id) $(cat job2B.id)
546572
'

0 commit comments

Comments
 (0)