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_1-101-g0a66b


From: Mats Erik Andersson
Subject: [SCM] GNU Inetutils branch, master, updated. inetutils-1_9_1-101-g0a66bdd
Date: Sat, 26 May 2012 21:59:49 +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  0a66bdd5a5318bd9a2a6861e423040ed99cb069e (commit)
      from  02389aa8517089cac8a9635dfe52bcfc96cb75eb (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=0a66bdd5a5318bd9a2a6861e423040ed99cb069e


commit 0a66bdd5a5318bd9a2a6861e423040ed99cb069e
Author: Mats Erik Andersson <address@hidden>
Date:   Sat May 26 23:03:48 2012 +0200

    More FTP test cases.

diff --git a/ChangeLog b/ChangeLog
index 93b8a5c..528339e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,16 @@
 2012-05-26  Mats Erik Andersson  <address@hidden>
 
+       * tests/ftp-localhost.sh (do_transfer, GETME, PUTME):
+       New variables.  Environmental TRANSFERTEST sets do_transfer.
+       (posttesting): Remove file `$FTPHOME/$PUTME' if $do_transfer
+       is true and file exists.
+       (test_report): Lessen verbosity by printing exchange data
+       only if $VERBOSE is non-empty.
+       [do_transfer]: Execute transmission tests.  These execute
+       an additional `put' for selected addressing and modes.
+
+2012-05-26  Mats Erik Andersson  <address@hidden>
+
        ftp: Reporting and accounting of large files.
 
        * ftp/extern.h (ptransfer): New signature
diff --git a/tests/ftp-localhost.sh b/tests/ftp-localhost.sh
index 684c717..41a68b1 100755
--- a/tests/ftp-localhost.sh
+++ b/tests/ftp-localhost.sh
@@ -39,6 +39,8 @@
 #
 # Wanted:  * standalone-mode
 #          * underprivileged mode.
+#
+# FIXME: Resolve the hard coded dependency on anonymous mode.
 
 # Address mapping IPv4-to-IPv6 is not uniform an all platforms,
 # thus separately using `tcp4' and `tcp6' for streams in `inetd.conf'.
@@ -56,6 +58,16 @@ TARGET=${TARGET:-127.0.0.1}
 TARGET6=${TARGET6:-::1}
 TARGET46=${TARGET46:-::ffff:127.0.0.1}
 
+# Extended transmission testing.
+# This puts contents into $FTPHOME,
+# and is therefore not active by default.
+do_transfer=false
+test "${TRANSFERTEST+yes}" = "yes" && do_transfer=true
+
+# Files used in transmission tests.
+GETME=getme.$$
+PUTME=putme.$$
+
 # Portability fix for SVR4
 PWD="${PWD:-`pwd`}"
 
@@ -156,6 +168,9 @@ posttesting () {
        && { kill "`cat $TMPDIR/inetd.pid`" \
             || kill -9 "`cat $TMPDIR/inetd.pid`"; }
     test -n "$TMPDIR" && test -d "$TMPDIR" && rm -rf "$TMPDIR"
+    $do_transfer && test -n "$FTPHOME" \
+       && test -f "$FTPHOME/$PUTME" && rm -f "$FTPHOME/$PUTME" \
+       || true
 }
 
 trap posttesting 0 1 2 3 15
@@ -215,6 +230,9 @@ fi
 
 chmod 600 "$TMPDIR/.netrc"
 
+# Some simple, but variable content.
+ls -l > "$TMPDIR/$GETME"
+
 $INETD --pidfile="$TMPDIR/inetd.pid" "$TMPDIR/inetd.conf" ||
     {
        echo 'Not able to start Inetd.  Skipping test.' >&2
@@ -240,7 +258,7 @@ test -r "$TMPDIR/inetd.pid" ||
 # test_report  errno output_file hint_msg
 #
 test_report () {
-    test -z "${VERBOSE+yes}" || cat "$2"
+    test -z "${VERBOSE}" || cat "$2"
 
     if [ $1 != 0 ]; then
        echo "Running '$FTP' failed with errno $1." >&2
@@ -276,22 +294,48 @@ echo "PASV to $TARGET (IPv4) using inetd."
 cat <<STOP |
 rstatus
 dir
+`$do_transfer && echo "\
+lcd $TMPDIR
+image
+put $GETME $PUTME"`
 STOP
 HOME=$TMPDIR $FTP "$TARGET" $PORT -4 -v -p -t >$TMPDIR/ftp.stdout 2>&1
 
 test_report $? "$TMPDIR/ftp.stdout" "PASV/$TARGET"
 
+$do_transfer && \
+    if cmp -s "$TMPDIR/$GETME" "$FTPHOME/$PUTME"; then
+       test "${VERBOSE+yes}" && echo >&2 'Binary transfer succeeded.'
+       date "+%s" >> "$TMPDIR/$GETME"
+    else
+       echo >&2 'Binary transfer failed.'
+       exit 1
+    fi
+
 # Test an active connection: PORT and IPv4.
 #
 echo "PORT to $TARGET (IPv4) using inetd."
 cat <<STOP |
 rstatus
 dir
+`$do_transfer && echo "\
+lcd $TMPDIR
+image
+put $GETME $PUTME"`
 STOP
 HOME=$TMPDIR $FTP "$TARGET" $PORT -4 -v -t >$TMPDIR/ftp.stdout 2>&1
 
 test_report $? "$TMPDIR/ftp.stdout" "PORT/$TARGET"
 
+$do_transfer && \
+    if cmp -s "$TMPDIR/$GETME" "$FTPHOME/$PUTME"; then
+       test "${VERBOSE+yes}" && echo >&2 'Binary transfer succeeded.'
+       date "+%s" >> "$TMPDIR/$GETME"
+    else
+       echo >&2 'Binary transfer failed.'
+       exit 1
+    fi
+
 # Test a passive connection: EPSV and IPv4.
 #
 echo "EPSV to $TARGET (IPv4) using inetd."
@@ -311,11 +355,24 @@ cat <<STOP |
 rstatus
 epsv4
 dir
+`$do_transfer && echo "\
+lcd $TMPDIR
+image
+put $GETME $PUTME"`
 STOP
 HOME=$TMPDIR $FTP "$TARGET" $PORT -4 -v -t >$TMPDIR/ftp.stdout 2>&1
 
 test_report $? "$TMPDIR/ftp.stdout" "EPRT/$TARGET"
 
+$do_transfer && \
+    if cmp -s "$TMPDIR/$GETME" "$FTPHOME/$PUTME"; then
+       test "${VERBOSE+yes}" && echo >&2 'Binary transfer succeeded.'
+       date "+%s" >> "$TMPDIR/$GETME"
+    else
+       echo >&2 'Binary transfer failed.'
+       exit 1
+    fi
+
 # Test a passive connection: EPSV and IPv6.
 #
 echo "EPSV to $TARGET6 (IPv6) using inetd."
@@ -333,11 +390,24 @@ echo "EPRT to $TARGET6 (IPv6) using inetd."
 cat <<STOP |
 rstatus
 dir
+`$do_transfer && echo "\
+lcd $TMPDIR
+image
+put $GETME $PUTME"`
 STOP
 HOME=$TMPDIR $FTP "$TARGET6" $PORT -6 -v -t >$TMPDIR/ftp.stdout 2>&1
 
 test_report $? "$TMPDIR/ftp.stdout" "EPRT/$TARGET6"
 
+$do_transfer && \
+    if cmp -s "$TMPDIR/$GETME" "$FTPHOME/$PUTME"; then
+       test "${VERBOSE+yes}" && echo >&2 'Binary transfer succeeded.'
+       date "+%s" >> "$TMPDIR/$GETME"
+    else
+       echo >&2 'Binary transfer failed.'
+       exit 1
+    fi
+
 # Availability of IPv4-mapped IPv6 addresses.
 #
 # These are impossible on OpenBSD, so a flexible test
@@ -398,21 +468,46 @@ if $have_address_mapping && test -n "$TARGET46" ; then
     cat <<-STOP |
        rstatus
        dir
+       `$do_transfer && echo "\
+lcd $TMPDIR
+image
+put $GETME $PUTME"`
        STOP
     HOME=$TMPDIR $FTP "$TARGET46" $PORT -6 -v -p -t >$TMPDIR/ftp.stdout 2>&1
 
     test_report $? "$TMPDIR/ftp.stdout" "EPSV/$TARGET46"
 
+    $do_transfer && \
+       if cmp -s "$TMPDIR/$GETME" "$FTPHOME/$PUTME"; then
+           test "${VERBOSE+yes}" && echo >&2 'Binary transfer succeeded.'
+           date "+%s" >> "$TMPDIR/$GETME"
+       else
+           echo >&2 'Binary transfer failed.'
+           exit 1
+       fi
+
     # Test an active connection: EPRT and IPvIPv6.
     #
     echo "EPRT to $TARGET46 (IPv4-as-IPv6) using inetd."
     cat <<-STOP |
        rstatus
        dir
+       `$do_transfer && echo "\
+lcd $TMPDIR
+image
+put $GETME $PUTME"`
        STOP
     HOME=$TMPDIR $FTP "$TARGET46" $PORT -6 -v -t >$TMPDIR/ftp.stdout 2>&1
 
     test_report $? "$TMPDIR/ftp.stdout" "EPRT/$TARGET46"
+
+    $do_transfer && \
+       if cmp -s "$TMPDIR/$GETME" "$FTPHOME/$PUTME"; then
+           test "${VERBOSE+yes}" && echo >&2 'Binary transfer succeeded.'
+       else
+           echo >&2 'Binary transfer failed.'
+           exit 1
+       fi
 else
     # The IPv4-as-IPv6 tests were not performed.
     echo 'Skipping two tests of IPv4 mapped as IPv6.'

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

Summary of changes:
 ChangeLog              |   11 +++++
 tests/ftp-localhost.sh |   97 +++++++++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 107 insertions(+), 1 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 



reply via email to

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