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_4-61-g3c908f


From: Mats Erik Andersson
Subject: [SCM] GNU Inetutils branch, master, updated. inetutils-1_9_4-61-g3c908f3
Date: Mon, 20 Jan 2020 10:48:39 -0500 (EST)

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  3c908f3420ac0e29edcf7511fbc5665960cc7124 (commit)
      from  71ece60ff8e8542f1dab59456f63edf1a0a371fd (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=3c908f3420ac0e29edcf7511fbc5665960cc7124


commit 3c908f3420ac0e29edcf7511fbc5665960cc7124
Author: Mats Erik Andersson <address@hidden>
Date:   Mon Jan 20 16:38:05 2020 +0100

    Test robustly in absence of IPv6.
    
    A system like Raspbian can be configured without IPv6 at runtime.
    Suppress IPv6 addresses in test scripts, whenever IPv6 is auto-inserted
    and a check at test execution time fails for `::1'.  Issue was reported
    by Bruno Haible.

diff --git a/ChangeLog b/ChangeLog
index 0bad4f7..6eaeecb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,25 @@
+2020-01-20  Mats Erik Andersson  <address@hidden>
+
+       Test robustly in absence of IPv6.
+       For systems without functional IPv6 addressing at runtime,
+       suppress this address family in our tests, whenever IPv6 was
+       configured as autodetected.  Helpful answer by Bruno Haible
+       originating from effects in a Raspbian system:
+       https://lists.gnu.org/archive/html/bug-inetutils/2020-01/msg00021.html
+
+       * tests/Makefile.am (check_PROGRAMS): Add `runtime-ipv6'.
+       * tests/ftp-localhost.sh (RUNTIME_IPV6): New variable.
+       [TEST_IPV6 == auto]: Set TEST_IPV6 to `no' when runtime presence
+       of IPv6 is in the negative.  Thus effectively inhibiting all use
+       within this script of IPv6 addresses.
+       * tests/ping-localhost.sh: Likewise.
+       * tests/syslogd.sh: Likewise.
+       * tests/telnet-localhost.sh: Likewise.
+       * tests/tftp.sh: Likewise.
+       * tests/runtime-ipv6.c: New file.
+
+       * configure.ac (AC_ISC_POSIX): Delete obsolete test.
+
 2020-01-18  Mats Erik Andersson  <address@hidden>
 
        Minor portability glitches in Solaris and in AIX.
diff --git a/configure.ac b/configure.ac
index 671e175..d5fdea4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -123,8 +123,6 @@ IU_ENABLE_CLIENT(traceroute)
 
 AM_SILENT_RULES([yes])
 
-AC_ISC_POSIX
-
 ### Checks for programs.
 AC_PROG_CC
 gl_EARLY
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 817a808..8d87bc7 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -23,7 +23,7 @@ LDADD = $(iu_LIBRARIES)
 noinst_PROGRAMS = identify
 identify_LDADD = $(top_builddir)/lib/libgnu.a $(LIBUTIL)
 
-check_PROGRAMS = localhost readutmp waitdaemon
+check_PROGRAMS = localhost readutmp runtime-ipv6 waitdaemon
 
 dist_check_SCRIPTS = utmp.sh
 
diff --git a/tests/ftp-localhost.sh b/tests/ftp-localhost.sh
index a73b426..90acd74 100755
--- a/tests/ftp-localhost.sh
+++ b/tests/ftp-localhost.sh
@@ -51,6 +51,8 @@ set -e
 
 . ./tools.sh
 
+RUNTIME_IPV6="${RUNTIME_IPV6:-./runtime-ipv6$EXEEXT}"
+
 FTP=${FTP:-../ftp/ftp$EXEEXT}
 FTPD=${FTPD:-../ftpd/ftpd$EXEEXT}
 INETD=${INETD:-../src/inetd$EXEEXT}
@@ -222,6 +224,12 @@ locate_port () {
     fi
 }
 
+# Avoid IPv6 when not functional.
+if test "$TEST_IPV6" = "auto"; then
+    $RUNTIME_IPV6 || { TEST_IPV6="no"
+       echo "Suppressing non-supported IPv6."; }
+fi
+
 # Files used in transmission tests.
 GETME=`$MKTEMP $TMPDIR/file.XXXXXXXX` || do_transfer=false
 
diff --git a/tests/ping-localhost.sh b/tests/ping-localhost.sh
index 793c754..e091cbc 100755
--- a/tests/ping-localhost.sh
+++ b/tests/ping-localhost.sh
@@ -25,6 +25,8 @@
 
 . ./tools.sh
 
+RUNTIME_IPV6="${RUNTIME_IPV6:-./runtime-ipv6$EXEEXT}"
+
 PING=${PING:-../ping/ping$EXEEXT}
 TARGET=${TARGET:-127.0.0.1}
 
@@ -46,6 +48,12 @@ if [ `func_id_uid` != 0 ]; then
     exit 77
 fi
 
+# Avoid IPv6 when not functional.
+if test "$TEST_IPV6" = "auto"; then
+    $RUNTIME_IPV6 || { TEST_IPV6="no"
+       echo "Suppressing non-supported IPv6."; }
+fi
+
 errno=0
 errno2=0
 
diff --git a/tests/runtime-ipv6.c b/tests/runtime-ipv6.c
new file mode 100644
index 0000000..17d399a
--- /dev/null
+++ b/tests/runtime-ipv6.c
@@ -0,0 +1,81 @@
+/* runtime-ipv6 - Check that system is able to set IPv6 address.
+  Copyright (C) 2020 Free Software Foundation, Inc.
+
+  This file is part of GNU Inetutils.
+
+  GNU Inetutils is free software: you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation, either version 3 of the License, or (at
+  your option) any later version.
+
+  GNU Inetutils is distributed in the hope that it will be useful, but
+  WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+  General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with this program.  If not, see `http://www.gnu.org/licenses/'. */
+
+/* Written by Mats Erik Andersson.  */
+
+/* Runtime-ipv6 determines whether IPv6 address ::1 can be selected.
+ *
+ * Invocation:
+ *
+ *   runtime-ipv6
+ *
+ * Return value is 0 (zero) when successful, otherwise -1.
+ * On failure a message is printed to stderr: `IPv6 disabled in system'.
+ */
+
+#include <config.h>
+
+#include <stdio.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <string.h>
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#include <sys/socket.h>
+#include <netdb.h>
+
+#include <progname.h>
+
+#define RESOLVE_OK            0
+#define RESOLVE_FAIL         -1
+
+int
+main (int argc, char *argv[])
+{
+  int err;
+  struct sockaddr_storage ss;
+  struct addrinfo hints, *aiptr;
+
+  set_program_name (argv[0]);
+
+  memset (&hints, 0, sizeof (hints));
+  hints.ai_family = PF_INET6;
+  hints.ai_socktype = SOCK_DGRAM;
+  hints.ai_flags = AI_NUMERICHOST;
+
+  err = getaddrinfo ("::1", "tftp", &hints, &aiptr);
+  if (!err)
+    {
+      /* Should not really happen.  */
+      if (aiptr == NULL)
+       err = 1;
+
+      freeaddrinfo (aiptr);
+    }
+
+  if (err)
+    {
+      /* Not able to select localhost as IPv6.  */
+      fprintf (stderr, "IPv6 is disabled in this running system!");
+
+      return RESOLVE_FAIL;
+    }
+
+  return RESOLVE_OK;
+}
diff --git a/tests/syslogd.sh b/tests/syslogd.sh
index 563b516..107b520 100755
--- a/tests/syslogd.sh
+++ b/tests/syslogd.sh
@@ -96,6 +96,8 @@ if test "$IU_OS" = "Linux" || test "$IU_OS" = "SunOS"; then
     iu_socklen_max=108
 fi
 
+RUNTIME_IPV6="${RUNTIME_IPV6:-./runtime-ipv6$EXEEXT}"
+
 # The executables under test.
 #
 SYSLOGD=${SYSLOGD:-../src/syslogd$EXEEXT}
@@ -188,6 +190,12 @@ clean_testdir () {
 #
 trap clean_testdir EXIT HUP INT QUIT TERM
 
+# Avoid IPv6 when not functional.
+if test "$TEST_IPV6" = "auto"; then
+    $RUNTIME_IPV6 || { TEST_IPV6="no"
+       $silence echo "Suppressing non-supported IPv6."; }
+fi
+
 # Test at this port.
 # Standard is syslog at 514/udp.
 PROTO=udp
diff --git a/tests/telnet-localhost.sh b/tests/telnet-localhost.sh
index a5e356d..f975c0f 100755
--- a/tests/telnet-localhost.sh
+++ b/tests/telnet-localhost.sh
@@ -53,6 +53,8 @@ fi
 
 $need_mktemp || exit_no_mktemp
 
+RUNTIME_IPV6="${RUNTIME_IPV6:-./runtime-ipv6$EXEEXT}"
+
 # The executables under test.
 #
 INETD=${INETD:-../src/inetd$EXEEXT}
@@ -132,6 +134,12 @@ trap posttesting EXIT HUP INT QUIT TERM
 
 PORT=`expr 4973 + ${RANDOM:-$$} % 973`
 
+# Avoid IPv6 when not functional.
+if test "$TEST_IPV6" = "auto"; then
+    $RUNTIME_IPV6 || { TEST_IPV6="no"
+       echo "Suppressing non-supported IPv6."; }
+fi
+
 cat > "$INETD_CONF" <<-EOF ||
        $TARGET:$PORT stream tcp4 nowait $USER $ADDRPEEK addrpeek addr
 EOF
diff --git a/tests/tftp.sh b/tests/tftp.sh
index c449312..2f6366a 100755
--- a/tests/tftp.sh
+++ b/tests/tftp.sh
@@ -68,6 +68,8 @@ fi
 # Portability fix for SVR4
 PWD="${PWD:-`pwd`}"
 
+RUNTIME_IPV6="${RUNTIME_IPV6:-./runtime-ipv6$EXEEXT}"
+
 TFTP="${TFTP:-../src/tftp$EXEEXT}"
 TFTPD="${TFTPD:-$PWD/../src/tftpd$EXEEXT}"
 INETD="${INETD:-../src/inetd$EXEEXT}"
@@ -156,6 +158,12 @@ if test "$ADDRESSES" = "sense"; then
        -e "s/^.*$AF \([:.0-9]\{1,\}\) .*$/\1/g"`
 fi
 
+# Avoid IPv6 when not functional.
+if test "$TEST_IPV6" = "auto"; then
+    $RUNTIME_IPV6 || { TEST_IPV6="no"
+       $silence echo "Suppressing non-supported IPv6."; }
+fi
+
 if test -z "$ADDRESSES"; then
     ADDRESSES="${TARGET:-127.0.0.1}"
     test "$TEST_IPV6" = "no" || ADDRESSES="$ADDRESSES ${TARGET6:-::1}"

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

Summary of changes:
 ChangeLog                 | 22 +++++++++++++
 configure.ac              |  2 --
 tests/Makefile.am         |  2 +-
 tests/ftp-localhost.sh    |  8 +++++
 tests/ping-localhost.sh   |  8 +++++
 tests/runtime-ipv6.c      | 81 +++++++++++++++++++++++++++++++++++++++++++++++
 tests/syslogd.sh          |  8 +++++
 tests/telnet-localhost.sh |  8 +++++
 tests/tftp.sh             |  8 +++++
 9 files changed, 144 insertions(+), 3 deletions(-)
 create mode 100644 tests/runtime-ipv6.c


hooks/post-receive
-- 
GNU Inetutils 



reply via email to

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