Skip to content

Commit fa44b9a

Browse files
committed
fix(test): add run_go_fdo_client helper to handle RPM vs native path differences
The go-fdo-client path differs between native tests (./workdir/bin/go-fdo-client) and RPM tests (/usr/bin/go-fdo-client). This adds a wrapper function to standardize client invocation across test environments, with timeout handling and improved error logging. Assisted-by: Claude Sonnet 4.5 <noreply@anthropic.com> Signed-off-by: Miguel Martín <mmartinv@redhat.com>
1 parent 4effcf5 commit fa44b9a

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

test/rpm/utils.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,17 @@ uninstall_client() {
228228
}
229229
}
230230

231+
run_go_fdo_client() {
232+
# If the command times out, the return code is 124 (see: man timeout)
233+
# If the command finishes before the timeout, the return code comes from 'go-fdo-client'
234+
local exit_code=0
235+
timeout "${client_timeout}" "/usr/bin/go-fdo-client" "$@" || exit_code=$?
236+
if [[ ${exit_code} -ne 0 ]]; then
237+
log_warn "'go-fdo-client' exited with '${exit_code}' (124 -> timeout):\n - go-fdo-client $*"
238+
fi
239+
return ${exit_code}
240+
}
241+
231242
install_server() {
232243
# If PACKIT_COPR_RPMS is not defined it means we are running the test
233244
# locally so we will build and install the RPMs from the *committed* code

0 commit comments

Comments
 (0)