diff options
author | Cyril Bur <cyrilbur@gmail.com> | 2016-09-23 02:18:17 -0400 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2016-10-04 05:10:13 -0400 |
commit | 0886c6d4d21edc9902adfbf02e6e74916287ae04 (patch) | |
tree | 65ff38b586b85e597715af0c4f48c3ee01eb0bbc /tools | |
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')
-rw-r--r-- | tools/testing/selftests/powerpc/harness.c | 9 | ||||
-rw-r--r-- | tools/testing/selftests/powerpc/utils.h | 2 |
2 files changed, 8 insertions, 3 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 @@ | |||
19 | #include "subunit.h" | 19 | #include "subunit.h" |
20 | #include "utils.h" | 20 | #include "utils.h" |
21 | 21 | ||
22 | #define TIMEOUT 120 | ||
23 | #define KILL_TIMEOUT 5 | 22 | #define KILL_TIMEOUT 5 |
24 | 23 | ||
24 | static uint64_t timeout = 120; | ||
25 | 25 | ||
26 | int run_test(int (test_function)(void), char *name) | 26 | int run_test(int (test_function)(void), char *name) |
27 | { | 27 | { |
@@ -44,7 +44,7 @@ int run_test(int (test_function)(void), char *name) | |||
44 | setpgid(pid, pid); | 44 | setpgid(pid, pid); |
45 | 45 | ||
46 | /* Wake us up in timeout seconds */ | 46 | /* Wake us up in timeout seconds */ |
47 | alarm(TIMEOUT); | 47 | alarm(timeout); |
48 | terminated = false; | 48 | terminated = false; |
49 | 49 | ||
50 | wait: | 50 | wait: |
@@ -94,6 +94,11 @@ static struct sigaction alarm_action = { | |||
94 | .sa_handler = alarm_handler, | 94 | .sa_handler = alarm_handler, |
95 | }; | 95 | }; |
96 | 96 | ||
97 | void test_harness_set_timeout(uint64_t time) | ||
98 | { | ||
99 | timeout = time; | ||
100 | } | ||
101 | |||
97 | int test_harness(int (test_function)(void), char *name) | 102 | int test_harness(int (test_function)(void), char *name) |
98 | { | 103 | { |
99 | int rc; | 104 | int rc; |
diff --git a/tools/testing/selftests/powerpc/utils.h b/tools/testing/selftests/powerpc/utils.h index ecd11b51475d..53405e8a52ab 100644 --- a/tools/testing/selftests/powerpc/utils.h +++ b/tools/testing/selftests/powerpc/utils.h | |||
@@ -22,7 +22,7 @@ typedef uint32_t u32; | |||
22 | typedef uint16_t u16; | 22 | typedef uint16_t u16; |
23 | typedef uint8_t u8; | 23 | typedef uint8_t u8; |
24 | 24 | ||
25 | 25 | void test_harness_set_timeout(uint64_t time); | |
26 | int test_harness(int (test_function)(void), char *name); | 26 | int test_harness(int (test_function)(void), char *name); |
27 | extern void *get_auxv_entry(int type); | 27 | extern void *get_auxv_entry(int type); |
28 | int pick_online_cpu(void); | 28 | int pick_online_cpu(void); |