Skip to content

Commit be1b5a4

Browse files
committed
t2802-uri-cmd.t: add test for PID resolver on broker with no child
Problem: The URI resolver tests do not exercise an error condition where the PID target is a flux-broker with no children. This let a bug creep through undetected. Add a test to ensure that the PID URI resolver on a flux-broker process with no children raises an error such as: flux-uri: ERROR: PID 28628 is a flux-broker and no child found
1 parent c66f1e9 commit be1b5a4

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

t/t2802-uri-cmd.t

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ test_description='Test flux uri command'
44

55
. $(dirname $0)/sharness.sh
66

7-
test_under_flux 1
7+
test_under_flux 2
88

99
testssh="${SHARNESS_TEST_SRCDIR}/scripts/tssh"
1010

@@ -51,6 +51,11 @@ test_expect_success 'flux-uri pid resolver works on flux-broker with fallback' '
5151
test "$(flux uri pid:$(flux getattr broker.pid))" = "$FLUX_URI"
5252
)
5353
'
54+
test_expect_success 'flux-uri pid resolver fails if broker has no child' '
55+
test_must_fail flux uri pid:$(flux exec -r 1 flux getattr broker.pid) \
56+
>broker-no-child.out 2>&1 &&
57+
grep "is a flux-broker and no child found" broker-no-child.out
58+
'
5459
test_expect_success 'flux-uri pid resolver fails for nonexistent pid' '
5560
test_expect_code 1 flux uri pid:123456
5661
'

0 commit comments

Comments
 (0)