mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-21 22:53:37 +00:00
run: Use timeout --foreground option.
If timeout doesn't have this option (RHEL 6) don't use timeout at all. Attempt to fix RHBZ#1025269.
This commit is contained in:
10
run.in
10
run.in
@@ -219,7 +219,6 @@ fi
|
||||
# test fails
|
||||
# - print how long it takes to run the test
|
||||
# - timeout if the test takes too long to run
|
||||
# - don't use timeout on RHEL 6 because it's broken (RHBZ#1025269)
|
||||
|
||||
# Originally 1h, but that is not long enough to run the C API
|
||||
# tests on Koji.
|
||||
@@ -228,9 +227,12 @@ timeout_kill=30s
|
||||
|
||||
# Do we have Padraig's timeout utility (from coreutils)?
|
||||
if timeout --help >/dev/null 2>&1; then
|
||||
# Does this version of timeout have the -k option? (Not on RHEL 6)
|
||||
if timeout -k 10s 10s true >/dev/null 2>&1; then
|
||||
timeout="timeout -k $timeout_kill $timeout_period"
|
||||
# Must use the --foreground option (RHBZ#1025269).
|
||||
if timeout --foreground 2 sleep 0 >/dev/null 2>&1; then
|
||||
# Does this version of timeout have the -k option? (Not on RHEL 6)
|
||||
if timeout -k 10s 10s true >/dev/null 2>&1; then
|
||||
timeout="timeout -k $timeout_kill $timeout_period"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user