Currently, a VM is allowed to run at hard-coded 10mins at maximum. In
cases where the tests are running inside Github or Gitlab's CI testing
machines, it takes much longer time. Make it configurable by the
KUMP_TEST_QEMU_TIMEOUT environment variable.
Signed-off-by: Coiby Xu <coxu(a)redhat.com>
---
tests/scripts/test-lib.sh | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/tests/scripts/test-lib.sh b/tests/scripts/test-lib.sh
index 8b24b2a..667cce0 100644
--- a/tests/scripts/test-lib.sh
+++ b/tests/scripts/test-lib.sh
@@ -86,10 +86,16 @@ build_test_image() {
}
run_test_sync() {
- local qemu_cmd=$(get_test_qemu_cmd $1)
+ local qemu_cmd=$(get_test_qemu_cmd $1) _timeout
+
+ if [[ $KUMP_TEST_QEMU_TIMEOUT ]]; then
+ _timeout=$KUMP_TEST_QEMU_TIMEOUT
+ else
+ _timeout=10m
+ fi
if [ -n "$qemu_cmd" ]; then
- timeout --foreground 10m $BASEDIR/run-qemu $(get_test_qemu_cmd $1)
+ timeout --foreground $_timeout $BASEDIR/run-qemu $(get_test_qemu_cmd $1)
else
echo "error: test qemu command line is not configured" > /dev/stderr
return 1
--
2.37.1