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-71-g416326


From: Mats Erik Andersson
Subject: [SCM] GNU Inetutils branch, master, updated. inetutils-1_9_4-71-g416326d
Date: Sat, 1 Feb 2020 18:18:54 -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  416326d0ac272a438c90fb145b4ff5c59d70c4de (commit)
      from  0fac847c6de53bf925c3778ea1ad65e76d0e5480 (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=416326d0ac272a438c90fb145b4ff5c59d70c4de


commit 416326d0ac272a438c90fb145b4ff5c59d70c4de
Author: Mats Erik Andersson <address@hidden>
Date:   Sun Feb 2 00:17:38 2020 +0100

    tests: Less system logging.

diff --git a/ChangeLog b/ChangeLog
index 59b1950..3cc3c69 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2020-02-01  Mats Erik Andersson  <address@hidden>
+
+       tests: Less system logging.
+
+       * tests/ftp-localhost.sh (LOGGING): New variable.  Let the server
+       program do system logging only if LOGGING has been defined.
+       * tests/tftp.sh (LOGGING): Likewise.  Add a test case where a
+       non-existing file is requested.  Check that the number of tries
+       and of successes agree in order to suppress the final text.
+
+       * README: Add some remarks on our testing abilities.
+
 2020-01-31  Mats Erik Andersson  <address@hidden>
 
        whois: IP delegation update.
diff --git a/README b/README
index 3194198..b340722 100644
--- a/README
+++ b/README
@@ -22,6 +22,31 @@ if you explicitly specify whether to build a program, that 
will
 override the values specified by --disable-clients or
 --disable-servers.
 
+Some words on testing are in order.  The three tests `ftp-localhost',
+`ping', and `traceroute', all need to be run by root.  Several tests
+will depend on infrastructure files in `/etc/', but most tests will
+complain about their obvious needs.  Anyway, these dependencies are
+important whenever chrooted builds are conducted.
+
+At the time of running a test, the shell variables TEST_IPV4 and
+TEST_IPV6 are influential.  Regard them as taking one of three values:
+`yes', `no', or `auto'.  When assigned the value `auto', a small check
+at runtime will determine if the corresponding address family is available,
+and accordingly include it during test.  The values `yes', and `no',
+include or exclude the corresponding address family unconditionally.
+
+During configuration time, TEST_IPV# is essentially set to `auto',
+except that `-enable-ipv#' assigns `yes', and `--disable-ipv#' assigns
+`no' unconditionally.  Note however, that `--disable-ipv6' retains
+its property of removing all support for IPv6 in every executable,
+while `--disable-ipv4' only affects the testing target `check' and scripts.
+
+During chrooted tests, the runtime check for either family can be
+fooled, so setting `TEST_IPV6=yes' might be necessary.  On the other
+hand, chrooting similar to a FreeBSD jail, normally changes the address
+of `localhost', so similar environments will need counteractions like
+`TARGET=10.0.6.1'.
+
 The GNU whois client reads a whois-servers file to figure out which
 whois server to use.  It won't always pick the best server;
 whois.internic.net seems to know something about nic.ddn.mil, but the
diff --git a/tests/ftp-localhost.sh b/tests/ftp-localhost.sh
index 8f6d5de..a31f220 100755
--- a/tests/ftp-localhost.sh
+++ b/tests/ftp-localhost.sh
@@ -33,6 +33,14 @@
 #
 #    OpenBSD uses /etc/services directly, not via /etc/nsswitch.conf.
 
+# Influential shell variables:
+#
+#   TARGET     IPv4 address for tests.  Defaults to 127.0.0.1.
+#   TARGET6    IPv6 address for tests.  Defaults to ::1.
+#   TARGET46   IPv4-mapped-IPv6 address.  Defaults to ::ffff:127.0.0.1.
+#   VERBOSE    Whenever defined, test runs in verbose mode.
+#   LOGGING    When defined, let `ftpd' do system logging.
+#
 # FIXME: Better test coverage!
 #
 # Implemented: anonymous-only in inetd-mode.
@@ -261,14 +269,14 @@ fi
     }
 
 test "$TEST_IPV4" = "no" ||
-    cat <<EOT > "$TMPDIR/inetd.conf"
-$PORT stream tcp4 nowait $USER $PWD/$FTPD ftpd -A -l
-EOT
+    cat <<-EOT > "$TMPDIR/inetd.conf"
+       $PORT stream tcp4 nowait $USER $PWD/$FTPD ftpd -A ${LOGGING+"-l"}
+       EOT
 
 test "$TEST_IPV6" = "no" ||
-    cat <<EOT >> "$TMPDIR/inetd.conf"
-$PORT stream tcp6 nowait $USER $PWD/$FTPD ftpd -A -l
-EOT
+    cat <<-EOT >> "$TMPDIR/inetd.conf"
+       $PORT stream tcp6 nowait $USER $PWD/$FTPD ftpd -A ${LOGGING+"-l"}
+       EOT
 
 : > "$TMPDIR/.netrc" 2>/dev/null ||
     {
diff --git a/tests/tftp.sh b/tests/tftp.sh
index d7d016c..47c123d 100755
--- a/tests/tftp.sh
+++ b/tests/tftp.sh
@@ -46,9 +46,12 @@
 #
 # 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
+# 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.
+#
+# Whenever set, VERBOSE and LOGGING, this test is performed in verbose
+# mode, and lets `tftpd' do system logging, respectively.
 
 . ./tools.sh
 
@@ -211,12 +214,12 @@ write_conf () {
 
     test "$TEST_IPV4" = "no" ||
        cat >> "$INETD_CONF" <<-EOF
-       $PORT dgram ${PROTO}4 wait $USER $TFTPD   tftpd -l $TMPDIR/tftp-test
+       $PORT dgram ${PROTO}4 wait $USER $TFTPD   tftpd ${LOGGING+"-l"} 
$TMPDIR/tftp-test
        EOF
 
     test "$TEST_IPV6" = "no" ||
        cat >> "$INETD_CONF" <<-EOF
-       $PORT dgram ${PROTO}6 wait $USER $TFTPD   tftpd -l $TMPDIR/tftp-test
+       $PORT dgram ${PROTO}6 wait $USER $TFTPD   tftpd ${LOGGING+"-l"} 
$TMPDIR/tftp-test
        EOF
 }
 
@@ -356,7 +359,7 @@ $silence echo "Looking into '`echo $ADDRESSES | tr "\n" ' 
'`'."
 for addr in $ADDRESSES; do
     $silence echo "trying address '$addr'..." >&2
 
-    for name in $FILELIST; do
+    for name in $FILELIST missing-file; do
        test -n "$name" || continue
        EFFORTS=`expr $EFFORTS + 1`
        rm -f "$name"
@@ -365,8 +368,15 @@ for addr in $ADDRESSES; do
 get $name" | \
        eval "$TFTP" ${VERBOSE:+-v} "$addr" $PORT $bucket
 
-       cmp "$TMPDIR/tftp-test/$name" "$name" 2>/dev/null
-       result=$?
+       if test "$name" != "missing-file"; then
+          cmp "$TMPDIR/tftp-test/$name" "$name" 2>/dev/null
+          result=$?
+       else
+          # No data should have arrived, but traditionally an empty
+          # file was created.
+          result=0
+          test ! -s "$name" || result=1
+       fi
 
        if [ "$result" -ne 0 ]; then
            # Failure.
@@ -435,12 +445,12 @@ if $do_secure_setting; then
 
     test "$TEST_IPV4" = "no" ||
        cat >> "$INETD_CONF" <<-EOF
-       $PORT dgram ${PROTO}4 wait $USER $TFTPD   tftpd -l -s $TMPDIR /tftp-test
+       $PORT dgram ${PROTO}4 wait $USER $TFTPD   tftpd ${LOGGING+"-l"} -s 
$TMPDIR /tftp-test
        EOF
 
     test "$TEST_IPV6" = "no" ||
        cat >> "$INETD_CONF" <<-EOF
-       $PORT dgram ${PROTO}6 wait $USER $TFTPD   tftpd -l -s $TMPDIR /tftp-test
+       $PORT dgram ${PROTO}6 wait $USER $TFTPD   tftpd ${LOGGING+"-l"} -s 
$TMPDIR /tftp-test
        EOF
 
     # Let inetd reload configuration.
@@ -492,7 +502,7 @@ fi
 
 # Minimal clean up. Main work in posttesting().
 $silence echo
-test $RESULT -eq 0 && $silence false \
+test $RESULT -eq 0 && test $SUCCESSES -eq $EFFORTS && $silence false \
     || echo Test had $SUCCESSES successes out of $EFFORTS cases.
 
 exit $RESULT

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

Summary of changes:
 ChangeLog              | 12 ++++++++++++
 README                 | 25 +++++++++++++++++++++++++
 tests/ftp-localhost.sh | 20 ++++++++++++++------
 tests/tftp.sh          | 28 +++++++++++++++++++---------
 4 files changed, 70 insertions(+), 15 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 



reply via email to

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