Some unit tests weren't initializing the birdloop, trying to write the
birdloop ping into stdin. Fixed this and also forced stdin close on
startup of every test just to be sure that CI and local build behave the
same in this. (CI was failing on this while local build not.)
int i;
olock_init();
- birdloop_init();
rt_init();
io_init();
if_init();
{
bt_init(argc, argv);
- the_bird_lock();
bt_test_suite(t_ev_run_list, "Schedule and run 3 events in right order.");
- the_bird_unlock();
return bt_exit_value();
}
{
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;
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, &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:
log_init_debug("");
log_switch(bt_verbose != 0, NULL, NULL);
- the_bird_lock();
olock_init();
- birdloop_init();
rt_init();
io_init();
if_init();