Commit 0886c6d4 authored by Cyril Bur's avatar Cyril Bur Committed by Michael Ellerman

selftests/powerpc: Allow tests to extend their kill timeout

Signed-off-by: default avatarCyril Bur <cyrilbur@gmail.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent babcd9c4
......@@ -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;
......
......@@ -22,7 +22,7 @@ typedef uint32_t u32;
typedef uint16_t u16;
typedef uint8_t u8;
void test_harness_set_timeout(uint64_t time);
int test_harness(int (test_function)(void), char *name);
extern void *get_auxv_entry(int type);
int pick_online_cpu(void);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment