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_9_1-12-g9b93c8


From: Mats Erik Andersson
Subject: [SCM] GNU Inetutils branch, master, updated. inetutils-1_9_1-12-g9b93c80
Date: Thu, 26 Jan 2012 20:39:10 +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  9b93c80dea90d3e361d4004a773965f7ff553e8f (commit)
      from  8c1fd8b773d969056f2c2edf6eef274133fdb4a3 (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=9b93c80dea90d3e361d4004a773965f7ff553e8f


commit 9b93c80dea90d3e361d4004a773965f7ff553e8f
Author: Mats Erik Andersson <address@hidden>
Date:   Thu Jan 26 20:38:54 2012 +0100

    tests/syslogd.sh: Avoid long socket name.

diff --git a/ChangeLog b/ChangeLog
index f44e743..8ca972f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2012-01-26  Mats Erik Andersson <address@hidden>
 
+       * tests/syslogd.sh (SOCKET): Disable the use of this
+       UNIX socket name if its length would be excessive.
+
+2012-01-26  Mats Erik Andersson <address@hidden>
+
        * tests/ftp-localhost.sh, tests/ping-localhost.sh,
        tests/syslogd.sh, tests/tftp.sh, tests/traceroute-localhost.sh:
        Test the availability of compiled resources.
diff --git a/tests/syslogd.sh b/tests/syslogd.sh
index 0eecfa4..6438654 100755
--- a/tests/syslogd.sh
+++ b/tests/syslogd.sh
@@ -49,6 +49,24 @@ fi
 #
 do_cleandir=false
 do_socket_length=true
+do_unix_socket=true
+
+# The UNIX socket name length is preset by the system
+# and is also system dependent.
+#
+# A long name consists of 103 or 107 non-NUL characters,
+# whereas the excessive string contains 104 or 108 characters.
+# BSD allocates only 104, while Glibc and Solaris admit 108
+# characters in "sun_path", a count which includes the final NUL.
+
+iu_socklen_max=104     # BSD flavour!
+
+IU_OS=`uname -s`
+if test "$IU_OS" = "Linux" || test "$IU_OS" = "GNU/kFreeBSD" ||
+       test "$IU_OS" = "SunOS"; then
+    # Aim at the boundary of 108 characters.
+    iu_socklen_max=108
+fi
 
 # The executables under test.
 #
@@ -62,8 +80,8 @@ LOGGER=../src/logger$EXEEXT
 
 if [ $VERBOSE ]; then
     set -x
-    $SYSLOGD --version
-    $LOGGER --version
+    $SYSLOGD --version | head -1
+    $LOGGER --version | head -1
 fi
 
 if [ ! -x $SYSLOGD ]; then
@@ -112,6 +130,19 @@ touch "$OUT" || {
     exit 1
 }
 
+# Some automated build environments dig deep chroots, i.e.,
+# make the paths to this working directory disturbingly long.
+# Check SOCKET for this calamity.
+#
+if test `expr X"$SOCKET" : X".*"` -gt $iu_socklen_max; then
+    do_unix_socket=false
+    cat <<-EOT >&2
+       WARNING! The working directory uses a disturbingly long path.
+       We are not able to construct a UNIX socket on top of it.
+       Therefore disabling socket messaging in this test run.
+       EOT
+fi
+
 # Erase the testing directory.
 #
 clean_testdir () {
@@ -175,23 +206,6 @@ IU_GOOD_BASE=${IU_TMPDIR}/_iu
 # Add a single character to violate the size condition.
 IU_BAD_BASE=${IU_TMPDIR}/X_iu
 
-iu_socklen_max=104     # BSD flavour!
-
-IU_OS=`uname -s`
-if test "$IU_OS" = "Linux" || test "$IU_OS" = "GNU/kFreeBSD" ||
-       test "$IU_OS" = "SunOS"; then
-    # Aim at the boundary of 108 characters.
-    iu_socklen_max=108
-fi
-
-# Establish largest possible socket name.
-#
-# The long name consists of 103 or 107 non-NUL
-# characters, whereas the excessive string contains
-# 104 or 108 characters.  BSD allocates only 104,
-# while Glibc and Solaris admit 108 characters in
-# "sun_path", a count which includes the final NUL.
-
 if test `expr X"$IU_GOOD_BASE" : X".*"` -gt $iu_socklen_max; then
     # Maximum socket length is already less than prefix.
     echo 'WARNING! Disabling socket length test.  Too long base name' >&2
@@ -279,7 +293,13 @@ fi
 # building the desired option list.
 #
 ## Base configuration.
-IU_OPTIONS="--rcfile='$CONF' --pidfile='$PID' --socket='$SOCKET'"
+IU_OPTIONS="--rcfile='$CONF' --pidfile='$PID'"
+if $do_unix_socket; then
+    IU_OPTIONS="$IU_OPTIONS --socket='$SOCKET'"
+else
+    # The empty string will disable the standard socket.
+    IU_OPTIONS="$IU_OPTIONS --socket=''"
+fi
 if $do_socket_length; then
     IU_OPTIONS="$IU_OPTIONS -a '$IU_LONG_SOCKET' -a '$IU_EXCESSIVE_SOCKET'"
 fi
@@ -322,16 +342,23 @@ EXITCODE=1
 # Check that the excessively long UNIX socket name was rejected.
 if $do_socket_length; then
     TESTCASES=`expr $TESTCASES + 1`
-    if grep "UNIX socket name too long.*${IU_BAD_BASE}" "$OUT" >/dev/null 
2>&1; then
+    # Messages can be truncated in the message log, so make a best
+    # effort to limit the length of the string we are searching for.
+    # Allowing 55 characters for IU_BAD_BASE is almost aggressive.
+    # A host name of length six would allow 64 characters
+    pruned=`expr "UNIX socket name too long.*${IU_BAD_BASE}" : '\(.\{1,82\}\)'`
+    if grep "$pruned" "$OUT" >/dev/null 2>&1; then
        SUCCESSES=`expr $SUCCESSES + 1`
     fi
 fi
 
 # Send messages on two sockets: IPv4 and UNIX.
 #
-TESTCASES=`expr $TESTCASES + 1`
-$LOGGER -h "$SOCKET" -p user.info -t "$TAG" \
-    "Sending BSD message. (pid $$)"
+if $do_unix_socket; then
+    TESTCASES=`expr $TESTCASES + 1`
+    $LOGGER -h "$SOCKET" -p user.info -t "$TAG" \
+       "Sending BSD message. (pid $$)"
+fi
 
 if $do_socket_length; then
     TESTCASES=`expr $TESTCASES + 1`
@@ -353,7 +380,13 @@ COUNT=`grep "$TAG" "$OUT" | wc -l`
 SUCCESSES=`expr $SUCCESSES + $COUNT`
 
 if [ -n "${VERBOSE+yes}" ]; then
-    grep "$TAG" "$OUT"
+    cat <<-EOT
+       ---------- Successfully detected messages. ----------
+       `grep "$TAG" "$OUT"`
+       ---------- Full message log for syslogd. ------------
+       `cat "$OUT"`
+       -----------------------------------------------------
+       EOT
 fi
 
 echo "Registered $SUCCESSES successes out of $TESTCASES."

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

Summary of changes:
 ChangeLog        |    5 +++
 tests/syslogd.sh |   83 +++++++++++++++++++++++++++++++++++++----------------
 2 files changed, 63 insertions(+), 25 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 



reply via email to

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