Skip to content

Commit 6936c5f

Browse files
grondomergify[bot]
authored andcommitted
testsuite: add tests for flux overlay status --highlight
Problem: No tests in the testsuite exercise the flux-overlay status -H, --highlight option. Add some basic tests of this option.
1 parent c99a3ed commit 6936c5f

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

t/t3303-system-healthcheck.t

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,33 @@ test_expect_success 'wait timeout of zero is not an immediate timeout' '
6969
flux overlay status --wait=full --summary --timeout=0
7070
'
7171

72+
test_expect_success 'flux overlay status --highlight option works (color)' '
73+
flux overlay status --highlight=14 --color=always > highlight.out &&
74+
grep "\[01;34" highlight.out > highlighted.out &&
75+
cat <<-EOF >highlighted.expected &&
76+
0 fake0: full
77+
└─ 2 fake2: full
78+
└─ 6 fake6: full
79+
└─ 14 fake14: full
80+
EOF
81+
test_cmp highlighted.expected highlighted.out
82+
'
83+
84+
test_expect_success 'flux overlay status --highlight option takes hostlist' '
85+
flux overlay status --highlight=fake[2,6] | grep "<<" > hl2.out &&
86+
cat <<-EOF >hl2.expected &&
87+
<<0 fake0>>: full
88+
└─ <<2 fake2>>: full
89+
└─ <<6 fake6>>: full
90+
EOF
91+
test_cmp hl2.expected hl2.out
92+
'
93+
94+
test_expect_success 'flux overlay status --highlight expected failures' '
95+
test_must_fail flux overlay status --highlight=0-16 &&
96+
test_must_fail flux overlay status --highlight=fake16
97+
'
98+
7299
test_expect_success 'stop broker 3 with children 7,8' '
73100
$startctl kill 3 15
74101
'

0 commit comments

Comments
 (0)