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-20-g304585


From: Mats Erik Andersson
Subject: [SCM] GNU Inetutils branch, master, updated. inetutils-1_9_1-20-g304585e
Date: Wed, 01 Feb 2012 19:01:03 +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  304585e609b5caa16bb9216a0645cb697d3a3388 (commit)
      from  d170fb9449fc301b3d925a8d4054886452393c33 (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=304585e609b5caa16bb9216a0645cb697d3a3388


commit 304585e609b5caa16bb9216a0645cb697d3a3388
Author: Mats Erik Andersson <address@hidden>
Date:   Wed Feb 1 19:58:27 2012 +0100

    Restart failed TFTP test.

diff --git a/ChangeLog b/ChangeLog
index e939075..72e0c57 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2012-02-01  Mats Erik Andersson <address@hidden>
+
+       * tests/syslogd.sh (do_inet_socket): New variable.
+       <port is busy>: Continue, but disable INET test.  Issue a notice.
+       * tests/tftp.sh (write_conf): New function.
+       <failed inetd launch>: Make a second start attempt, with new port.
+
 2012-02-01  Guillem Jover  <address@hidden>
 
        * src/Makefile.am (LDADD): Set to minimal, common value.
diff --git a/tests/syslogd.sh b/tests/syslogd.sh
index ebd584d..f9335c5 100755
--- a/tests/syslogd.sh
+++ b/tests/syslogd.sh
@@ -53,6 +53,7 @@ PWD="${PWD:-`pwd`}"
 do_cleandir=false
 do_socket_length=true
 do_unix_socket=true
+do_inet_socket=true
 
 # The UNIX socket name length is preset by the system
 # and is also system dependent.
@@ -250,6 +251,7 @@ if [ `id -u` -ne 0 ]; then
        WARNING!!  Disabling INET server tests since you seem
        to be underprivileged.
        EOT
+    do_inet_socket=false
 else
     # Is the INET port already in use? If so,
     # skip the test in its entirety.
@@ -266,7 +268,7 @@ else
                The INET port $PORT/$PROTO is already in use.
                No reliable test of INET socket is possible.
        EOT
-       exit 77
+       do_inet_socket=false
     fi
 fi
 
@@ -307,8 +309,8 @@ if $do_socket_length; then
     IU_OPTIONS="$IU_OPTIONS -a '$IU_LONG_SOCKET' -a '$IU_EXCESSIVE_SOCKET'"
 fi
 
-## Enable INET service when running as root.
-if [ `id -u` -eq 0 ]; then
+## Enable INET service when possible.
+if $do_inet_socket; then
     IU_OPTIONS="$IU_OPTIONS --ipany --inet --hop"
 fi
 ## Bring in additional options from command line.
@@ -369,7 +371,7 @@ if $do_socket_length; then
        -t "$TAG" "Sending via long socket name. (pid $$)"
 fi
 
-if [ `id -u` -eq 0 ]; then
+if $do_inet_socket; then
     TESTCASES=`expr $TESTCASES + 2`
     $LOGGER -4 -h "$TARGET" -p user.info -t "$TAG" \
        "Sending IPv4 message. (pid $$)"
@@ -394,6 +396,9 @@ fi
 
 echo "Registered $SUCCESSES successes out of $TESTCASES."
 
+# Report incomplete test setup.
+$do_inet_socket || echo 'NOTICE: No INET socket tests were performed.' >&2
+
 if [ "$SUCCESSES" -eq "$TESTCASES" ]; then
     echo "Successful testing."
     EXITCODE=0
diff --git a/tests/tftp.sh b/tests/tftp.sh
index af6e8e1..d5273d8 100755
--- a/tests/tftp.sh
+++ b/tests/tftp.sh
@@ -130,14 +130,18 @@ fi
 # name because `inetd' chdirs to `/' in daemon mode; ditto for
 # $INETD_CONF.  Thus the dependency on file locations will be
 # identical in daemon-mode and in debug-mode.
-cat > "$INETD_CONF" <<EOF
-$PORT dgram ${PROTO}4 wait $USER $TFTPD   tftpd -l $TMPDIR/tftp-test
-$PORT dgram ${PROTO}6 wait $USER $TFTPD   tftpd -l $TMPDIR/tftp-test
-EOF
+write_conf () {
+    cat > "$INETD_CONF" <<-EOF
+       $PORT dgram ${PROTO}4 wait $USER $TFTPD   tftpd -l $TMPDIR/tftp-test
+       $PORT dgram ${PROTO}6 wait $USER $TFTPD   tftpd -l $TMPDIR/tftp-test
+       EOF
+}
+
+write_conf
 
 # Launch `inetd', assuming it's reachable at all $ADDRESSES.
 $INETD ${VERBOSE+-d} -p"$INETD_PID" "$INETD_CONF" &
-sleep 1
+sleep 2
 inetd_pid="`cat $INETD_PID`"
 
 test -z "$VERBOSE" || echo "Launched Inetd as process $inetd_pid." >&2
@@ -150,8 +154,26 @@ locate_port $PROTO $PORT
 if test $? -ne 0; then
     # No it did not.
     ps "$inetd_pid" >/dev/null 2>&1 && kill "$inetd_pid" 2>/dev/null
-    echo "Failed in starting correct Inetd instance." >&2
-    exit 1
+    echo 'First attempt at starting Inetd has failed.' >&2
+    echo 'A new attempt will follow after some delay.' >&2
+    echo 'Increasing verbosity for better backtrace.' >&2
+    sleep 7
+
+    # Select a new port, with offset and some randomness.
+    PORT=`expr $PORT + 137 + \( ${RANDOM:-$$} % 517 \)`
+    write_conf
+
+    $INETD -d -p"$INETD_PID" "$INETD_CONF" &
+    sleep 2
+    inetd_pid="`cat $INETD_PID`"
+    echo "Launched Inetd as process $inetd_pid." >&2
+
+    if locate_port $PROTO $PORT; then
+       : # Successful this time.
+    else
+       echo "Failed again at starting correct Inetd instance." >&2
+       exit 1
+    fi
 fi
 
 if [ -r /dev/urandom ]; then

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

Summary of changes:
 ChangeLog        |    7 +++++++
 tests/syslogd.sh |   13 +++++++++----
 tests/tftp.sh    |   36 +++++++++++++++++++++++++++++-------
 3 files changed, 45 insertions(+), 11 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 



reply via email to

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