commit-inetutils
[Top][All Lists]
Advanced

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

[SCM] GNU Inetutils branch, master, updated. inetutils-1_8-174-g5a4a40a


From: Mats Erik Andersson
Subject: [SCM] GNU Inetutils branch, master, updated. inetutils-1_8-174-g5a4a40a
Date: Mon, 21 Nov 2011 01:58:52 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Inetutils ".

The branch, master has been updated
       via  5a4a40a3c3b96ff6ef78ca0991fed8b1ae863989 (commit)
      from  31c990c3651ba0c56cbd731ff6156b576769e1f6 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit/inetutils.git/commit/?id=5a4a40a3c3b96ff6ef78ca0991fed8b1ae863989


commit 5a4a40a3c3b96ff6ef78ca0991fed8b1ae863989
Author: Mats Erik Andersson <address@hidden>
Date:   Mon Nov 21 02:56:59 2011 +0100

    tests/syslogd.sh: Post-run cleanup.

diff --git a/ChangeLog b/ChangeLog
index d148d59..9f5f27c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2011-11-21  Mats Erik Andersson <address@hidden>
 
+       * tests/syslogd.sh: Implement post-run cleanup.
+
+2011-11-21  Mats Erik Andersson <address@hidden>
+
        * libtelnet/getent.c [HAVE_CGETENT]: Include <stdlib.h>.
        * telnet/sys_bsd.c [SIGINFO] (sendayt): Missing declaration.
        * doc/inetutils.texi (telnet invocation): Minor fixes.
diff --git a/tests/syslogd.sh b/tests/syslogd.sh
index 6550350..4d52773 100755
--- a/tests/syslogd.sh
+++ b/tests/syslogd.sh
@@ -20,11 +20,48 @@
 # Tests to establish functionality of SYSLOG daemon.
 #
 
-# Keep any external assignment.
+# Is usage explanation in demand?
 #
-: ${IU_TESTDIR:=/tmp/iu_syslog}
+if [ "$1" = "-h" -o "$1" = "--help" -o "$1" = "--usage" ]; then
+       cat <<HERE
+Test utility for syslogd and logger.
+
+The following environment variables are used:
+
+NOCLEAN                No clean up of testing directory, if set.
+VERBOSE                Be verbose, if set.
+OPTIONS                Base options to build upon.
+IU_TESTDIR     If set, use this as testing dir. Unless
+               NOCLEAN is also set, any created \$IU_TESTDIR
+               will be erased after the test.
+REMOTE_LOGHOST Add this host as a receiving loghost.
+
+HERE
+       exit 0
+fi
+
+# Keep any external assignment of testing directory.
+# Otherwise a randomisation is included if NOCLEAN
+# has been set.
+#
+if [ -n "${NOCLEAN+yes}" ]; then
+       : ${IU_TESTDIR:=/tmp/iu_syslog}
+else
+       : ${IU_TESTDIR:=/tmp/iu_syslog$$}
+fi
 
-mkdir -p $IU_TESTDIR
+if [ ! -d $IU_TESTDIR ]; then
+       IU_DO_CLEANDIR=yes
+       mkdir -p $IU_TESTDIR
+fi
+
+# Erase the testing directory.
+#
+clean_testdir () {
+       if [ -z "${NOCLEAN+no}" -a "$IU_DO_CLEANDIR" = "yes" ]; then
+               rm -fR $IU_TESTDIR
+       fi
+}
 
 CONF=$IU_TESTDIR/syslog.conf
 PID=$IU_TESTDIR/syslogd.pid
@@ -75,11 +112,13 @@ IU_LOGGER=./src/logger$EXEEXT
 
 if [ ! -x $IU_SYSLOGD ]; then
        echo "Missing executable 'syslogd'. Failing."
+       clean_testdir
        exit 1;
 fi
 
 if [ ! -x $IU_LOGGER ]; then
        echo "Missing executable 'logger'. Failing."
+       clean_testdir
        exit 1
 fi
 
@@ -130,7 +169,9 @@ if [ "$USER" = "root" ]; then
 fi
 ## Bring in additional options from command line.
 ## Disable kernel messages otherwise.
-: OPTIONS=${OPTIONS:=--no-klog}
+if [ -c /dev/klog ]; then
+       : OPTIONS=${OPTIONS:=--no-klog}
+fi
 IU_OPTIONS="$IU_OPTIONS $OPTIONS"
 
 $IU_SYSLOGD $IU_OPTIONS
@@ -145,6 +186,7 @@ sleep 1
 #
 if [ ! -r $PID ]; then
        echo "The service daemon never started. Failing."
+       clean_testdir
        exit 1
 fi
 
@@ -193,4 +235,6 @@ fi
 # Remove the daemon process.
 [ -r $PID ] && kill "$(cat $PID)"
 
+clean_testdir
+
 exit $EXITCODE

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog        |    4 ++++
 tests/syslogd.sh |   52 ++++++++++++++++++++++++++++++++++++++++++++++++----
 2 files changed, 52 insertions(+), 4 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 



reply via email to

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