From fe68177097a6da4cbdde259e03724950c52ae22d Mon Sep 17 00:00:00 2001 From: Thomas D Date: Fri, 13 Feb 2015 02:02:47 +0100 Subject: [PATCH] Test services should log into their own log file Each test has a general log file in the following schema: remotebackend_.log When testrunner.sh spins up a service, the service logs its output into the general log file. But test-driver from automake, which is using the same log file and starts after the test service is up and running, will overwrite the log file. So in case of a server failure we will miss important log data. Using a dedicated log file for the services we start will solve this problem. The new schema for server log files will be remotebackend__server.log --- modules/remotebackend/Makefile.am | 7 +++++++ modules/remotebackend/testrunner.sh | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/modules/remotebackend/Makefile.am b/modules/remotebackend/Makefile.am index c6b0cd6147..4aa0a548bb 100644 --- a/modules/remotebackend/Makefile.am +++ b/modules/remotebackend/Makefile.am @@ -71,6 +71,13 @@ TESTS = \ remotebackend_json.test \ remotebackend_zeromq.test +RECHECK_LOGS = \ + $(TEST_LOGS) \ + remotebackend_http_server.log \ + remotebackend_post_server.log \ + remotebackend_json_server.log \ + remotebackend_zeromq_server.log + ## The http, post and json test are using the same TCP port. ## To prevent "Address already in use - bind(2) (Errno::EADDRINUSE)" ## errors when running `make check` in parallel, we need to specify diff --git a/modules/remotebackend/testrunner.sh b/modules/remotebackend/testrunner.sh index cf2b8c05fe..ae4aa8e517 100755 --- a/modules/remotebackend/testrunner.sh +++ b/modules/remotebackend/testrunner.sh @@ -22,7 +22,7 @@ zeromq_pid="" socat=$(which socat) function start_web() { - ./unittest_$1.rb >> $mode.log 2>&1 & + ./unittest_$1.rb >> ${mode%\.test}_server.log 2>&1 & webrick_pid=$! loopcount=0 while [ $loopcount -lt 20 ]; do @@ -49,7 +49,7 @@ function stop_web() { function start_zeromq() { if [ x"$REMOTEBACKEND_ZEROMQ" == "xyes" ]; then - ./unittest_zeromq.rb >> $mode.log 2>&1 & + ./unittest_zeromq.rb >> ${mode%\.test}_server.log 2>&1 & zeromq_pid=$! # need to wait a moment sleep 5 -- 2.47.2