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_2-48-g02b3e8


From: Mats Erik Andersson
Subject: [SCM] GNU Inetutils branch, master, updated. inetutils-1_9_2-48-g02b3e80
Date: Fri, 27 Feb 2015 23:10:12 +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  02b3e800627bd880b7611afeb55aa98bb50f6710 (commit)
      from  654247a94d2934405f74c5576b1068e1a28314bd (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=02b3e800627bd880b7611afeb55aa98bb50f6710


commit 02b3e800627bd880b7611afeb55aa98bb50f6710
Author: Mats Erik Andersson <address@hidden>
Date:   Fri Feb 27 23:39:54 2015 +0100

    Allow testing without IPv6.
    
    Pass a semaphor to the test scripts to indicate
    whether to disable IPv6 tests or not.

diff --git a/ChangeLog b/ChangeLog
index b4a91a7..0ca044a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,24 @@
+2015-02-27  Mats Erik Andersson  <address@hidden>
+
+       Allow testing without IPv6.
+       Configuration with `--disable-ipv6' as well as individual
+       tests with `TEST_IPV6=no' need to avoid mandatory IPv6.
+
+       * configure.ac (TEST_IPV6): New exported variable.
+       * tests/Makefile.am (tools_subst): Add substitution of TEST_IPV6.
+       * tests/tools.sh.in (TEST_IPV6): New variable.
+
+       * tests/ftp-localhost.sh: Check `$TEST_IPV6 != no' before adding
+       any test cases with IPv6 addressing.
+       * tests/syslogd.sh: Likewise.
+       * tests/telnet-localhost.sh: Likewise.
+       (TARGET46): New variable, defaulting to `::ffff:$TARGET'.
+
+       * tests/tftp.sh (TARGET, TARGET6): New variables.
+       <$ADDRESSES = sense>: Compute this case before building a default
+       address list.  Add switch `-a' when executing $IFCONFIG.
+       (ADDRESSES): Start with TARGET, add TARGET6 if `$TEST_IPV6 != no'.
+
 2015-01-31  Mats Erik Andersson  <address@hidden>
 
        telnet: Printing of uninitialized characters.
diff --git a/configure.ac b/configure.ac
index 908111e..ab0691d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -420,6 +420,7 @@ AC_ARG_ENABLE([ipv6],
   esac],
   [ipv6=auto]
 )
+AC_SUBST(TEST_IPV6, [$ipv6])
 
 working_ipv6=yes
 if test ! "$ipv6" = "no" && test "$working_ipv6" = "yes"; then
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 6f95e8f..7c99faf 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -101,7 +101,8 @@ tools_subst = sed -e 's,address@hidden@],$(GREP),g' \
              -e 's,address@hidden@],$(SED),g' \
              -e 's,address@hidden@],$(DD),g' \
              -e 's,address@hidden@],$(MKTEMP),g' \
-             -e 's,address@hidden@],$(NETSTAT),g'
+             -e 's,address@hidden@],$(NETSTAT),g'\
+             -e 's,address@hidden@],$(TEST_IPV6),g'
 
 tools.sh: tools.sh.in Makefile
        $(tools_subst) < $(srcdir)/tools.sh.in > $@
diff --git a/tests/ftp-localhost.sh b/tests/ftp-localhost.sh
index 96db3cd..32ff34f 100755
--- a/tests/ftp-localhost.sh
+++ b/tests/ftp-localhost.sh
@@ -260,8 +260,6 @@ fi
 
 cat <<EOT > "$TMPDIR/.netrc"
 machine $TARGET login $FTPUSER password foobar
-machine $TARGET6 login $FTPUSER password foobar
-machine $TARGET46 login $FTPUSER password foobar
 EOT
 
 if test $? -ne 0; then
@@ -269,6 +267,13 @@ if test $? -ne 0; then
     exit 77
 fi
 
+if test "$TEST_IPV6" != "no"; then
+    cat <<-EOT >> "$TMPDIR/.netrc"
+       machine $TARGET6 login $FTPUSER password foobar
+       machine $TARGET46 login $FTPUSER password foobar
+       EOT
+fi
+
 chmod 600 "$TMPDIR/.netrc"
 
 # Some simple, but variable content.
@@ -466,35 +471,36 @@ $FTP "$TARGET" $PORT -N"$TMPDIR/.netrc" -4 -v -t 
>$TMPDIR/ftp.stdout 2>&1
 
 test_report $? "$TMPDIR/ftp.stdout" "EPRT/$TARGET"
 
-# Test a passive connection: EPSV and IPv6.
-#
-echo "EPSV to $TARGET6 (IPv6) using inetd."
-cat <<STOP |
-rstatus
-dir
-STOP
-HOME=$TMPDIR $FTP "$TARGET6" $PORT -6 -v -p -t >$TMPDIR/ftp.stdout 2>&1
+if test "$TEST_IPV6" != "no" && test -n "$TARGET6"; then
+    # Test a passive connection: EPSV and IPv6.
+    #
+    echo "EPSV to $TARGET6 (IPv6) using inetd."
+    cat <<-STOP |
+       rstatus
+       dir
+       STOP
+    HOME=$TMPDIR $FTP "$TARGET6" $PORT -6 -v -p -t >$TMPDIR/ftp.stdout 2>&1
 
-test_report $? "$TMPDIR/ftp.stdout" "EPSV/$TARGET6"
+    test_report $? "$TMPDIR/ftp.stdout" "EPSV/$TARGET6"
 
-# Test an active connection: EPRT and IPv6.
-#
-echo "EPRT to $TARGET6 (IPv6) using inetd."
-cat <<STOP |
-rstatus
-dir
-`$do_transfer && test -n "$DLDIR" && echo "\
+    # Test an active connection: EPRT and IPv6.
+    #
+    echo "EPRT to $TARGET6 (IPv6) using inetd."
+    cat <<-STOP |
+       rstatus
+       dir
+       `$do_transfer && test -n "$DLDIR" && echo "\
 cd $DLDIR"`
-`$do_transfer && echo "\
+       `$do_transfer && echo "\
 lcd $TMPDIR
 image
 put $GETME $PUTME"`
-STOP
-HOME=$TMPDIR $FTP "$TARGET6" $PORT -6 -v -t >$TMPDIR/ftp.stdout 2>&1
+       STOP
+    HOME=$TMPDIR $FTP "$TARGET6" $PORT -6 -v -t >$TMPDIR/ftp.stdout 2>&1
 
-test_report $? "$TMPDIR/ftp.stdout" "EPRT/$TARGET6"
+    test_report $? "$TMPDIR/ftp.stdout" "EPRT/$TARGET6"
 
-$do_transfer && \
+    $do_transfer && \
     if cmp -s "$TMPDIR/$GETME" "$FTPHOME$DLDIR/$PUTME"; then
        test "${VERBOSE+yes}" && echo >&2 'Binary transfer succeeded.'
        date "+%s" >> "$TMPDIR/$GETME"
@@ -502,6 +508,7 @@ $do_transfer && \
        echo >&2 'Binary transfer failed.'
        exit 1
     fi
+fi # TEST_IPV6
 
 # Availability of IPv4-mapped IPv6 addresses.
 #
@@ -556,7 +563,8 @@ fi
 
 # Test functionality of IPv4-mapped IPv6 addresses.
 #
-if $have_address_mapping && test -n "$TARGET46" ; then
+if $have_address_mapping && test -n "$TARGET46" &&
+   test "$TEST_IPV6" != "no"; then
     # Test a passive connection: EPSV and IPv4-mapped-IPv6.
     #
     echo "EPSV to $TARGET46 (IPv4-as-IPv6) using inetd."
@@ -610,7 +618,7 @@ put $GETME $PUTME"`
 else
     # The IPv4-as-IPv6 tests were not performed.
     echo 'Skipping two tests of IPv4 mapped as IPv6.'
-fi
+fi # have_address_mapping && TEST_IPV6
 
 # Test name mapping with PASV and IPv4.
 # Needs a writable destination!
diff --git a/tests/syslogd.sh b/tests/syslogd.sh
index 6acfeb4..2091c27 100755
--- a/tests/syslogd.sh
+++ b/tests/syslogd.sh
@@ -429,11 +429,14 @@ if $do_socket_length; then
 fi
 
 if $do_inet_socket; then
-    TESTCASES=`expr $TESTCASES + 2`
+    TESTCASES=`expr $TESTCASES + 1`
     $LOGGER -4 -h "$TARGET:$PORT" -p user.info -t "$TAG" \
        "Sending IPv4 message. (pid $$)"
-    $LOGGER -6 -h "$TARGET6:$PORT" -p user.info -t "$TAG" \
-       "Sending IPv6 message. (pid $$)"
+    if test "$TEST_IPV6" != "no"; then
+       TESTCASES=`expr $TESTCASES + 1`
+       $LOGGER -6 -h "$TARGET6:$PORT" -p user.info -t "$TAG" \
+           "Sending IPv6 message. (pid $$)"
+    fi
 fi
 
 # Generate a more elaborate message routing, aimed at confirming
@@ -537,7 +540,6 @@ locate_port $PROTO 514 && do_standard_port=false
 
 if $do_standard_port; then
     echo 'Checking also standard port 514/udp.' >&2
-    TESTCASES=`expr $TESTCASES + 2`
 
     # New configuration, but continuing old message file.
     rm -f "$PID"
@@ -549,10 +551,16 @@ if $do_standard_port; then
     $SYSLOGD --rcfile="$CONF" --pidfile="$PID" --socket='' \
        --inet --ipany $OPTIONS
     sleep 1
+
+    TESTCASES=`expr $TESTCASES + 1`
     $LOGGER -4 -h "$TARGET" -p user.info -t "$TAG" \
        "IPv4 to standard port. (pid $$)"
-    $LOGGER -6 -h "$TARGET6" -p user.info -t "$TAG" \
-       "IPv6 to standard port. (pid $$)"
+
+    if test "$TEST_IPV6" != "no"; then
+       TESTCASES=`expr $TESTCASES + 1`
+       $LOGGER -6 -h "$TARGET6" -p user.info -t "$TAG" \
+           "IPv6 to standard port. (pid $$)"
+    fi
 fi
 
 # Delay detection due to observed race condition.
diff --git a/tests/telnet-localhost.sh b/tests/telnet-localhost.sh
index 155a54a..929ce2e 100755
--- a/tests/telnet-localhost.sh
+++ b/tests/telnet-localhost.sh
@@ -43,6 +43,7 @@ The following environment variables are used:
 VERBOSE                Be verbose, if set.
 TARGET         Receiving IPv4 address.
 TARGET6                Receiving IPv6 address.
+TARGET46       Receiving IPv4-mapped-IPV6 address.
 
 HERE
     exit 0
@@ -61,7 +62,7 @@ ADDRPEEK=${ADDRPEEK:-./addrpeek$EXEEXT}
 # Selected targets.
 TARGET=${TARGET:-127.0.0.1}
 TARGET6=${TARGET6:-::1}
-TARGET46="::ffff:$TARGET"
+TARGET46=${TARGET46:-::ffff:$TARGET}
 
 # Step into `tests/', should the invokation
 # have been made outside of it.
@@ -133,13 +134,18 @@ PORT=`expr 4973 + ${RANDOM:-$$} % 973`
 
 cat > "$INETD_CONF" <<-EOF ||
        $TARGET:$PORT stream tcp4 nowait $USER $ADDRPEEK addrpeek addr
-       $TARGET6:$PORT stream tcp6 nowait $USER $ADDRPEEK addrpeek addr
 EOF
     {
        echo 'Could not create configuration file for Inetd.  Aborting.' >&2
        exit 1
     }
 
+if test "$TEST_IPV6" != "no"; then
+    cat >> "$INETD_CONF" <<-EOF
+       $TARGET6:$PORT stream tcp6 nowait $USER $ADDRPEEK addrpeek addr
+EOF
+fi
+
 # Must use '-d' consistently to prevent daemonizing, but we
 # would like to suppress the verbose output.
 #
@@ -183,7 +189,7 @@ if test -n "$TARGET"; then
     fi
 fi
 
-if test -n "$TARGET6"; then
+if test "$TEST_IPV6" != "no" && 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
@@ -192,7 +198,7 @@ if test -n "$TARGET6"; then
     fi
 fi
 
-if test -n "$TARGET46"; then
+if test "$TEST_IPV6" != "no" && test -n "$TARGET46"; then
     output=`$TELNET $telnet_opts $TARGET46 $PORT 2>/dev/null`
     echo "$output" | eval "$GREP 'Your address is .*$TARGET.' $display"
     if test $? -ne 0; then
diff --git a/tests/tftp.sh b/tests/tftp.sh
index 797035b..fac2e44 100755
--- a/tests/tftp.sh
+++ b/tests/tftp.sh
@@ -44,6 +44,12 @@
 #  * (root only) Reload configuration for chrooted mode.
 #    Read one binary file with a relative name, and one ascii
 #    file with absolute location.
+#
+# The values of TARGET and TARGET6 replace the loopback addresses
+# 127.0.0.1 and ::1, whenever the variables are set.  However,
+# Setting the variable ADDRESSES to a list of addresses takes
+# precedence over all other choices.  The particular value "sense"
+# tries to find all local addresses, then go ahead with these.
 
 . ./tools.sh
 
@@ -139,17 +145,21 @@ posttesting () {
 
 trap posttesting EXIT HUP INT QUIT TERM
 
-# Use only "127.0.0.1 ::1" as default address list.
+# Use only "127.0.0.1 ::1" as default address list,
+# but take account of TARGET and TARGET6.
 # Other configured addresses might be set under
 # strict filter policies, thus might block.
 #
 # Allow a setting "ADDRESSES=sense" to compute the
 # available addresses and then to test them all.
-ADDRESSES="${ADDRESSES:-127.0.0.1 ::1}"
+if test "$ADDRESSES" = "sense"; then
+    ADDRESSES=`$IFCONFIG -a | $SED -e "/$AF /!d" \
+       -e "s/^.*$AF \([:.0-9]\{1,\}\) .*$/\1/g"`
+fi
 
-if [ "$ADDRESSES" = "sense" ]; then
-    ADDRESSES="`$IFCONFIG | $SED -e "/$AF /!d" \
-       -e "s/^.*$AF \([:.0-9]\{1,\}\) .*$/\1/g"`"
+if test -z "$ADDRESSES"; then
+    ADDRESSES="${TARGET:-127.0.0.1}"
+    test "$TEST_IPV6" = "no" || ADDRESSES="$ADDRESSES ${TARGET6:-::1}"
 fi
 
 # Work around the peculiar output of netstat(1m,solaris).
diff --git a/tests/tools.sh.in b/tests/tools.sh.in
index ad4fee7..de8b387 100644
--- a/tests/tools.sh.in
+++ b/tests/tools.sh.in
@@ -22,6 +22,7 @@ SED=${SED:address@hidden@}
 DD=${DD:address@hidden@}
 MKTEMP=${MKTEMP:address@hidden@}
 NETSTAT=${NETSTAT:address@hidden@}
+TEST_IPV6=${TEST_IPV6:address@hidden@}
 
 # Variables for signalling presence of a utility:
 #

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

Summary of changes:
 ChangeLog                 |   21 ++++++++++++++++
 configure.ac              |    1 +
 tests/Makefile.am         |    3 +-
 tests/ftp-localhost.sh    |   58 +++++++++++++++++++++++++-------------------
 tests/syslogd.sh          |   20 +++++++++++----
 tests/telnet-localhost.sh |   14 +++++++---
 tests/tftp.sh             |   20 +++++++++++----
 tests/tools.sh.in         |    1 +
 8 files changed, 97 insertions(+), 41 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 



reply via email to

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