summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/birdtest.c10
-rw-r--r--test/birdtest.h2
-rw-r--r--test/bt-utils.c4
3 files changed, 12 insertions, 4 deletions
diff --git a/test/birdtest.c b/test/birdtest.c
index ae05d1a5..5e3de1c5 100644
--- a/test/birdtest.c
+++ b/test/birdtest.c
@@ -21,6 +21,7 @@
#include "test/birdtest.h"
#include "lib/string.h"
#include "lib/event.h"
+#include "lib/io-loop.h"
#ifdef HAVE_EXECINFO_H
#include <execinfo.h>
@@ -64,6 +65,9 @@ bt_init(int argc, char *argv[])
{
int c;
+ /* We have no interest in stdin */
+ close(0);
+
initstate(BT_RANDOM_SEED, (char *) bt_random_state, sizeof(bt_random_state));
bt_verbose = 0;
@@ -120,9 +124,11 @@ bt_init(int argc, char *argv[])
clock_gettime(CLOCK_MONOTONIC, &bt_begin);
bt_suite_case_begin = bt_suite_begin = bt_begin;
+ the_bird_lock();
resource_init();
- ev_init_list(&global_event_list);
-
+ ev_init_list(&global_event_list, &main_birdloop, "Global event list in unit tests");
+ ev_init_list(&global_work_list, &main_birdloop, "Global work list in unit tests");
+ birdloop_init();
return;
usage:
diff --git a/test/birdtest.h b/test/birdtest.h
index ad5f8f9c..b8978b3e 100644
--- a/test/birdtest.h
+++ b/test/birdtest.h
@@ -40,7 +40,7 @@ static inline u64 bt_random(void)
void bt_log_suite_result(int result, const char *fmt, ...);
void bt_log_suite_case_result(int result, const char *fmt, ...);
-#define BT_TIMEOUT 5 /* Default timeout in seconds */
+#define BT_TIMEOUT 20 /* Default timeout in seconds */
#define BT_FORKING 1 /* Forking is enabled in default */
#define BT_RANDOM_SEED 0x5097d2bb
diff --git a/test/bt-utils.c b/test/bt-utils.c
index 509b5ed4..36e44da4 100644
--- a/test/bt-utils.c
+++ b/test/bt-utils.c
@@ -53,6 +53,8 @@ cf_file_read(byte *dest, uint max_len, int fd)
return l;
}
+void resource_sys_init(void);
+
void
bt_bird_init(void)
{
@@ -61,7 +63,6 @@ bt_bird_init(void)
log_switch(bt_verbose != 0, NULL, NULL);
olock_init();
- timer_init();
rt_init();
io_init();
if_init();
@@ -73,6 +74,7 @@ bt_bird_init(void)
void bt_bird_cleanup(void)
{
config = new_config = NULL;
+ the_bird_unlock();
}
static char *