From abfe6963d2a4cf4bd1288e238824ba96f7473fa3 Mon Sep 17 00:00:00 2001 From: Jeremy Lakeman Date: Mon, 27 May 2013 13:42:18 +0930 Subject: [PATCH] Wait for servald daemon to enter main loop for more reliable tests --- overlay.c | 4 +++- testdefs.sh | 1 + tests/dnahelper | 3 --- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/overlay.c b/overlay.c index 181e3ab4..c32cc9a6 100644 --- a/overlay.c +++ b/overlay.c @@ -156,7 +156,9 @@ schedule(&_sched_##X); } SCHEDULE(fd_periodicstats, 3000, 500); #undef SCHEDULE - + + // log message used by tests to wait for the server to start + INFO("Server started, entering main loop"); /* Check for activitiy and respond to it */ while(fd_poll()); diff --git a/testdefs.sh b/testdefs.sh index a20bf006..19091fd3 100644 --- a/testdefs.sh +++ b/testdefs.sh @@ -283,6 +283,7 @@ start_servald_server() { assert --message="a new servald process is running" --dump-on-fail="$instance_servald_log" [ -n "$new_pids" ] assert --message="servald pidfile process is running" --dump-on-fail="$instance_servald_log" $pidfile_running assert --message="servald log file $instance_servald_log is present" [ -r "$instance_servald_log" ] + wait_until grep -q "Server started" "$instance_servald_log" tfw_log "# Started servald server process $instance_name, pid=$servald_pid" pop_instance } diff --git a/tests/dnahelper b/tests/dnahelper index e291dfbe..78ad6c31 100755 --- a/tests/dnahelper +++ b/tests/dnahelper @@ -26,7 +26,6 @@ setup() { assert_no_servald_processes setup_dnahelper start_servald_instances +A - assert_all_instance_peers_complete +A } finally() { @@ -229,7 +228,6 @@ setup_ExecError() { dnahelper=/non/existent assert [ ! -e "$dnahelper" ] start_servald_instances +A - assert_all_instance_peers_complete +A } test_ExecError() { executeOk_servald dna lookup 12345 @@ -255,7 +253,6 @@ done EOF chmod 0755 "$dnahelper" start_servald_instances +A - assert_all_instance_peers_complete +A } test_ExecArgs() { executeOk_servald dna lookup 12345