[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[SCM] GNU Inetutils branch, master, updated. inetutils-1_9_4-67-g45f0ab
From: |
Mats Erik Andersson |
Subject: |
[SCM] GNU Inetutils branch, master, updated. inetutils-1_9_4-67-g45f0ab0 |
Date: |
Tue, 28 Jan 2020 11:03:05 -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 45f0ab0a8f6db70c01b38918c6a7e51bd0ca7935 (commit)
from 186074c449d606dc8149af8071d9b9eaff0e9d9d (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=45f0ab0a8f6db70c01b38918c6a7e51bd0ca7935
commit 45f0ab0a8f6db70c01b38918c6a7e51bd0ca7935
Author: Mats Erik Andersson <address@hidden>
Date: Tue Jan 28 16:59:34 2020 +0100
Better test coverage, mostly IPv6.
Test IPv6 equally much as is IPv4, whenever possible.
diff --git a/ChangeLog b/ChangeLog
index 5f38929..843fbf6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,21 @@
+2020-01-28 Mats Erik Andersson <address@hidden>
+
+ Better test coverage, mostly IPv6.
+
+ * tests/ftp-localhost.sh [TEST_IPV6 && TARGET6]: Add the possible
+ test cases that existed for IPv4, but did not for IPv6.
+ [do_transfer]: Explicitly remove copied $PUTME for reliability.
+ [TEST_IPV6 && TARGET6 && do_transfer]: New test for name mapping.
+ * tests/syslogd.sh [do_unix_socket || do_inet_socket]: Do priority
+ `notice' for each of local socket, IPv4 socket, and IPv6 socket,
+ as is applicable.
+ (COUNT_WRAP): Reworked calculation on grounds as above.
+ [do_inet_socket && TEST_IPV6 && TARGET6]: Test facilities `user.info'
+ and `user.debug' with IPv6.
+ * tests/tftp.sh (do_secure_setting): Test all of $ADDRESSES.
+
+ * tests/.gitignore: Add runtime-ipv6 to list.
+
2020-01-27 Mats Erik Andersson <address@hidden>
Portability to an old Solaris shell.
diff --git a/tests/.gitignore b/tests/.gitignore
index bb8b2f6..fca2178 100644
--- a/tests/.gitignore
+++ b/tests/.gitignore
@@ -3,6 +3,7 @@ identify
localhost
ls
readutmp
+runtime-ipv6
tcpget
tools.sh
waitdaemon
diff --git a/tests/ftp-localhost.sh b/tests/ftp-localhost.sh
index 94029cc..8f6d5de 100755
--- a/tests/ftp-localhost.sh
+++ b/tests/ftp-localhost.sh
@@ -372,7 +372,7 @@ if test "$TEST_IPV4" != "no" && test -n "$TARGET"; then
test_report $? "$TMPDIR/ftp.stdout" "PASV/$TARGET"
- $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"
@@ -380,6 +380,8 @@ if test "$TEST_IPV4" != "no" && test -n "$TARGET"; then
echo >&2 'Binary transfer failed.'
exit 1
fi
+ rm -f "$FTPHOME$DLDIR/$PUTME"
+ }
# Test an active connection: PORT and IPv4.
#
@@ -397,7 +399,7 @@ if test "$TEST_IPV4" != "no" && test -n "$TARGET"; then
test_report $? "$TMPDIR/ftp.stdout" "PORT/$TARGET"
- $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"
@@ -405,6 +407,8 @@ if test "$TEST_IPV4" != "no" && test -n "$TARGET"; then
echo >&2 'Binary transfer failed.'
exit 1
fi
+ rm -f "$FTPHOME$DLDIR/$PUTME"
+ }
# Test a passive connection: EPSV and IPv4.
#
@@ -438,7 +442,7 @@ if test "$TEST_IPV4" != "no" && test -n "$TARGET"; then
test_report $? "$TMPDIR/ftp.stdout" "EPSV/$TARGET with NETRC"
- $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"
@@ -446,6 +450,8 @@ if test "$TEST_IPV4" != "no" && test -n "$TARGET"; then
echo >&2 'Binary transfer failed.'
exit 1
fi
+ rm -f "$FTPHOME$DLDIR/$PUTME"
+ }
# Test an active connection: EPRT and IPv4.
#
@@ -464,7 +470,7 @@ if test "$TEST_IPV4" != "no" && test -n "$TARGET"; then
test_report $? "$TMPDIR/ftp.stdout" "EPRT/$TARGET"
- $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"
@@ -472,6 +478,8 @@ if test "$TEST_IPV4" != "no" && test -n "$TARGET"; then
echo >&2 'Binary transfer failed.'
exit 1
fi
+ rm -f "$FTPHOME$DLDIR/$PUTME"
+ }
# Test an active connection: EPRT and IPv4.
#
@@ -502,6 +510,35 @@ if test "$TEST_IPV6" != "no" && test -n "$TARGET6"; then
test_report $? "$TMPDIR/ftp.stdout" "EPSV/$TARGET6"
+ # Test a passive connection: EPSV and IPv6.
+ #
+ # Set NETRC in environment to regulate login.
+ #
+ echo "EPSV to $TARGET6 (IPv6) using inetd, setting NETRC."
+ cat <<-STOP |
+ rstatus
+ dir
+ `$do_transfer && test -n "$DLDIR" && echo "cd $DLDIR"`
+ `$do_transfer && echo "lcd $TMPDIR
+ image
+ put $GETME $PUTME"`
+ STOP
+ NETRC=$TMPDIR/.netrc \
+ $FTP "$TARGET6" $PORT -6 -v -p -t >$TMPDIR/ftp.stdout 2>&1
+
+ test_report $? "$TMPDIR/ftp.stdout" "EPSV/$TARGET6 with NETRC"
+
+ $do_transfer && {
+ if cmp -s "$TMPDIR/$GETME" "$FTPHOME$DLDIR/$PUTME"; then
+ test "${VERBOSE+yes}" && echo >&2 'Binary transfer succeeded.'
+ date "+%s" >> "$TMPDIR/$GETME"
+ else
+ echo >&2 'Binary transfer failed.'
+ exit 1
+ fi
+ rm -f "$FTPHOME$DLDIR/$PUTME"
+ }
+
# Test an active connection: EPRT and IPv6.
#
echo "EPRT to $TARGET6 (IPv6) using inetd."
@@ -518,14 +555,30 @@ if test "$TEST_IPV6" != "no" && test -n "$TARGET6"; then
test_report $? "$TMPDIR/ftp.stdout" "EPRT/$TARGET6"
- $do_transfer && \
- if cmp -s "$TMPDIR/$GETME" "$FTPHOME$DLDIR/$PUTME"; then
- test "${VERBOSE+yes}" && echo >&2 'Binary transfer succeeded.'
- date "+%s" >> "$TMPDIR/$GETME"
- else
- echo >&2 'Binary transfer failed.'
- exit 1
- fi
+ $do_transfer && {
+ if cmp -s "$TMPDIR/$GETME" "$FTPHOME$DLDIR/$PUTME"; then
+ test "${VERBOSE+yes}" && echo >&2 'Binary transfer succeeded.'
+ date "+%s" >> "$TMPDIR/$GETME"
+ else
+ echo >&2 'Binary transfer failed.'
+ exit 1
+ fi
+ rm -f "$FTPHOME$DLDIR/$PUTME"
+ }
+
+ # Test an active connection: EPRT and IPv6.
+ #
+ # Use `-N' to set location of .netrc file.
+ #
+ echo "EPRT to $TARGET6 (IPv6) using inetd, apply the switch -N."
+ cat <<-STOP |
+ rstatus
+ dir
+ STOP
+ $FTP "$TARGET6" $PORT -N"$TMPDIR/.netrc" -6 -v -t >$TMPDIR/ftp.stdout 2>&1
+
+ test_report $? "$TMPDIR/ftp.stdout" "EPRT/$TARGET6"
+
fi # TEST_IPV6 && TARGET6
# Availability of IPv4-mapped IPv6 addresses.
@@ -603,7 +656,7 @@ if test "$TEST_IPV4" != "no" &&test "$TEST_IPV6" != "no" &&
test_report $? "$TMPDIR/ftp.stdout" "EPSV/$TARGET46"
- $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"
@@ -611,8 +664,10 @@ if test "$TEST_IPV4" != "no" &&test "$TEST_IPV6" != "no" &&
echo >&2 'Binary transfer failed.'
exit 1
fi
+ rm -f "$FTPHOME$DLDIR/$PUTME"
+ }
- # Test an active connection: EPRT and IPvIPv6.
+ # Test an active connection: EPRT and IPv4-mapped-IPv6.
#
echo "EPRT to $TARGET46 (IPv4-as-IPv6) using inetd."
cat <<-STOP |
@@ -628,13 +683,15 @@ if test "$TEST_IPV4" != "no" &&test "$TEST_IPV6" != "no"
&&
test_report $? "$TMPDIR/ftp.stdout" "EPRT/$TARGET46"
- $do_transfer && \
+ $do_transfer && {
if cmp -s "$TMPDIR/$GETME" "$FTPHOME$DLDIR/$PUTME"; then
test "${VERBOSE+yes}" && echo >&2 'Binary transfer succeeded.'
else
echo >&2 'Binary transfer failed.'
exit 1
fi
+ rm -f "$FTPHOME$DLDIR/$PUTME"
+ }
elif test "$TEST_IPV4" != "no" || test "$TEST_IPV6" != "no"; then
# The IPv4-as-IPv6 tests were not performed.
echo 'Skipping two tests of IPv4 mapped as IPv6.'
@@ -681,4 +738,45 @@ if test "$TEST_IPV4" != "no" && test -n "$TARGET" &&
$do_transfer; then
fi
fi # TEST_IPV4 && TARGET && do_transfer
+# Test name mapping with EPSV and IPv6.
+# Needs a writable destination!
+#
+if test "$TEST_IPV6" != "no" && test -n "$TARGET6" && $do_transfer; then
+ echo "Name mapping test at $TARGET6 (IPv6) using inetd."
+
+ cat <<-STOP |
+ `test -z "$DLDIR" || echo "cd $DLDIR"`
+ lcd $TMPDIR
+ image
+ nmap \$1.\$2 \$2.\$1
+ put $GETME
+ nmap \$1.\$2.\$3 [\$3,decoy].\$1.\$2
+ put $GETME
+ STOP
+ HOME=$TMPDIR \
+ $FTP "$TARGET6" $PORT -6 -v -p -t >$TMPDIR/ftp.stdout 2>&1
+
+ sIFS=$IFS
+ IFS=.
+ set -- $GETME
+ IFS=$sIFS
+
+ # Are the expected file copies present?
+
+ if test -s $FTPHOME$DLDIR/$2.$1 && \
+ test -s $FTPHOME$DLDIR/decoy.$GETME
+ then
+ test "${VERBOSE+yes}" && echo >&2 'Name mapping succeeded.'
+ rm -f $FTPHOME$DLDIR/$2.$1 $FTPHOME$DLDIR/decoy.$GETME
+ else
+ echo >&2 'Binary transfer failed.'
+ test -s $FTPHOME$DLDIR/$2.$1 || \
+ echo >&2 'Mapping "nmap $1.$2 $2.$1" failed.'
+ test -s $FTPHOME$DLDIR/copy.$GETME || \
+ echo >&2 'Mapping "nmap $1.$2.$3 [$3,decoy].$1.$2" failed.'
+ rm -f $FTPHOME$DLDIR/$2.$1 $FTPHOME$DLDIR/decoy.$GETME
+ exit 1
+ fi
+fi # TEST_IPV6 && TARGET6 && do_transfer
+
exit 0
diff --git a/tests/syslogd.sh b/tests/syslogd.sh
index 8083a11..19e5209 100755
--- a/tests/syslogd.sh
+++ b/tests/syslogd.sh
@@ -443,22 +443,35 @@ if $do_inet_socket; then
TESTCASES=`expr $TESTCASES + 1`
$LOGGER -6 -h "[$TARGET6]:$PORT" -p user.info -t "$TAG" \
"Sending IPv6 message. (pid $$)"
- fi # TEST_IPV6 && TARGET
+ fi # TEST_IPV6 && TARGET6
fi # do_inet_socket
-# Send message of priority notice, either via local socket or IPv4,
-# but not both. The presence is checked in $OUT and in $OUT_NOTICE,
-# so merit value is 2.
+# Send message of priority notice, via local socket, IPv4, or IPv6,
+# whatever is there. The presence is checked in $OUT and in $OUT_NOTICE,
+# so merit value is 2 for each placed message.
+COUNT_WRAP=0
+
if $do_unix_socket; then
TESTCASES=`expr $TESTCASES + 2`
+ COUNT_WRAP=`expr $COUNT_WRAP + 1`
$LOGGER -h "$SOCKET" -p daemon.notice -t "$TAG" \
- "Attemping to locate wrapped configuration. (pid $$)"
-elif $do_inet_socket; then
+ "Attempting to locate wrapped unix configuration. (pid $$)"
+fi # do_unix_socket
+
+if $do_inet_socket; then
if test "$TEST_IPV4" != "no" && test -n "$TARGET"; then
TESTCASES=`expr $TESTCASES + 2`
+ COUNT_WRAP=`expr $COUNT_WRAP + 1`
$LOGGER -4 -h "$TARGET:$PORT" -p daemon.notice -t "$TAG" \
- "Attemping to locate wrapped configuration. (pid $$)"
+ "Attempting to locate wrapped IPv4 configuration. (pid $$)"
fi # TEST_IPV4 && TARGET
+
+ if test "$TEST_IPV6" != "no" && test -n "$TARGET6"; then
+ TESTCASES=`expr $TESTCASES + 2`
+ COUNT_WRAP=`expr $COUNT_WRAP + 1`
+ $LOGGER -6 -h "[$TARGET6]:$PORT" -p daemon.notice -t "$TAG" \
+ "Attempting to locate wrapped IPv6 configuration. (pid $$)"
+ fi # TEST_IPV6 && TARGET6
fi # do_inet_socket
# Generate a more elaborate message routing, aimed at confirming
@@ -550,6 +563,14 @@ if $do_inet_socket; then
$LOGGER -4 -h "$TARGET:$PORT" -p user.debug -t "$TAG2" \
"user.debug as IPv4 message. (pid $$)"
fi # TEST_IPV4 && TARGET
+
+ if test "$TEST_IPV6" != "no" && test -n "$TARGET6"; then
+ TESTCASES=`expr $TESTCASES + 4`
+ $LOGGER -6 -h "[$TARGET6]:$PORT" -p user.info -t "$TAG2" \
+ "user.info as IPv6 message. (pid $$)"
+ $LOGGER -6 -h "[$TARGET6]:$PORT" -p user.debug -t "$TAG2" \
+ "user.debug as IPv6 message. (pid $$)"
+ fi # TEST_IPV6 && TARGET6
fi # do_inet_socket
# Remove previous SYSLOG daemon.
@@ -602,9 +623,10 @@ COUNT=`$GREP -c "$TAG" "$OUT"`
COUNT_NOTICE=`$SED -n '$=' "$OUT_NOTICE"`
wrapped=`$FGREP -c -f "$OUT_NOTICE" "$OUT"`
-COUNT_WRAP=0
+# Provoke a later total miscount, if message counts do not match now.
if $do_unix_socket || $do_inet_socket; then
- test $COUNT_NOTICE -ne $wrapped || COUNT_WRAP=1
+ test $COUNT_NOTICE -eq $wrapped ||
+ COUNT_WRAP=`expr $COUNT_WRAP - $COUNT_NOTICE + $wrapped`
fi
# Second set-up after SIGHUP.
diff --git a/tests/tftp.sh b/tests/tftp.sh
index e2fdf60..d7d016c 100755
--- a/tests/tftp.sh
+++ b/tests/tftp.sh
@@ -446,37 +446,46 @@ if $do_secure_setting; then
# Let inetd reload configuration.
kill -HUP $inetd_pid
- # Test two files: file-small and asciifile.txt
+ # Test two files for each address: file-small and asciifile.txt
#
- addr=`echo $ADDRESSES | $SED 's/ .*//'`
- name=`echo "$FILELIST" | $SED 's/ .*//'`
- rm -f "$name" "$ASCIIFILE"
- EFFORTS=`expr $EFFORTS + 2`
-
- echo "binary
-get $name
-ascii
-get /tftp-test/$ASCIIFILE" | \
- eval "$TFTP" ${VERBOSE:+-v} "$addr" $PORT $bucket
-
- cmp "$TMPDIR/tftp-test/$name" "$name" 2>/dev/null
- result=$?
- if test $? -ne 0; then
- $silence echo >&2 "Failed chrooted access to $name."
- RESULT=$result
- else
- $silence echo >&2 "Success with chrooted access to $name."
- SUCCESSES=`expr $SUCCESSES + 1`
- fi
- cmp "$TMPDIR/tftp-test/$ASCIIFILE" "$ASCIIFILE" 2>/dev/null
- result=$?
- if test $? -ne 0; then
- $silence echo >&2 "Failed chrooted access to /tftp-test/$ASCIIFILE."
- RESULT=$result
- else
- $silence echo >&2 "Success with chrooted /tftp-test/$ASCIIFILE."
- SUCCESSES=`expr $SUCCESSES + 1`
- fi
+ name=`echo $FILELIST | $SED 's/ .*//'`
+
+ for addr in $ADDRESSES; do
+ rm -f "$name" "$ASCIIFILE"
+ EFFORTS=`expr $EFFORTS + 2`
+
+ cat <<-EOT |
+ binary
+ get $name
+ ascii
+ get /tftp-test/$ASCIIFILE
+ EOT
+ eval "$TFTP" ${VERBOSE:+-v} "$addr" $PORT $bucket
+
+ cmp "$TMPDIR/tftp-test/$name" "$name" 2>/dev/null
+ result=$?
+
+ if test $? -ne 0; then
+ $silence echo >&2 "Failed chrooted access to $addr:$name."
+ RESULT=$result
+ else
+ $silence echo >&2 "Success with chrooted access to $addr:$name."
+ SUCCESSES=`expr $SUCCESSES + 1`
+ fi
+
+ cmp "$TMPDIR/tftp-test/$ASCIIFILE" "$ASCIIFILE" 2>/dev/null
+ result=$?
+
+ if test $? -ne 0; then
+ $silence echo >&2 \
+ "Failed chrooted access to $addr:/tftp-test/$ASCIIFILE."
+ RESULT=$result
+ else
+ $silence echo >&2 \
+ "Success with chrooted $addr:/tftp-test/$ASCIIFILE."
+ SUCCESSES=`expr $SUCCESSES + 1`
+ fi
+ done # addr in ADDRESSES
else
$silence echo >&2 'Informational: Inhibiting chroot test.'
fi
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 18 +++++++
tests/.gitignore | 1 +
tests/ftp-localhost.sh | 128 +++++++++++++++++++++++++++++++++++++++++++------
tests/syslogd.sh | 40 ++++++++++++----
tests/tftp.sh | 69 ++++++++++++++------------
5 files changed, 202 insertions(+), 54 deletions(-)
hooks/post-receive
--
GNU Inetutils
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [SCM] GNU Inetutils branch, master, updated. inetutils-1_9_4-67-g45f0ab0,
Mats Erik Andersson <=