Skip to content

Commit 0473502

Browse files
runcomclaude
andcommitted
Fix trap causing test_fail when skipping delegate tests
Disable EXIT trap before calling test_pass and exiting when FDO 2.0 is not supported. The trap on_failure was being called on exit 0, incorrectly reporting the test as failed after it was marked as passed. Fixes spurious test failures in CI when delegate tests are skipped. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent ee72ce4 commit 0473502

3 files changed

Lines changed: 3 additions & 0 deletions

File tree

test/ci/test-delegate-invalid-chain.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ run_test() {
2323
log_info "Checking if client supports FDO 2.0"
2424
if ! "${bin_dir}/go-fdo-client" onboard --help 2>&1 | grep -q "fdo-version"; then
2525
log_warn "Client does not support --fdo-version flag, skipping FDO 2.0 delegate test"
26+
trap - EXIT
2627
test_pass
2728
exit 0
2829
fi

test/ci/test-delegate-onboarding.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ run_test() {
5555
log_info "Checking if client supports FDO 2.0"
5656
if ! "${bin_dir}/go-fdo-client" onboard --help 2>&1 | grep -q "fdo-version"; then
5757
log_warn "Client does not support --fdo-version flag, skipping FDO 2.0 delegate test"
58+
trap - EXIT
5859
test_pass
5960
exit 0
6061
fi

test/ci/test-delegate-permissions.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ run_test() {
1919
log_info "Checking if client supports FDO 2.0"
2020
if ! "${bin_dir}/go-fdo-client" onboard --help 2>&1 | grep -q "fdo-version"; then
2121
log_warn "Client does not support --fdo-version flag, skipping FDO 2.0 delegate test"
22+
trap - EXIT
2223
test_pass
2324
exit 0
2425
fi

0 commit comments

Comments
 (0)