[SCM] GNU Inetutils branch, master, updated. inetutils-1_9_1-37-g3458bc5

Mats Erik Andersson <[email protected]>
Newsgroups gmane.comp.gnu.inetutils.cvs
Message-ID <[email protected]>
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  3458bc5b5f1b244920001fb253011c33c32f4113 (commit)
      from  b4a938fe77fd0a59e9f0a37eb704856d00be3d35 (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=3458bc5b5f1b244920001fb253011c33c32f4113


commit 3458bc5b5f1b244920001fb253011c33c32f4113
Author: Mats Erik Andersson <[email protected]>
Date:   Tue Feb 21 22:18:24 2012 +0100

    tests/telnet-localhost.sh: Assure active TTY.

diff --git a/ChangeLog b/ChangeLog
index b554f65..24c4d78 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2012-02-21  Mats Erik Andersson <[email protected]>
 
+	* tests/telnet-localhost.sh: Skip test in absence of assigned TTY.
+	Rewrite case evaluation without nested pipelines and OR connectives.
+
+2012-02-21  Mats Erik Andersson <[email protected]>
+
 	Basic test case for `telnet'.
 	* tests/Makefile.am (dist_check_SCRIPTS) [ENABLE_inetd && ENABLE_telnet]:
 	Added telnet-localhost.sh.
diff --git a/tests/telnet-localhost.sh b/tests/telnet-localhost.sh
index fb5559d..ca4f1db 100755
--- a/tests/telnet-localhost.sh
+++ b/tests/telnet-localhost.sh
@@ -27,7 +27,7 @@
 #
 #  * cat(1), expr(1), head(1), kill(1), pwd(1), rm(1).
 #
-#  * id(1), grep(1), mktemp(1), ps(1).
+#  * id(1), grep(1), mktemp(1), ps(1), tty(1).
 
 # Is usage explanation in demand?
 #
@@ -67,18 +67,26 @@ if test -n "$VERBOSE"; then
     $TELNET --version | head -1
 fi
 
+# The use of telnet is portable only with a connected TTY.
+if tty >/dev/null; then
+    :
+else
+    echo 'No TTY assigned to this process.  Skipping test.' >&2
+    exit 77
+fi
+
 if test ! -x $INETD; then
-    echo "Missing executable '$INETD'.  Skipping." >&2
+    echo "Missing executable '$INETD'.  Skipping test." >&2
     exit 77
 fi
 
 if test ! -x $TELNET; then
-    echo "Missing executable '$TELNET'.  Skipping." >&2
+    echo "Missing executable '$TELNET'.  Skipping test." >&2
     exit 77
 fi
 
 if test ! -x $ADDRPEEK; then
-    echo "Missing executable '$ADDRPEEK'.  Skipping." >&2
+    echo "Missing executable '$ADDRPEEK'.  Skipping test." >&2
     exit 77
 fi
 
@@ -159,27 +167,30 @@ telnet_opts="--no-rc --no-escape --no-login"
 
 errno=0
 
-test -z "$TARGET4" || {
-    $TELNET $telnet_opts $TARGET4 $PORT 2>/dev/null |
-    eval "grep 'Your address is $TARGET4.' $display"  || {
+if test -n "$TARGET4"; then
+    output=`$TELNET $telnet_opts $TARGET4 $PORT 2>/dev/null`
+    echo "$output" | eval "grep 'Your address is $TARGET4.' $display"
+    if test $? -ne 0; then
 	errno=1
 	echo "Failed at '$TARGET4'." >&2
-    }
-}
+    fi
+fi
 
-test -z "$TARGET6" || {
-    $TELNET $telnet_opts $TARGET6 $PORT 2>/dev/null |
-    eval "grep 'Your address is $TARGET6.' $display"  || {
+if test -n "$TARGET6"; then
+    output=`$TELNET $telnet_opts $TARGET6 $PORT 2>/dev/null`
+    echo "$output" | eval "grep 'Your address is $TARGET6.' $display"
+    if test $? -ne 0; then
 	errno=1
 	echo "Failed at '$TARGET6'." >&2
-    }
-}
+    fi
+fi
 
-test -z "$TARGET46" || {
-    $TELNET $telnet_opts $TARGET46 $PORT 2>/dev/null |
-    eval "grep 'Your address is .*$TARGET4.' $display" || {
+if test -n "$TARGET46"; then
+    output=`$TELNET $telnet_opts $TARGET46 $PORT 2>/dev/null`
+    echo "$output" | eval "grep 'Your address is .*$TARGET4.' $display"
+    if test $? -ne 0; then
 	echo "Informational: Unsuccessful with mapped address '$TARGET46'." >&2
-    }
-}
+    fi
+fi
 
 exit $errno

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

Summary of changes:
 ChangeLog                 |    5 ++++
 tests/telnet-localhost.sh |   49 +++++++++++++++++++++++++++-----------------
 2 files changed, 35 insertions(+), 19 deletions(-)


hooks/post-receive
-- 
GNU Inetutils
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.