[Top][All Lists]

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

Background processes in GNU Autotest

From: Olaf Mandel
Subject: Background processes in GNU Autotest
Date: Wed, 22 Jun 2016 11:03:01 +0200
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1


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

Thank you for any suggestions,
Olaf Mandel

Attachment: signature.asc
Description: OpenPGP digital signature

reply via email to

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