diff options
author | Cyril Bur | 2016-09-23 16:18:17 +1000 |
---|---|---|
committer | Michael Ellerman | 2016-10-04 20:10:13 +1100 |
commit | 0886c6d4d21edc9902adfbf02e6e74916287ae04 (patch) | |
tree | 65ff38b586b85e597715af0c4f48c3ee01eb0bbc /tools/testing/selftests/powerpc/harness.c | |
parent | babcd9c4b3e8d271144da4b2b412c3b9991b35d2 (diff) |
selftests/powerpc: Allow tests to extend their kill timeout
Signed-off-by: Cyril Bur <cyrilbur@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'tools/testing/selftests/powerpc/harness.c')
-rw-r--r-- | tools/testing/selftests/powerpc/harness.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/tools/testing/selftests/powerpc/harness.c b/tools/testing/selftests/powerpc/harness.c index 52f9be7f61f0..248a820048df 100644 --- a/tools/testing/selftests/powerpc/harness.c +++ b/tools/testing/selftests/powerpc/harness.c @@ -19,9 +19,9 @@ #include "subunit.h" #include "utils.h" -#define TIMEOUT 120 #define KILL_TIMEOUT 5 +static uint64_t timeout = 120; int run_test(int (test_function)(void), char *name) { @@ -44,7 +44,7 @@ int run_test(int (test_function)(void), char *name) setpgid(pid, pid); /* Wake us up in timeout seconds */ - alarm(TIMEOUT); + alarm(timeout); terminated = false; wait: @@ -94,6 +94,11 @@ static struct sigaction alarm_action = { .sa_handler = alarm_handler, }; +void test_harness_set_timeout(uint64_t time) +{ + timeout = time; +} + int test_harness(int (test_function)(void), char *name) { int rc; |