[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Background processes in GNU Autotest

From: Mike Frysinger
Subject: Re: Background processes in GNU Autotest
Date: Wed, 22 Jun 2016 15:12:37 -0400

On 22 Jun 2016 11:03, Olaf Mandel wrote:
> I am trying to use GNU Autotest (via AX_GNU_AUTOTEST()) to run
> end-to-end tests on a network server. My current test script looks
> somewhat like this:
> AT_CHECK([server&],        , [ignore])
> AT_CHECK([client --cmd]),  , [expected-output])
> AT_CHECK([killall server], , [ignore])
> This is far from perfect, however: there is no cleanup if the client
> check fails or if the executable is called differently (see below).
> Now I want to combine this with valgrind checking (from
> AX_VALGRIND_CHECK()): I defined the check-TESTS target in the Makefile
> so it calls "make check-autotest" and renames the log files to the
> expected names and I added a macro to the test script to use an
> environment variable RUNNER:
> AC_DEFUN([WRAP_CMD], [${RUNNER} $(which $1) $2])
> AT_CHECK(WRAP_CMD([server], [&]),       , [ignore])
> AT_CHECK(WRAP_CMD([client], [--cmd]),   , [expected-output])
> AT_CHECK(WRAP_CMD([killall], [server]), , [ignore])
> But this fails to kill the server simply because the actual command
> being executed by the first AT_CHECK with make check-valgrind is:
> valgrind --error-exitcode=1 --quiet ./server &
> So the simple killall call is no longer feasible.
> Now my question: is there a standard and approved way to start a
> background process in a GNU Autotest script and to kill it at or before
> the AT_CLEANUP ?

wouldn't you want the test itself to spin up/down the server as need
be ?  that way you can write multiple end-to-end tests and have them
all run in parallel.

i'm guessing your method described above also doesn't work when you
try to run all the tests in parallel.

Attachment: signature.asc
Description: Digital signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]