All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [RFC PATCH 0/7] Remove network test for ancient software
@ 2017-10-18 13:49 Petr Vorel
  2017-10-18 13:49 ` [LTP] [RFC PATCH 1/7] net/tcp_cmds: Remove rwho test Petr Vorel
                   ` (7 more replies)
  0 siblings, 8 replies; 15+ messages in thread
From: Petr Vorel @ 2017-10-18 13:49 UTC (permalink / raw)
  To: ltp

Hi,

I'm proposing to remove tests for ancient software.
I don't think we should be maintaining tests for something which hardly anyone use.

Kind regards,
Petr

Petr Vorel (7):
  net/tcp_cmds: Remove rwho test
  net/tcp_cmds: Remove rdist test
  net/tcp_cmds: Remove rlogin test
  net/tcp_cmds: Remove rsh test
  net/tcp_cmds: Remove rcp test
  net/tcp_cmds: Remove finger test
  net/tcp_cmds: Remove echo test

 runtest/net.tcp_cmds                         |   7 -
 testcases/network/tcp_cmds/echo/Makefile     |  38 ---
 testcases/network/tcp_cmds/echo/createfile.c |  52 ----
 testcases/network/tcp_cmds/echo/echo01       | 127 ---------
 testcases/network/tcp_cmds/echo/echoes.c     | 375 ---------------------------
 testcases/network/tcp_cmds/finger/Makefile   |  31 ---
 testcases/network/tcp_cmds/finger/finger01   | 203 ---------------
 testcases/network/tcp_cmds/rcp/Makefile      |  30 ---
 testcases/network/tcp_cmds/rcp/rcp01         | 144 ----------
 testcases/network/tcp_cmds/rdist/Makefile    |  30 ---
 testcases/network/tcp_cmds/rdist/rdist01     | 187 -------------
 testcases/network/tcp_cmds/rlogin/Makefile   |  31 ---
 testcases/network/tcp_cmds/rlogin/rlogin01   |  90 -------
 testcases/network/tcp_cmds/rsh/Makefile      |  31 ---
 testcases/network/tcp_cmds/rsh/rsh01         | 115 --------
 testcases/network/tcp_cmds/rwho/Makefile     |  31 ---
 testcases/network/tcp_cmds/rwho/rwho01       |  91 -------
 17 files changed, 1613 deletions(-)
 delete mode 100644 testcases/network/tcp_cmds/echo/Makefile
 delete mode 100644 testcases/network/tcp_cmds/echo/createfile.c
 delete mode 100755 testcases/network/tcp_cmds/echo/echo01
 delete mode 100644 testcases/network/tcp_cmds/echo/echoes.c
 delete mode 100644 testcases/network/tcp_cmds/finger/Makefile
 delete mode 100755 testcases/network/tcp_cmds/finger/finger01
 delete mode 100644 testcases/network/tcp_cmds/rcp/Makefile
 delete mode 100755 testcases/network/tcp_cmds/rcp/rcp01
 delete mode 100644 testcases/network/tcp_cmds/rdist/Makefile
 delete mode 100755 testcases/network/tcp_cmds/rdist/rdist01
 delete mode 100644 testcases/network/tcp_cmds/rlogin/Makefile
 delete mode 100755 testcases/network/tcp_cmds/rlogin/rlogin01
 delete mode 100644 testcases/network/tcp_cmds/rsh/Makefile
 delete mode 100755 testcases/network/tcp_cmds/rsh/rsh01
 delete mode 100644 testcases/network/tcp_cmds/rwho/Makefile
 delete mode 100755 testcases/network/tcp_cmds/rwho/rwho01

-- 
2.14.2


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [LTP] [RFC PATCH 1/7] net/tcp_cmds: Remove rwho test
  2017-10-18 13:49 [LTP] [RFC PATCH 0/7] Remove network test for ancient software Petr Vorel
@ 2017-10-18 13:49 ` Petr Vorel
  2017-10-25 15:16   ` Alexey Kodanev
  2017-10-18 13:49 ` [LTP] [RFC PATCH 2/7] net/tcp_cmds: Remove rdist test Petr Vorel
                   ` (6 subsequent siblings)
  7 siblings, 1 reply; 15+ messages in thread
From: Petr Vorel @ 2017-10-18 13:49 UTC (permalink / raw)
  To: ltp

rwhod daemon is way too old to bother to test it.

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 runtest/net.tcp_cmds                     |  1 -
 testcases/network/tcp_cmds/rwho/Makefile | 31 -----------
 testcases/network/tcp_cmds/rwho/rwho01   | 91 --------------------------------
 3 files changed, 123 deletions(-)
 delete mode 100644 testcases/network/tcp_cmds/rwho/Makefile
 delete mode 100755 testcases/network/tcp_cmds/rwho/rwho01

diff --git a/runtest/net.tcp_cmds b/runtest/net.tcp_cmds
index b7daf9d35..dab7128e8 100644
--- a/runtest/net.tcp_cmds
+++ b/runtest/net.tcp_cmds
@@ -16,7 +16,6 @@ rcp export TCbin=$LTPROOT/testcases/network/tcp_cmds/rcp; rcp01
 rdist export TCbin=$LTPROOT/testcases/network/tcp_cmds/rdist; rdist01
 rlogin rlogin01
 rsh rsh01
-rwho rwho01
 sendfile export TCbin=$LTPROOT/testcases/network/tcp_cmds/sendfile; sendfile01
 tcpdump tcpdump01
 telnet telnet01
diff --git a/testcases/network/tcp_cmds/rwho/Makefile b/testcases/network/tcp_cmds/rwho/Makefile
deleted file mode 100644
index 508fc85e1..000000000
--- a/testcases/network/tcp_cmds/rwho/Makefile
+++ /dev/null
@@ -1,31 +0,0 @@
-#
-#    network/tcp_cmds/rwho testcases Makefile.
-#
-#    Copyright (C) 2009, Cisco Systems Inc.
-#
-#    This program 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 2 of the License, or
-#    (at your option) any later version.
-#
-#    This program 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, write to the Free Software Foundation, Inc.,
-#    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Ngie Cooper, July 2009
-#
-
-top_srcdir		?= ../../../..
-
-include $(top_srcdir)/include/mk/env_pre.mk
-
-INSTALL_TARGETS		:= rwho01
-
-MAKE_TARGETS		:=
-
-include $(top_srcdir)/include/mk/generic_leaf_target.mk
diff --git a/testcases/network/tcp_cmds/rwho/rwho01 b/testcases/network/tcp_cmds/rwho/rwho01
deleted file mode 100755
index 9842aba7a..000000000
--- a/testcases/network/tcp_cmds/rwho/rwho01
+++ /dev/null
@@ -1,91 +0,0 @@
-#!/bin/sh
-# Copyright (c) 2016 Oracle and/or its affiliates. All Rights Reserved.
-# Copyright (c) International Business Machines  Corp., 2000
-#
-# This program 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 2 of
-# the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it would 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/>.
-#
-# PURPOSE: To test the basic functionality of the rwhod daemon using the
-#          `rwho` and `ruptime` commands.
-#
-
-TCID=rwho01
-TST_TOTAL=25
-TST_CLEANUP="do_cleanup"
-
-. test_net.sh
-
-LHOST_PID=
-RHOST_PID=
-
-do_setup()
-{
-	tst_check_cmds cut hostname killall rwho ruptime
-
-	LHOST=$(hostname | cut -f1 -d.)
-
-	pgrep -x rwhod > /dev/null
-	if [ $? -ne 0 ]; then
-		tst_resm TINFO "Starting rwhod on $LHOST"
-		ROD rwhod
-		LHOST_PID=$(pgrep -x rwhod)
-		[ -z "$LHOST_PID" ] && \
-			tst_brkm TBROK "Unable to start rwhod on $LHOST"
-	fi
-
-	tst_rhost_run -c "pgrep -x rwhod" > /dev/null
-	if [ $? -ne 0 ]; then
-		tst_resm TINFO "Starting rwhod on $RHOST"
-		tst_rhost_run -s -c "rwhod"
-		RHOST_PID=$(tst_rhost_run -c "pgrep -x rwhod")
-		[ -z "$RHOST_PID" ] && \
-			tst_brkm TBROK "Unable to start rwhod on $RHOST"
-	fi
-
-	RHOSTNAME=$(tst_rhost_run -c "hostname | cut -f1 -d.")
-	[ "$RHOSTNAME" ] || tst_brkm TBROK "Unable to determine RHOSTNAME"
-}
-
-do_test()
-{
-	rwho -a | grep -q $LHOST || \
-		tst_brkm TFAIL "$LHOST isn't in rwho output"
-	rwho -a | grep -q $RHOSTNAME || \
-		tst_brkm TFAIL "$RHOSTNAME isn't in rwho output"
-	ruptime -a | grep -q $LHOST || \
-		tst_brkm TFAIL "$LHOST is not in ruptime outfile"
-	ruptime -a | grep -q $RHOSTNAME || \
-		tst_brkm TFAIL "$RHOSTNAME is not in ruptime outfile"
-}
-
-do_cleanup()
-{
-	if [ "$LHOST_PID" ]; then
-		tst_resm TINFO "Stopping rwhod on $LHOST"
-		killall rwhod
-	fi
-
-	if [ "$RHOST_PID" ]; then
-		tst_resm TINFO "Stopping rwhod on $RHOST"
-		tst_rhost_run -c "killall rwhod"
-	fi
-}
-
-do_setup
-
-for i in $(seq 1 $TST_TOTAL); do
-	do_test
-	tst_resm TPASS "Test $i/$TST_COUNT complete"
-done
-
-tst_exit
-- 
2.14.2


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [LTP] [RFC PATCH 2/7] net/tcp_cmds: Remove rdist test
  2017-10-18 13:49 [LTP] [RFC PATCH 0/7] Remove network test for ancient software Petr Vorel
  2017-10-18 13:49 ` [LTP] [RFC PATCH 1/7] net/tcp_cmds: Remove rwho test Petr Vorel
@ 2017-10-18 13:49 ` Petr Vorel
  2017-10-18 13:49 ` [LTP] [RFC PATCH 3/7] net/tcp_cmds: Remove rlogin test Petr Vorel
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 15+ messages in thread
From: Petr Vorel @ 2017-10-18 13:49 UTC (permalink / raw)
  To: ltp

rdist is way too old to bother to test it.

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 runtest/net.tcp_cmds                      |   1 -
 testcases/network/tcp_cmds/rdist/Makefile |  30 -----
 testcases/network/tcp_cmds/rdist/rdist01  | 187 ------------------------------
 3 files changed, 218 deletions(-)
 delete mode 100644 testcases/network/tcp_cmds/rdist/Makefile
 delete mode 100755 testcases/network/tcp_cmds/rdist/rdist01

diff --git a/runtest/net.tcp_cmds b/runtest/net.tcp_cmds
index dab7128e8..151b7d22f 100644
--- a/runtest/net.tcp_cmds
+++ b/runtest/net.tcp_cmds
@@ -13,7 +13,6 @@ netstat netstat01
 ping01 ping01.sh
 ping02 ping02.sh
 rcp export TCbin=$LTPROOT/testcases/network/tcp_cmds/rcp; rcp01
-rdist export TCbin=$LTPROOT/testcases/network/tcp_cmds/rdist; rdist01
 rlogin rlogin01
 rsh rsh01
 sendfile export TCbin=$LTPROOT/testcases/network/tcp_cmds/sendfile; sendfile01
diff --git a/testcases/network/tcp_cmds/rdist/Makefile b/testcases/network/tcp_cmds/rdist/Makefile
deleted file mode 100644
index 0d2ad6a29..000000000
--- a/testcases/network/tcp_cmds/rdist/Makefile
+++ /dev/null
@@ -1,30 +0,0 @@
-#
-#    network/tcp_cmds/rdist testcases Makefile.
-#
-#    Copyright (C) 2009, Cisco Systems Inc.
-#
-#    This program 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 2 of the License, or
-#    (at your option) any later version.
-#
-#    This program 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, write to the Free Software Foundation, Inc.,
-#    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Ngie Cooper, September 2009
-#
-
-top_srcdir		?= ../../../..
-
-include $(top_srcdir)/include/mk/testcases.mk
-include $(abs_srcdir)/../Makefile.inc
-
-INSTALL_TARGETS		:= rdist01
-
-include $(top_srcdir)/include/mk/generic_leaf_target.mk
diff --git a/testcases/network/tcp_cmds/rdist/rdist01 b/testcases/network/tcp_cmds/rdist/rdist01
deleted file mode 100755
index 9fdaf1bed..000000000
--- a/testcases/network/tcp_cmds/rdist/rdist01
+++ /dev/null
@@ -1,187 +0,0 @@
-#!/bin/sh
-#
-#
-#   Copyright (c) International Business Machines  Corp., 2000
-#
-#   This program 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 2 of the License, or
-#   (at your option) any later version.
-#
-#   This program 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, write to the Free Software
-#   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-#
-#
-#
-#  FILE   : rdist
-#
-#  PURPOSE: To test the basic functionality of the `rdist` command.
-#
-#  SETUP: The home directory of root on the machine exported as "RHOST"
-#         MUST have a ".rhosts" file with the hostname of the machine
-#         where the test is executed.
-#
-#  HISTORY:
-#    06/06/03 Manoj Iyer manjo@mail.utexas.edu
-#    - Modified testcases to use test harness APIs and fixed defects
-#    03/01 Robbie Williamson (robbiew@us.ibm.com)
-#      -Ported
-#
-#
-#***********************************************************************
-
-#-----------------------------------------------------------------------
-#
-# FUNCTION:  do_setup
-#
-#-----------------------------------------------------------------------
-
-do_setup()
-{
-
-    USER_LIST=${USER_LIST:-'root'}
-    TCdat=${TCdat:-$LTPROOT/testcases/bin/datafiles}
-    TCtmp=${TCtmp:-$LTPROOT/testcases/bin/$TC${EXEC_SUFFIX}$$}
-    FILES=${FILES:-'bin.sm bin.med bin.lg bin.jmb file.dir/bin.sm file.dir/bin.med file.dir/bin.jmb'}
-    SLEEPTIME=${SLEEPTIME:-10}
-
-    tst_setup
-
-    exists awk hostname rdist
-
-    RHOST=${RHOST:-`hostname`}
-
-    # start with a clean LHOST
-    for i in $FILES; do
-        rm -rf $i
-    done
-
-    for i in $FILES; do
-        BASE=$(basename "$i")
-        DIR=$(dirname "$i")
-        test -d "$DIR" || mkdir -p "$DIR"
-        if [ $? -ne 0 ] ; then
-            end_testcase "failed to create $DIR"
-        fi
-        if ! cp $TCdat/$BASE $DIR; then
-            end_testcase "failed to copy $TCdat/$BASE to $DIR"
-        fi
-        chmod 764 $i
-    done
-
-    # get the sum of all the files to rdist on the local machine
-    LSUM=0
-    SUM=`sum -s $FILES | awk '{ print $1 }'`
-    for i in $SUM; do
-        LSUM=$(( $LSUM + $i ))
-    done
-}
-
-#-----------------------------------------------------------------------
-#
-# FUNCTION:  create_distfile
-# create file $TCtmp/distfile
-#
-#-----------------------------------------------------------------------
-
-create_distfile()
-{
-    T_FILES="FILES = ( "
-    for i in $FILES; do
-        if [ $(dirname "$i") == "." ]; then
-            T_FILES="$T_FILES $i"
-        else
-            T_FILES="$T_FILES $DIR"
-        fi
-    done
-    T_FILES="$T_FILES )"
-
-    T_HOST="HOSTS = ("
-    for c_ruser in $RUSERS; do
-        for c_rhost in $HOSTS; do
-         T_HOST=$T_HOST" $c_ruser@$c_rhost"
-        done
-    done
-
-    T_HOST="$T_HOST)"
-    cat <<EOF > "$TCtmp/distfile"
-$T_HOST
-$T_FILES
-\${FILES} -> \${HOSTS}
-EOF
-}
-
-#-----------------------------------------------------------------------
-#
-# FUNCTION:  check_result
-#
-# check the sum of all files rdisted from local machine to remote machine
-#
-#-----------------------------------------------------------------------
-
-check_result()
-{
-    cd $TCtmp
-    for c_rhost in $HOSTS; do
-        for c_ruser in $RUSERS; do
-            TOTAL_SUM=0
-            for i in $(rsh -n -l $c_ruser $c_rhost sum -s $FILES | awk '{ print $1 }'); do
-                TOTAL_SUM=$(( $TOTAL_SUM + $i ))
-            done
-            if [ $TOTAL_SUM -eq $LSUM ]; then
-                tst_resm TINFO "Success rdist in $c_ruser@$c_rhost"
-                rsh -n -l $c_ruser $c_rhost "rm -rf $FILES"
-            else
-                end_testcase "Wrong sum doing rdist in $c_ruser@$c_rhost"
-            fi
-       done
-   done
-}
-
-#----------------------------------------------------------------------
-# FUNCTION: do_test
-# PURPOSE:  Perform the necessary steps to complete the test.
-# INPUT:    None.
-# OUPUT:    Error messages are logged if any of the tests fail.
-# EXIT VAR: 0 Success
-#----------------------------------------------------------------------
-
-do_test()
-{
-    HOSTS=""
-    RUSERS=""
-
-    for cur_host in $RHOST; do
-        HOSTS=$HOSTS" $cur_host"
-        for cur_user in $USER_LIST; do
-            RUSERS=$RUSERS" $cur_user"
-            create_distfile
-            if ! rdist -f $TCtmp/distfile; then
-                end_testcase "error doing rdist -f $TCtmp/distfile"
-            fi
-            check_result
-            sleep $SLEEPTIME
-        done
-    done
-}
-
-#----------------------------------------------------------------------
-# FUNCTION: MAIN
-# PURPOSE:  To invoke the functions to perform the tasks described in
-#           the prologue.
-# INPUT:    None.
-# OUTPUT:   A testcase run log with the results of the execution of this
-#           test.
-#----------------------------------------------------------------------
-. net_cmdlib.sh
-
-read_opts $*
-do_setup
-do_test
-end_testcase
-- 
2.14.2


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [LTP] [RFC PATCH 3/7] net/tcp_cmds: Remove rlogin test
  2017-10-18 13:49 [LTP] [RFC PATCH 0/7] Remove network test for ancient software Petr Vorel
  2017-10-18 13:49 ` [LTP] [RFC PATCH 1/7] net/tcp_cmds: Remove rwho test Petr Vorel
  2017-10-18 13:49 ` [LTP] [RFC PATCH 2/7] net/tcp_cmds: Remove rdist test Petr Vorel
@ 2017-10-18 13:49 ` Petr Vorel
  2017-10-18 13:49 ` [LTP] [RFC PATCH 4/7] net/tcp_cmds: Remove rsh test Petr Vorel
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 15+ messages in thread
From: Petr Vorel @ 2017-10-18 13:49 UTC (permalink / raw)
  To: ltp

rlogin is way too old to bother to test it and has been
deprecated for many years in favour of ssh.

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 runtest/net.tcp_cmds                       |  1 -
 testcases/network/tcp_cmds/rlogin/Makefile | 31 ----------
 testcases/network/tcp_cmds/rlogin/rlogin01 | 90 ------------------------------
 3 files changed, 122 deletions(-)
 delete mode 100644 testcases/network/tcp_cmds/rlogin/Makefile
 delete mode 100755 testcases/network/tcp_cmds/rlogin/rlogin01

diff --git a/runtest/net.tcp_cmds b/runtest/net.tcp_cmds
index 151b7d22f..0bbf95edd 100644
--- a/runtest/net.tcp_cmds
+++ b/runtest/net.tcp_cmds
@@ -13,7 +13,6 @@ netstat netstat01
 ping01 ping01.sh
 ping02 ping02.sh
 rcp export TCbin=$LTPROOT/testcases/network/tcp_cmds/rcp; rcp01
-rlogin rlogin01
 rsh rsh01
 sendfile export TCbin=$LTPROOT/testcases/network/tcp_cmds/sendfile; sendfile01
 tcpdump tcpdump01
diff --git a/testcases/network/tcp_cmds/rlogin/Makefile b/testcases/network/tcp_cmds/rlogin/Makefile
deleted file mode 100644
index 97acadb1e..000000000
--- a/testcases/network/tcp_cmds/rlogin/Makefile
+++ /dev/null
@@ -1,31 +0,0 @@
-#
-#    network/tcp_cmds/rlogin testcases Makefile.
-#
-#    Copyright (C) 2009, Cisco Systems Inc.
-#
-#    This program 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 2 of the License, or
-#    (at your option) any later version.
-#
-#    This program 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, write to the Free Software Foundation, Inc.,
-#    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Ngie Cooper, July 2009
-#
-
-top_srcdir		?= ../../../..
-
-include $(top_srcdir)/include/mk/env_pre.mk
-
-INSTALL_TARGETS		:= rlogin01
-
-MAKE_TARGETS		:=
-
-include $(top_srcdir)/include/mk/generic_leaf_target.mk
diff --git a/testcases/network/tcp_cmds/rlogin/rlogin01 b/testcases/network/tcp_cmds/rlogin/rlogin01
deleted file mode 100755
index 162b8f0d8..000000000
--- a/testcases/network/tcp_cmds/rlogin/rlogin01
+++ /dev/null
@@ -1,90 +0,0 @@
-#!/bin/sh
-#   Copyright (c) International Business Machines  Corp., 2000
-#
-#   This program 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 2 of the License, or
-#   (at your option) any later version.
-#
-#   This program 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, write to the Free Software
-#   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-#
-#    03/01 Robbie Williamson (robbiew@us.ibm.com)
-
-TCID="rlogin01"
-TST_TOTAL=1
-
-. test_net.sh
-
-setup()
-{
-	tst_check_cmds rlogin expect
-
-	if [ -z $RUSER ]; then
-		RUSER=root
-	fi
-
-	if [ -z $PASSWD ]; then
-		tst_brkm TCONF "Please set PASSWD for $RUSER."
-	fi
-
-	if [ -z $RHOST ]; then
-		tst_brkm TCONF "Please set RHOST."
-	fi
-
-	if [ -z $LOOPCOUNT ]; then
-		LOOPCOUNT=25
-	fi
-}
-
-do_test()
-{
-	tst_resm TINFO "Starting"
-
-	for i in $(seq 1 ${LOOPCOUNT})
-	do
-		rlogin_test || return 1
-	done
-}
-
-rlogin_test()
-{
-	tst_resm TINFO "login with rlogin($i/$LOOPCOUNT)"
-
-	expect -c "
-		spawn rlogin $RHOST -l $RUSER
-
-		expect {
-			\"Password:\" {
-				send \"$PASSWD\r\"; exp_continue
-			} \"incorrect\" {
-				exit 1
-			} \"$RUSER@\" {
-				send \"LC_ALL=C; ls -l /etc/hosts | \\
-				       wc -w > $RUSER.$RHOST\rexit\r\";
-				exp_continue
-			}
-		}
-	" > /dev/null || return 1
-
-	tst_resm TINFO "checking telnet status($i/$LOOPCOUNT)"
-	tst_rhost_run -u $RUSER -c "grep -q 9 $RUSER.$RHOST" || return 1
-	tst_rhost_run -u $RUSER -c "rm -f $RUSER.$RHOST"
-}
-
-setup
-
-do_test
-if [ $? -ne 0 ]; then
-	tst_resm TFAIL "Test $TCID failed."
-else
-	tst_resm TPASS "Test $TCID succeeded."
-fi
-
-tst_exit
-- 
2.14.2


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [LTP] [RFC PATCH 4/7] net/tcp_cmds: Remove rsh test
  2017-10-18 13:49 [LTP] [RFC PATCH 0/7] Remove network test for ancient software Petr Vorel
                   ` (2 preceding siblings ...)
  2017-10-18 13:49 ` [LTP] [RFC PATCH 3/7] net/tcp_cmds: Remove rlogin test Petr Vorel
@ 2017-10-18 13:49 ` Petr Vorel
  2017-10-18 13:49 ` [LTP] [RFC PATCH 5/7] net/tcp_cmds: Remove rcp test Petr Vorel
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 15+ messages in thread
From: Petr Vorel @ 2017-10-18 13:49 UTC (permalink / raw)
  To: ltp

rsh is way too old to bother to test it and it has been
deprecated for many years in favour of ssh.

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 runtest/net.tcp_cmds                    |   1 -
 testcases/network/tcp_cmds/rsh/Makefile |  31 ---------
 testcases/network/tcp_cmds/rsh/rsh01    | 115 --------------------------------
 3 files changed, 147 deletions(-)
 delete mode 100644 testcases/network/tcp_cmds/rsh/Makefile
 delete mode 100755 testcases/network/tcp_cmds/rsh/rsh01

diff --git a/runtest/net.tcp_cmds b/runtest/net.tcp_cmds
index 0bbf95edd..d2535ed46 100644
--- a/runtest/net.tcp_cmds
+++ b/runtest/net.tcp_cmds
@@ -13,7 +13,6 @@ netstat netstat01
 ping01 ping01.sh
 ping02 ping02.sh
 rcp export TCbin=$LTPROOT/testcases/network/tcp_cmds/rcp; rcp01
-rsh rsh01
 sendfile export TCbin=$LTPROOT/testcases/network/tcp_cmds/sendfile; sendfile01
 tcpdump tcpdump01
 telnet telnet01
diff --git a/testcases/network/tcp_cmds/rsh/Makefile b/testcases/network/tcp_cmds/rsh/Makefile
deleted file mode 100644
index f8870a3ec..000000000
--- a/testcases/network/tcp_cmds/rsh/Makefile
+++ /dev/null
@@ -1,31 +0,0 @@
-#
-#    network/tcp_cmds/rsh testcases Makefile.
-#
-#    Copyright (C) 2009, Cisco Systems Inc.
-#
-#    This program 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 2 of the License, or
-#    (at your option) any later version.
-#
-#    This program 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, write to the Free Software Foundation, Inc.,
-#    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Ngie Cooper, July 2009
-#
-
-top_srcdir		?= ../../../..
-
-include $(top_srcdir)/include/mk/env_pre.mk
-
-INSTALL_TARGETS		:= rsh01
-
-MAKE_TARGETS		:=
-
-include $(top_srcdir)/include/mk/generic_leaf_target.mk
diff --git a/testcases/network/tcp_cmds/rsh/rsh01 b/testcases/network/tcp_cmds/rsh/rsh01
deleted file mode 100755
index 3968f9056..000000000
--- a/testcases/network/tcp_cmds/rsh/rsh01
+++ /dev/null
@@ -1,115 +0,0 @@
-#!/bin/sh
-#
-#   Copyright (c) International Business Machines  Corp., 2000
-#
-#   This program 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 2 of the License, or
-#   (at your option) any later version.
-#
-#   This program 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, write to the Free Software
-#   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-#
-#
-#
-#  FILE   : rsh
-#
-#  PURPOSE: To test the basic functionality of the `rsh` command.
-#
-#  SETUP: The home directory of root on the machine exported as "RHOST"
-#         MUST have a ".rhosts" file with the hostname of the machine
-#         where the test is executed.
-#
-#  HISTORY:
-#    03/01 Robbie Williamson (robbiew@us.ibm.com)
-#      -Ported
-#
-#
-#
-#----------------------------------------------------------------------
-
-do_setup()
-{
-
-    FAIL_IMMEDIATELY=${FAIL_IMMEDIATELY:-1}
-    SLEEPTIME=${SLEEPTIME:-0}
-    NUMLOOPS=${NUMLOOPS:-1}
-
-    export TST_TOTAL=$NUMLOOPS
-
-    tst_setup
-
-    exists awk hostname rsh
-
-    RHOST=${RHOST:-`hostname`}
-
-}
-
-#-----------------------------------------------------------------------
-#
-# FUNCTION:  do_test
-#
-#-----------------------------------------------------------------------
-
-do_test()
-{
-
-    while [ $TST_COUNT -le $NUMLOOPS ]; do
-
-        PASSED=0
-
-        if OUT=$(rsh -n -l root $RHOST 'ls -l /etc/hosts'); then
-
-            #
-            # Successful output would be something of the form:
-            #
-            # gcooper@orangebox ~ $ ls -l /etc/hosts
-            # -rw-r--r-- 1 root root 463 Jul  5 09:26 /etc/hosts
-            #
-            echo "$OUT" |
-                awk 'BEGIN { RET=1 } NF == 9 && $NF == "/etc/hosts" { RET=0 } END { exit RET }' \
-                > /dev/null 2>&1
-
-            if [ $? -eq 0 ] ; then
-                tst_resm TPASS "rsh to $RHOST test succeeded"
-                PASSED=1
-            fi
-
-        fi
-
-        if [ $PASSED -ne 1 ] ; then
-            tst_resm TFAIL "rsh to $RHOST failed"
-            # If the first rsh failed, the likelihood that the rest will
-            # succeed is low.
-            if [ "$FAIL_IMMEDIATELY" = "1" ] && [ $TST_COUNT -eq 1 ]; then
-                exit 2
-            fi
-        fi
-
-        sleep $SLEEPTIME
-        incr_tst_count
-
-    done
-
-}
-
-#----------------------------------------------------------------------
-# FUNCTION: MAIN
-# PURPOSE:  To invoke the functions to perform the tasks described in
-#           the prologue.
-# INPUT:    None.
-# OUTPUT:   A testcase run log with the results of the execution of this
-#           test.
-#----------------------------------------------------------------------
-. net_cmdlib.sh
-
-read_opts $*
-do_setup
-do_test
-end_testcase
-- 
2.14.2


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [LTP] [RFC PATCH 5/7] net/tcp_cmds: Remove rcp test
  2017-10-18 13:49 [LTP] [RFC PATCH 0/7] Remove network test for ancient software Petr Vorel
                   ` (3 preceding siblings ...)
  2017-10-18 13:49 ` [LTP] [RFC PATCH 4/7] net/tcp_cmds: Remove rsh test Petr Vorel
@ 2017-10-18 13:49 ` Petr Vorel
  2017-10-18 13:50 ` [LTP] [RFC PATCH 6/7] net/tcp_cmds: Remove finger test Petr Vorel
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 15+ messages in thread
From: Petr Vorel @ 2017-10-18 13:49 UTC (permalink / raw)
  To: ltp

rcp is way too old to bother to test it as it has been
deprecated for many years in favour of scp.

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 runtest/net.tcp_cmds                    |   1 -
 testcases/network/tcp_cmds/rcp/Makefile |  30 -------
 testcases/network/tcp_cmds/rcp/rcp01    | 144 --------------------------------
 3 files changed, 175 deletions(-)
 delete mode 100644 testcases/network/tcp_cmds/rcp/Makefile
 delete mode 100755 testcases/network/tcp_cmds/rcp/rcp01

diff --git a/runtest/net.tcp_cmds b/runtest/net.tcp_cmds
index d2535ed46..6d062ce76 100644
--- a/runtest/net.tcp_cmds
+++ b/runtest/net.tcp_cmds
@@ -12,7 +12,6 @@ host host01
 netstat netstat01
 ping01 ping01.sh
 ping02 ping02.sh
-rcp export TCbin=$LTPROOT/testcases/network/tcp_cmds/rcp; rcp01
 sendfile export TCbin=$LTPROOT/testcases/network/tcp_cmds/sendfile; sendfile01
 tcpdump tcpdump01
 telnet telnet01
diff --git a/testcases/network/tcp_cmds/rcp/Makefile b/testcases/network/tcp_cmds/rcp/Makefile
deleted file mode 100644
index 7cb00b096..000000000
--- a/testcases/network/tcp_cmds/rcp/Makefile
+++ /dev/null
@@ -1,30 +0,0 @@
-#
-#    network/tcp_cmds/rcp testcases Makefile.
-#
-#    Copyright (C) 2009, Cisco Systems Inc.
-#
-#    This program 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 2 of the License, or
-#    (at your option) any later version.
-#
-#    This program 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, write to the Free Software Foundation, Inc.,
-#    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Ngie Cooper, September 2009
-#
-
-top_srcdir		?= ../../../..
-
-include $(top_srcdir)/include/mk/testcases.mk
-include $(abs_srcdir)/../Makefile.inc
-
-INSTALL_TARGETS		:= rcp01
-
-include $(top_srcdir)/include/mk/generic_leaf_target.mk
diff --git a/testcases/network/tcp_cmds/rcp/rcp01 b/testcases/network/tcp_cmds/rcp/rcp01
deleted file mode 100755
index 1f54471cd..000000000
--- a/testcases/network/tcp_cmds/rcp/rcp01
+++ /dev/null
@@ -1,144 +0,0 @@
-#!/bin/sh
-#
-#   Copyright (c) International Business Machines  Corp., 2000
-#
-#   This program 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 2 of the License, or
-#   (at your option) any later version.
-#
-#   This program 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, write to the Free Software
-#   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-#
-#
-#
-#  FILE   : rcp
-#
-#  PURPOSE: To test the basic functionality of the `rcp` command.
-#
-#  SETUP: The home directory of root on the machine exported as "RHOST"
-#         MUST have a ".rhosts" file with the hostname of the machine
-#         where the test is executed.
-#
-#  HISTORY:
-#    06/06/03 Manoj Iyer manjo@mail.utexas.edu
-#    - Modified testcases to use test APIS and fixed bugs
-#    03/01 Robbie Williamson (robbiew@us.ibm.com)
-#      -Ported
-#
-#
-#-----------------------------------------------------------------------
-
-#-----------------------------------------------------------------------
-#
-# FUNCTION:  do_setup
-#
-#-----------------------------------------------------------------------
-
-do_setup()
-{
-
-    TCtmp=${TCtmp:-$LTPROOT/testcases/bin/$TC${EXEC_SUFFIX}$$}
-    TCdat=${TCdat:-$LTPROOT/testcases/bin/datafiles}
-    LHOST=`hostname`
-    RHOST=${RHOST:-$LHOST}
-    SLEEPTIME=${SLEEPTIME:-0}
-    FILES=${FILES:-"bin.sm bin.med bin.lg bin.jmb"}
-
-    tst_setup
-
-    exists awk rcp rsh sum
-
-    if ! rsh -n -l root $RHOST mkdir -p $TCtmp 2>&1 1>/dev/null; then
-        end_testcase "Remote mkdir failed"
-    fi
-
-    trap do_cleanup EXIT
-
-}
-
-#-----------------------------------------------------------------------
-#
-# FUNCTION:  do_test
-#
-#-----------------------------------------------------------------------
-
-do_test()
-{
-
-    for j in $FILES; do
-
-        if ! rcp $TCdat/$j $RHOST:$TCtmp/$j; then
-            end_testcase "Failed to rcp file."
-        fi
-
-        SUM1=`sum $TCdat/$j | awk '{print $1}'`
-        SUM2=`rsh -n -l root $RHOST sum $TCtmp/$j | awk '{print $1}'`
-        rsh -n -l root $RHOST "rm -f $TCtmp/$j"
-        sleep $SLEEPTIME
-
-        if [ "$SUM1 = $SUM2" ]; then
-            tst_resm TINFO "rcp $TCdat/$j $RHOST:$TCtmp/$j successful"
-        else
-            end_testcase "FAILED: wrong sum in transfer to $RHOST"
-        fi
-
-        sleep $SLEEPTIME
-
-    done
-
-    for j in $FILES; do
-
-        tst_resm TINFO "remote copying $RHOST:$TCdat/$j to $TCtmp/$j"
-        if ! rcp $RHOST:$TCdat/$j $TCtmp/$j 2>&1 1>/dev/null; then
-            tst_resm TFAIL "Failed to rcp file."; continue
-        fi
-
-        SUM1=`sum $TCtmp/$j | awk '{print $1}'`
-        SUM2=`rsh -n -l root $RHOST sum $TCdat/$j | awk '{print $1}'`
-        rm -f $TCtmp/$j
-        sleep $SLEEPTIME
-
-        if [ "$SUM1" = "$SUM2" ]; then
-            tst_resm TINFO "rcp $RHOST:$TCdat/$j $TCtmp/$j successful"
-        else
-            end_testcase "FAILED: wrong sum in transfer to $LHOST from $RHOST"
-        fi
-        sleep $SLEEPTIME
-
-    done
-
-}
-
-#-----------------------------------------------------------------------
-#
-# FUNCTION:  do_cleanup
-#
-#-----------------------------------------------------------------------
-
-do_cleanup()
-{
-    rsh -n -l root $RHOST rmdir $TCtmp
-    tst_cleanup
-}
-
-#----------------------------------------------------------------------
-# FUNCTION: MAIN
-# PURPOSE:  To invoke the functions to perform the tasks described in
-#           the prologue.
-# INPUT:    None.
-# OUTPUT:   A testcase run log with the results of the execution of this
-#           test.
-#----------------------------------------------------------------------
-. net_cmdlib.sh
-
-read_opts $*
-do_setup
-do_test
-end_testcase
-- 
2.14.2


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [LTP] [RFC PATCH 6/7] net/tcp_cmds: Remove finger test
  2017-10-18 13:49 [LTP] [RFC PATCH 0/7] Remove network test for ancient software Petr Vorel
                   ` (4 preceding siblings ...)
  2017-10-18 13:49 ` [LTP] [RFC PATCH 5/7] net/tcp_cmds: Remove rcp test Petr Vorel
@ 2017-10-18 13:50 ` Petr Vorel
  2017-10-18 13:50 ` [LTP] [RFC PATCH 7/7] net/tcp_cmds: Remove echo test Petr Vorel
  2017-10-18 20:31 ` [LTP] [RFC PATCH 0/7] Remove network test for ancient software Mike Frysinger
  7 siblings, 0 replies; 15+ messages in thread
From: Petr Vorel @ 2017-10-18 13:50 UTC (permalink / raw)
  To: ltp

finger is way too old to bother to test it.

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 runtest/net.tcp_cmds                       |   1 -
 testcases/network/tcp_cmds/finger/Makefile |  31 -----
 testcases/network/tcp_cmds/finger/finger01 | 203 -----------------------------
 3 files changed, 235 deletions(-)
 delete mode 100644 testcases/network/tcp_cmds/finger/Makefile
 delete mode 100755 testcases/network/tcp_cmds/finger/finger01

diff --git a/runtest/net.tcp_cmds b/runtest/net.tcp_cmds
index 6d062ce76..0c565b055 100644
--- a/runtest/net.tcp_cmds
+++ b/runtest/net.tcp_cmds
@@ -6,7 +6,6 @@ ipneigh01 ipneigh01.sh
 arping01 arping01.sh
 clockdiff01 clockdiff01.sh
 echo export TCbin=$LTPROOT/testcases/network/tcp_cmds/echo; echo01
-finger finger01
 ftp export TCbin=$LTPROOT/testcases/network/tcp_cmds/ftp; ftp01
 host host01
 netstat netstat01
diff --git a/testcases/network/tcp_cmds/finger/Makefile b/testcases/network/tcp_cmds/finger/Makefile
deleted file mode 100644
index 891a44f00..000000000
--- a/testcases/network/tcp_cmds/finger/Makefile
+++ /dev/null
@@ -1,31 +0,0 @@
-#
-#    network/tcp_cmds/finger testcases Makefile.
-#
-#    Copyright (C) 2009, Cisco Systems Inc.
-#
-#    This program 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 2 of the License, or
-#    (at your option) any later version.
-#
-#    This program 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, write to the Free Software Foundation, Inc.,
-#    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Ngie Cooper, July 2009
-#
-
-top_srcdir		?= ../../../..
-
-include $(top_srcdir)/include/mk/env_pre.mk
-
-INSTALL_TARGETS		:= finger01
-
-MAKE_TARGETS		:=
-
-include $(top_srcdir)/include/mk/generic_leaf_target.mk
diff --git a/testcases/network/tcp_cmds/finger/finger01 b/testcases/network/tcp_cmds/finger/finger01
deleted file mode 100755
index 59c239722..000000000
--- a/testcases/network/tcp_cmds/finger/finger01
+++ /dev/null
@@ -1,203 +0,0 @@
-#!/bin/sh
-#
-#   Copyright (c) International Business Machines  Corp., 2000
-#
-#   This program 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 2 of the License, or
-#   (at your option) any later version.
-#
-#   This program 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, write to the Free Software
-#   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-#
-#
-#
-#  FILE   : finger
-#
-#  PURPOSE: To test the basic functionality of the `finger` command.
-#
-#  SETUP: The home directory of root on the machine exported as "RHOST"
-#         MUST have a ".rhosts" file with the hostname of the machine
-#         where the test is executed. Also, both machines MUST have
-#         the fingerd daemon active (see inetd or xinetd config file).
-#
-#  HISTORY:
-#    06/06/03 Manoj Iyer - manjo@mail.utexas.edu
-#      - Ported tests to use test macro
-#    03/01 Robbie Williamson (robbiew@us.ibm.com)
-#      -Ported
-#
-#-----------------------------------------------------------------------
-
-#-----------------------------------------------------------------------
-#
-# FUNCTION:  do_setup
-#
-#-----------------------------------------------------------------------
-
-do_setup()
-{
-
-    # Start fingerd locally and remotely.
-    export TST_TOTAL=3
-
-    tst_setup
-
-    exists awk finger hostname netstat rsh whoami
-
-    LHOST=$(hostname)
-    LUSER=$(whoami)
-    RUSER=root
-    RHOST=${RHOST:-$(hostname)}
-    SLEEPTIME=${SLEEPTIME:-1}
-
-    exists awk finger netstat rsh whoami
-
-    [ "$LUSER" = "root" ] || end_testcase "MUST BE root to run the test!"
-
-    FINGER=$(netstat -a | grep ":finger" |awk '{print $6}')
-    if [ "$FINGER" != "LISTEN" ]; then
-        end_testcase "Please start fingerd locally."
-    fi
-
-    FINGER=$(rsh -n $RHOST netstat -a |grep ":finger"|awk '{print $6}')
-    if [ "$FINGER" != "LISTEN" ]; then
-        end_testcase "Please start fingerd on remote host."
-    fi
-}
-
-#-----------------------------------------------------------------------
-# FUNCTION: do_test1
-# PURPOSE: Run finger with no flags
-# INPUT:    None.
-# OUTPUT:   Error messages are logged for all discrepancies found.
-#-----------------------------------------------------------------------
-
-do_test1()
-{
-    tst_resm TINFO "finger: do_test1 started"
-
-    finger @$LHOST  2>&1 1>/dev/null
-    [ $? = 0 ] || end_testcase "finger @$LHOST"
-    finger @$RHOST  2>&1 1>/dev/null
-    [ $? = 0 ] || end_testcase "finger @$RHOST"
-
-    # Testing finger command with user argument
-
-    finger $LUSER 2>&1 1>/dev/null || end_testcase "finger $LUSER"
-    if ! finger $LUSER@$LHOST  2>&1 1>/dev/null; then
-        end_testcase "finger $LUSER@$LHOST"
-    fi
-    finger $RUSER@$RHOST 2>&1 1>/dev/null || end_testcase "finger @$RUSER"
-}
-
-#-----------------------------------------------------------------------
-# FUNCTION: do_test2
-# PURPOSE:  To run the "finger User@host" commands and verify that the
-#           "finger" command is functioning properly.
-# INPUT:    None.
-# OUTPUT:   Error messages are logged for all discrepancies found.
-#-----------------------------------------------------------------------
-
-do_test2()
-{
-    tst_resm TINFO "finger: do_test2 (-bad flag) started"
-    BADUSER="uuuu"
-    BADHOST="xxxx"
-
-    tst_resm TINFO "finger -badflag default "
-    finger -x 2> /dev/null && end_testcase "finger -x should fail"
-
-    tst_resm TINFO "finger -bad user "
-    [ "$(finger $BADUSER 2>&1 1>/dev/null)" ] || end_testcase "finger $BADUSER"
-    [ "$(finger @$BADHOST 2>&1 1>/dev/null)" ] || \
-        end_testcase "finger @$BADHOST"
-    [ "$(finger $BADUSER@$BADHOST 2>&1 1>/dev/null)" ] || \
-        end_testcase "finger $BADUSER@$BADHOST"
-}
-
-#-----------------------------------------------------------------------
-# FUNCTION: do_test3
-# PURPOSE:  To run the "finger -flag User@Host" commands and verify that the
-#           "finger" command is functioning properly.
-# INPUT:    None.
-# OUTPUT:   Error messages are logged for all discrepancies found.
-#-----------------------------------------------------------------------
-
-do_test3()
-{
-    tst_resm TINFO "finger: do_test3 (-f flag) started"
-
-    tst_resm TINFO "finger -l : gives a long listing"
-    finger -l  2>&1 1>/dev/null || end_testcase "finger -l"
-    finger -l $LUSER 2>&1 1>/dev/null || end_testcase "finger -l $LUSER"
-    finger -l @$LHOST 2>&1 1>/dev/null || end_testcase "finger -l @$LHOST"
-    if ! finger -l $LUSER@$LHOST 2>&1 1>/dev/null; then
-        end_testcase "finger -l $LUSER@$LHOST"
-    fi
-    finger -l @$RHOST  2>&1 1>/dev/null || end_testcase "finger -l @$RHOST"
-    if ! finger -l $RUSER@$RHOST  2>&1 1>/dev/null; then
-        end_testcase "finger -l $RUSER@$RHOST"
-    fi
-
-    tst_resm TINFO "finger -m : assures that user is a user ID discretionary"
-    finger -m 2>&1 1>/dev/null || end_testcase "finger -m"
-    finger -m $LUSER 2>&1 1>/dev/null || end_testcase "finger -m $LUSER"
-    finger -m @$LHOST 2>&1 1>/dev/null || end_testcase "finger -m @$LHOST"
-    if ! finger -m $LUSER@$LHOST 2>&1 1>/dev/null; then
-        end_testcase "finger -m $LUSER@$LHOST"
-    fi
-    finger -m @$RHOST 2>&1 1>/dev/null || end_testcase "finger -m @$RHOST"
-    if ! finger -m $RUSER@$RHOST  2>&1 1>/dev/null; then
-        end_testcase "finger -m $RUSER@$RHOST"
-    fi
-
-    tst_resm TINFO "finger -p : suppresses printing of .plan files on long and \
-        brief long formats"
-    finger -p  2>&1 1>/dev/null || end_testcase "finger -p"
-    finger -p $LUSER  2>&1 1>/dev/null || end_testcase "finger -p $LUSER"
-    finger -p @$LHOST  2>&1 1>/dev/null || end_testcase "finger -p @$LHOST"
-    if ! finger -p $LUSER@$LHOST  2>&1 1>/dev/null; then
-        end_testcase "finger -p $LUSER@$LHOST"
-    fi
-    finger -p @$RHOST  2>&1 1>/dev/null || end_testcase "finger -p @$RHOST"
-    if ! finger -p $RUSER@$RHOST 2>&1 1>/dev/null; then
-        end_testcase "finger -p $RUSER@$RHOST"
-    fi
-
-    tst_resm TINFO "finger -s : gives a short format list"
-    finger -s  2>&1 1>/dev/null || end_testcase "finger -s"
-    finger -s $LUSER 2>&1 1>/dev/null || end_testcase "finger -s $LUSER "
-    finger -s @$LHOST 2>&1 1>/dev/null || end_testcase "finger -s @$LHOST"
-    if ! finger -s $LUSER@$LHOST 2>&1 1>/dev/null; then
-        end_testcase "finger -s $LUSER@$LHOST"
-    fi
-    finger -s @$RHOST 2>&1 1>/dev/null || end_testcase "finger -s @$RHOST"
-    if ! finger -s $RUSER@$RHOST 2>&1 1>/dev/null; then
-        end_testcase "finger -s $RUSER@$RHOST"
-    fi
-
-}
-
-#-----------------------------------------------------------------------
-# FUNCTION: MAIN
-# PURPOSE:  To invoke the functions to perform the tasks outlined in the
-#           prologue.
-# INPUT:    None.
-# OUTPUT:   None.
-#-----------------------------------------------------------------------
-. net_cmdlib.sh
-
-read_opts $*
-do_setup
-for TST_COUNT in 1 2 3; do
-    eval "do_test$TST_COUNT"
-    sleep $SLEEPTIME
-done
-end_testcase
-- 
2.14.2


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [LTP] [RFC PATCH 7/7] net/tcp_cmds: Remove echo test
  2017-10-18 13:49 [LTP] [RFC PATCH 0/7] Remove network test for ancient software Petr Vorel
                   ` (5 preceding siblings ...)
  2017-10-18 13:50 ` [LTP] [RFC PATCH 6/7] net/tcp_cmds: Remove finger test Petr Vorel
@ 2017-10-18 13:50 ` Petr Vorel
  2017-10-18 20:31 ` [LTP] [RFC PATCH 0/7] Remove network test for ancient software Mike Frysinger
  7 siblings, 0 replies; 15+ messages in thread
From: Petr Vorel @ 2017-10-18 13:50 UTC (permalink / raw)
  To: ltp

Purpose of the test is to stresses the inetd/xinetd daemon using
the echo service.
Echo service is usually disabled in distros these days and there
is another test testing xinetd.

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 runtest/net.tcp_cmds                         |   1 -
 testcases/network/tcp_cmds/echo/Makefile     |  38 ---
 testcases/network/tcp_cmds/echo/createfile.c |  52 ----
 testcases/network/tcp_cmds/echo/echo01       | 127 ---------
 testcases/network/tcp_cmds/echo/echoes.c     | 375 ---------------------------
 5 files changed, 593 deletions(-)
 delete mode 100644 testcases/network/tcp_cmds/echo/Makefile
 delete mode 100644 testcases/network/tcp_cmds/echo/createfile.c
 delete mode 100755 testcases/network/tcp_cmds/echo/echo01
 delete mode 100644 testcases/network/tcp_cmds/echo/echoes.c

diff --git a/runtest/net.tcp_cmds b/runtest/net.tcp_cmds
index 0c565b055..131d31c2a 100644
--- a/runtest/net.tcp_cmds
+++ b/runtest/net.tcp_cmds
@@ -5,7 +5,6 @@
 ipneigh01 ipneigh01.sh
 arping01 arping01.sh
 clockdiff01 clockdiff01.sh
-echo export TCbin=$LTPROOT/testcases/network/tcp_cmds/echo; echo01
 ftp export TCbin=$LTPROOT/testcases/network/tcp_cmds/ftp; ftp01
 host host01
 netstat netstat01
diff --git a/testcases/network/tcp_cmds/echo/Makefile b/testcases/network/tcp_cmds/echo/Makefile
deleted file mode 100644
index f26c248e5..000000000
--- a/testcases/network/tcp_cmds/echo/Makefile
+++ /dev/null
@@ -1,38 +0,0 @@
-#
-#    network/tcp_cmds/echo testcases Makefile.
-#
-#    Copyright (C) 2009, Cisco Systems Inc.
-#
-#    This program 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 2 of the License, or
-#    (at your option) any later version.
-#
-#    This program 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, write to the Free Software Foundation, Inc.,
-#    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Ngie Cooper, July 2009
-#
-
-top_srcdir		?= ../../../..
-
-include $(top_srcdir)/include/mk/testcases.mk
-
-CPPFLAGS		+= -DDEBUG -I$(abs_srcdir)/../include
-
-INSTALL_TARGETS		:= echo01
-
-MAKE_TARGETS		:= echoes echoes6 createfile
-
-%6: CPPFLAGS += -DINET6
-
-%6.o: %.c
-	$(COMPILE.c) $(OUTPUT_OPTION) $<
-
-include $(top_srcdir)/include/mk/generic_leaf_target.mk
diff --git a/testcases/network/tcp_cmds/echo/createfile.c b/testcases/network/tcp_cmds/echo/createfile.c
deleted file mode 100644
index 485bedf7f..000000000
--- a/testcases/network/tcp_cmds/echo/createfile.c
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
-@! # TESTCASE DESCRIPTION:
-@! # 	Purpose: to create an input file of any size
-@! # 	Command: none
-@! # 	Subcommand: none
-@! # 	Design: Write an array the size of BUFSIZ to created file until
-@! # 		the file size matches the file size required
-@! # SPEC. EXEC. REQS:  This  program is used by ctatcdt3.c and ctatcet3.c
-*/
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-
-int main(int argc, char *argv[])
-{
-
-	int fd;
-	int fsize;
-	int count = 0;
-	int n, remain;
-	static char buf[BUFSIZ];
-
-	for (fsize = 0; fsize < BUFSIZ; fsize++) {
-		if ((fsize % 2) == 0)
-			buf[fsize++] = 'U';
-		else
-			buf[fsize++] = '\n';
-	}
-
-	fsize = strtol(argv[1], NULL, 10);
-
-	if ((fd = creat(argv[2], 0644)) == -1)
-		perror("createfile");
-	if (fsize >= BUFSIZ) {
-		count = fsize / BUFSIZ;
-		remain = fsize % BUFSIZ;
-	} else
-		remain = fsize;
-	while (count-- != 0) {
-		if ((n = write(fd, buf, BUFSIZ)) != BUFSIZ)
-			perror("createfile");
-	}
-	if ((n = write(fd, buf, remain)) != remain)
-		perror("createfile");
-	close(fd);
-
-	return 0;
-}
diff --git a/testcases/network/tcp_cmds/echo/echo01 b/testcases/network/tcp_cmds/echo/echo01
deleted file mode 100755
index c11102395..000000000
--- a/testcases/network/tcp_cmds/echo/echo01
+++ /dev/null
@@ -1,127 +0,0 @@
-#!/bin/sh
-unset LIBPATH
-#
-#   Copyright (c) International Business Machines  Corp., 2000
-#
-#   This program 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 2 of the License, or
-#   (at your option) any later version.
-#
-#   This program 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, write to the Free Software
-#   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-#
-#
-#
-#  FILE   : echo
-#
-#  PURPOSE: Stresses the inetd/xinetd daemon using the `echo` service.
-#
-#  SETUP: The echo service MUST be active on the RHOST machine. This is
-#         controlled by the inetd/xinetd daemon.
-#
-#  HISTORY:
-#    03/01 Robbie Williamson (robbiew@us.ibm.com)
-#      -Ported
-#
-#
-#***********************************************************************
-
-#-----------------------------------------------------------------------
-#
-# FUNCTION:  do_setup
-#
-#-----------------------------------------------------------------------
-
-do_setup()
-{
-
-    NUMLOOPS=${NUMLOOPS:-2}
-    TST_TOTAL=$NUMLOOPS
-
-    export TST_COUNT TST_TOTAL
-
-    exists hostname sum
-    tst_setup
-
-    TC=sine
-    RHOST=${RHOST:-`hostname`}
-    CLEANUP=${CLEANUP:-ON}
-    CREATEFILE=createfile
-    ECHOES=echoes${EXEC_SUFFIX}
-
-    ECHOFILE=${ECHOFILE:-echofile${EXEC_SUFFIX}}
-    ECHOSIZE=${ECHOSIZE:-8192}
-    NUMPROCESSES=${NUMPROCESSES:-10}
-
-}
-
-#-----------------------------------------------------------------------
-#
-# FUNCTION:  do_test
-# PURPOSE:   Loop until interrupted creating the echo file and then
-#	     echoing it to RHOST.
-# INPUT:     None.
-# OUTPUT:    Informational messages are logged into the run log.
-#
-#-----------------------------------------------------------------------
-
-do_test()
-{
-    echo  "Creating echo file $ECHOFILE"
-    if ! "$LTPROOT/testcases/bin/$CREATEFILE" $ECHOSIZE "$TCtmp/$ECHOFILE"; then
-        end_testcase "$ECHOFILE not created"
-    fi
-
-    echo "Compute the checksum of this file"
-    csum1=$(sum $TCtmp/$ECHOFILE | awk '{print $1}')
-    [ $csum1 ] || end_testcase "initial checksum computation failed"
-
-    while [ $TST_COUNT -le $NUMLOOPS ]; do
-
-        if ! $ECHOES $RHOST "$TCtmp/$ECHOFILE" $NUMPROCESSES; then
-            end_testcase "Error in $ECHOES test in loop $TST_COUNT"
-        fi
-
-        NUM=0
-        while [ $NUM -lt $NUMPROCESSES ]
-        do
-            csum2=$(sum "$TCtmp/${ECHOFILE}${NUM}" | awk '{print $1}')
-            if [ "$csum1" != "$csum2" ]; then
-                end_testcase "Checksums differ in loop $TST_COUNT"
-            fi
-            NUM=$(( $NUM + 1 ))
-        done
-
-        tst_resm TINFO "Execution $TST_COUNT passed."
-
-        incr_tst_count
-        if [ $TST_COUNT -le $NUMLOOPS ]; then
-            tst_resm TINFO "Sleeping 60 seconds to avoid hitting max. connections setting for service"
-            sleep 60
-        fi
-    done
-}
-
-#-----------------------------------------------------------------------
-#
-# FUNCTION:  MAIN
-# PURPOSE:   To invoke functions that perform the tasks as described in
-#	     the design in the prolog above.
-# INPUT:     See SETUP in the prolog above.
-# OUTPUT:    Logged run results written to testcase run log
-#
-#-----------------------------------------------------------------------
-
-. net_cmdlib.sh
-
-read_opts $*
-do_setup
-do_test
-end_testcase
diff --git a/testcases/network/tcp_cmds/echo/echoes.c b/testcases/network/tcp_cmds/echo/echoes.c
deleted file mode 100644
index e6aeb9eed..000000000
--- a/testcases/network/tcp_cmds/echo/echoes.c
+++ /dev/null
@@ -1,375 +0,0 @@
-/*
-@! # TEST TYPE(S): Concurrency, Load stress
-@! # TESTCASE DESCRIPTION:
-@! # 	Purpose: to send packets from the file to echo protocol on remote
-@! #		 machine and read the echoing packets back and compare them
-@! # 	Design: Connect to echo protocol on the remote machine
-@! #		read from the file and send the file to remote machine
-@! #		read the echoing  packets and store them in a file
-@! #		repeat until file exhausted.
-@! #		compare result
-@! #
-@! # SPEC. EXEC. REQS: May require multiple of this test to run
-@! #		       to target machines from multiple machine in order
-@! #		       to create stress condition
-@! # 			echoes <REMOTE HOST> <echofile> <number of processes>
-*/
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <sys/stat.h>
-#include <sys/wait.h>
-#include <errno.h>
-#include <libgen.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <netdb.h>
-#include <netinet/in.h>
-#include <fcntl.h>
-#include "test.h"
-#include "netdefs.h"
-
-#if INET6
-char *TCID = "echoes6";
-#else
-char *TCID = "echoes";
-#endif
-
-int TST_TOTAL = 1;
-
-void echofile(struct servent *, struct addrinfo *, char *, char *);
-int checkfile(char *, char *);
-void cleanup(int);
-
-int main(int argc, char *argv[], char *env[])
-{
-
-	unsigned int finish, i, j, k;
-	int gai, wait_stat;
-	pid_t pid;
-	struct addrinfo hints, *hp;
-	struct servent *sp;
-	struct {
-		char resultfile[FILENAME_MAX + 1];
-		pid_t pid;
-	} echo_struc[200];
-
-	memset(&hints, 0, sizeof(hints));
-	hints.ai_family = PFI;
-	hints.ai_socktype = SOCK_STREAM;
-
-	if (argc != 4)
-		tst_brkm(TBROK, NULL, "usage: remote-addr file num-procs");
-
-	if ((sp = getservbyname("echo", "tcp")) == NULL)
-		tst_brkm(TBROK | TERRNO, NULL, "getservbyname failed");
-
-	if ((gai = getaddrinfo(argv[1], NULL, &hints, &hp)) != 0)
-		tst_brkm(TBROK, NULL, "unknown subject address %s: %s\n",
-			 argv[1], gai_strerror(gai));
-
-	if (!hp || !hp->ai_addr || hp->ai_addr->sa_family != AFI)
-		tst_brkm(TBROK, NULL, "getaddrinfo failed");
-
-	i = (unsigned int)strtol(argv[3], NULL, 10);
-	j = 0;
-	while (i-- > 0) {
-		switch (pid = fork()) {
-		case 0:
-			snprintf(echo_struc[j].resultfile,
-				 FILENAME_MAX, "%s%u", argv[2], j);
-			echofile(sp, hp, echo_struc[j].resultfile, argv[2]);
-			break;
-		case -1:
-			tst_resm(TBROK | TERRNO, "fork failed");
-			break;
-		default:
-			echo_struc[j].pid = pid;
-			j++;
-			break;
-		}
-	}
-	finish = (unsigned int)strtol(argv[3], NULL, 10);
-	i = finish;
-	/* Consume all operating threads until we're done... */
-	while (finish != 0) {
-
-		if ((pid = wait(&wait_stat)) == -1)
-			tst_resm(TFAIL | TERRNO, "wait failed");
-		if (wait_stat == 0) {
-			for (j = 0; j < i; j++) {
-				if (echo_struc[j].pid == pid) {
-					finish--;
-					j = i;
-				}
-			}
-		} else {
-
-			tst_resm(TFAIL, "wait(2) status was non-zero");
-
-			if (WIFEXITED(wait_stat)) {
-				tst_resm(TINFO, "exit status: %d",
-					 WEXITSTATUS(wait_stat));
-			} else if (WIFSIGNALED(wait_stat)) {
-				tst_resm(TINFO, "signaled: %d",
-					 WTERMSIG(wait_stat));
-			}
-
-			for (k = 0; k < i; k++) {
-				if (kill(echo_struc[k].pid, 0) == 0) {
-					kill(echo_struc[k].pid, 9);
-				}
-			}
-			break;
-		}
-
-	}
-
-	tst_exit();
-}
-
-/* XXX (garrcoop): This shouldn't use libltp as it's a forked process. */
-void
-echofile(struct servent *sp, struct addrinfo *ai, char *resultfile,
-	 char *srcfile)
-{
-	int n;
-	int port;
-	char wr_buffer[BUFSIZ];
-	char rd_buffer[BUFSIZ];
-	sai_t sa;
-#ifdef DEBUG
-	sa_t address;
-	socklen_t addrlen;
-#endif
-	int s;
-	int finish;
-	int fdw, fdr;
-	int nread, nwrite;
-	int count;
-	pid_t pid;
-
-#ifdef 	DEBUG
-	printf("Creating socket .....\n");
-#endif
-
-	pid = getpid();
-	if ((s = socket(AFI, SOCK_STREAM, 0)) < 0) {
-		tst_resm(TBROK, "Failed to create listener socket (pid=%d)",
-			 pid);
-		cleanup(s);
-		tst_exit();
-	}
-	port = sp->s_port;
-
-	/*
-	 * TODO: Old code did something of the form:
-	 *
-	 * struct hostent *hp;
-	 *
-	 * hp = gethostbyname(argv[1]);
-	 *
-	 * ...
-	 *
-	 * struct       in_addr hostaddr;
-	 *
-	 * memcpy(&hostaddr,hp->h_addr_list[0],sizeof(struct in_addr));
-	 *
-	 * This is all fine and dandy, but gethostbyname has been deprecated
-	 * for some time, and doesn't work too well with IPV6 (from what I've
-	 * read), so I have to push it over to getaddrinfo. getaddrinfo isn't
-	 * a 1:1 mapping though, so I have to do some work to shoehorn the old
-	 * code to fit the new code.
-	 *
-	 * Some notes (from a test app)...
-	 *
-	 * (gdb) set args 127.0.0.1
-	 * (gdb) list
-	 * 33              for (int i = 1; i < argc; i++) {
-	 * 34
-	 * 35                      gai = getaddrinfo(argv[i], NULL, &hints, &ai);
-	 * 36                      hp = gethostbyname(argv[i]);
-	 * 37
-	 * 38                      if (gai != 0) {
-	 * 39                              printf("Error: %s\n", gai_strerror(gai));
-	 * 40                              error = 2;
-	 * 41                      } else {
-	 * 42                              printf("Host IP: 0x%x\n", ai->ai_addr);
-	 * (gdb) p *hp
-	 * $16 = {h_name = 0x1a60198 "127.0.0.1", h_aliases = 0x1a60190, h_addrtype = 2,
-	 *   h_length = 4, h_addr_list = 0x1a60180}
-	 * (gdb) p *hp->h_addr_list
-	 * $14 = 0x1a60170 "\177"
-	 * (gdb) p *ai
-	 * $15 = {ai_flags = 0, ai_family = 2, ai_socktype = 1, ai_protocol = 6,
-	 *   ai_addrlen = 16, ai_addr = 0x1a600b0, ai_canonname = 0x0,
-	 *     ai_next = 0x1a600d0}
-	 *
-	 * If one continues down this path, SIGPIPE will get tossed at the first
-	 * write(2), as opposed to Connection refused (the old code). So I'm not
-	 * passing in the correct info to connect(2).
-	 *
-	 * That and using -DDEBUG with the getpeername(3) call below always fails
-	 * (that alone should be a sufficient to note that my sockaddr* data is
-	 * skewed).
-	 *
-	 * For now let's just mark it broken.
-	 *
-	 */
-	//tst_resm(TBROK, "FIX ME GARRETT!");
-	//tst_exit();
-
-	memset((char *)&sa, 0, sizeof(sa));
-	memcpy(&sa, ai->ai_addr, ai->ai_addrlen);
-
-#if INET6
-	sa.sin6_port = port;
-#else
-	sa.sin_port = port;
-#endif
-
-	if (connect(s, (sa_t *) & sa, sizeof(sa)) == -1) {
-		tst_resm(TBROK | TERRNO,
-			 "failed to create connector socket (pid=%d)", pid);
-		cleanup(s);
-		tst_exit();
-	}
-#ifdef DEBUG
-	addrlen = sizeof(struct sockaddr);
-	/* printf("addrlen=%d\n", addrlen); */
-	/* printf("ai->ai_addr=%s\n", inet_ntoa(ai->ai_addr)); */
-	if (getsockname(s, &address, &addrlen) == -1) {
-		tst_resm(TBROK | TERRNO, "getsockname call failed (pid=%d)",
-			 pid);
-		cleanup(s);
-		tst_exit();
-	}
-
-	printf("local port is: %d\n", port);
-
-	if (getpeername(s, &address, &addrlen) == -1) {
-		tst_resm(TBROK | TERRNO, "getpeername call failed (pid=%d)",
-			 pid);
-		cleanup(s);
-		tst_exit();
-	}
-
-	tst_resm(TINFO, "The remote port is: %d\n", port);
-#endif
-	if ((fdr = open(srcfile, O_RDONLY)) < 0) {
-		tst_resm(TBROK | TERRNO,
-			 "failed to open input file (pid=%d)", pid);
-		cleanup(s);
-		tst_exit();
-	}
-
-	if ((fdw = creat(resultfile, 0644)) < 0) {
-		tst_resm(TBROK | TERRNO,
-			 "failed to create a temporary file (pid=%d)", pid);
-		cleanup(s);
-		tst_exit();
-	}
-#if DEBUG
-	tst_resm(TINFO, "creat(resultfile,...) done.");
-#endif
-	finish = FALSE;
-	count = 0;
-	while (finish == FALSE) {
-
-		if ((nwrite = read(fdr, wr_buffer, BUFSIZ)) == -1) {
-			tst_resm(TFAIL | TERRNO,
-				 "failed to read from file (pid=%d)", pid);
-			cleanup(s);
-		}
-#if DEBUG
-		tst_resm(TINFO, "Read %d bytes from file", nwrite);
-#endif
-		if (nwrite == 0)
-			finish = TRUE;
-		else {
-			count++;
-			if ((n = write(s, wr_buffer, nwrite)) != nwrite) {
-				tst_resm(TFAIL | TERRNO,
-					 "failed to write to socket (pid=%d)",
-					 pid);
-				cleanup(s);
-			}
-#ifdef 	DEBUG
-			tst_resm(TINFO, "Writing %d bytes to remote socket",
-				 count);
-#endif
-			while (nwrite != 0) {
-
-				nread = read(s, rd_buffer, BUFSIZ);
-				if (nread == -1) {
-					printf("read size: %d\n", n);
-					tst_resm(TFAIL | TERRNO,
-						 "failed to read from socket [2nd "
-						 "time] (pid=%d)", pid);
-					cleanup(s);
-				}
-#ifdef 	DEBUG
-				printf("Reading ....... %d\n", count);
-#endif
-				n = write(fdw, rd_buffer, nread);
-				if (n != nread) {
-					tst_resm(TFAIL | TERRNO,
-						 "ERROR during write to result "
-						 "file (pid=%d); read amount: %d",
-						 pid, n);
-					cleanup(s);
-				}
-
-				nwrite -= nread;
-
-			}
-
-		}		/* end of else */
-
-	}			/* end of while */
-
-	if ((n = close(s)) == -1) {
-		tst_brkm(TBROK | TERRNO, NULL,
-			 "failed to cleanly close socket (pid=%d)", pid);
-	}
-	if ((n = close(fdr)) == -1) {
-		tst_brkm(TBROK | TERRNO, NULL,
-			 "failed to cleanly close input file (pid=%d)", pid);
-	}
-	if ((n = close(fdw)) == -1) {
-		tst_brkm(TBROK | TERRNO, NULL,
-			 "failed to cleanly close temp file (pid=%d)", pid);
-	}
-	if (checkfile(srcfile, resultfile) != TRUE) {
-		tst_brkm(TFAIL, NULL,
-			 "Input file and output file are not equal (pid=%d)",
-			 pid);
-	}
-	tst_resm(TINFO, "Finish .... (pid=%d)", pid);
-	tst_exit();
-}
-
-int checkfile(char *file1, char *file2)
-{
-	off_t n;
-	struct stat buffer;
-	stat(file1, &buffer);
-	n = buffer.st_size;
-#ifdef 	DEBUG
-	printf("%s size=%lu\n", file1, n);
-#endif
-	stat(file2, &buffer);
-#ifdef 	DEBUG
-	printf("%s size=%lu\n", file2, buffer.st_size);
-#endif
-	if (n != buffer.st_size)
-		return FALSE;
-	else
-		return TRUE;
-}
-
-void cleanup(int s)
-{
-	close(s);
-}
-- 
2.14.2


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [LTP] [RFC PATCH 0/7] Remove network test for ancient software
  2017-10-18 13:49 [LTP] [RFC PATCH 0/7] Remove network test for ancient software Petr Vorel
                   ` (6 preceding siblings ...)
  2017-10-18 13:50 ` [LTP] [RFC PATCH 7/7] net/tcp_cmds: Remove echo test Petr Vorel
@ 2017-10-18 20:31 ` Mike Frysinger
  2017-10-19  9:33   ` Petr Vorel
  2017-10-25  8:59   ` Cyril Hrubis
  7 siblings, 2 replies; 15+ messages in thread
From: Mike Frysinger @ 2017-10-18 20:31 UTC (permalink / raw)
  To: ltp

fwiw, rsh/rcp are still used in the embedded world where security is not a
concern, but speed/size matters much more (e.g. development)
-mike

On Wed, Oct 18, 2017 at 9:49 AM, Petr Vorel <pvorel@suse.cz> wrote:

> Hi,
>
> I'm proposing to remove tests for ancient software.
> I don't think we should be maintaining tests for something which hardly
> anyone use.
>
> Kind regards,
> Petr
>
> Petr Vorel (7):
>   net/tcp_cmds: Remove rwho test
>   net/tcp_cmds: Remove rdist test
>   net/tcp_cmds: Remove rlogin test
>   net/tcp_cmds: Remove rsh test
>   net/tcp_cmds: Remove rcp test
>   net/tcp_cmds: Remove finger test
>   net/tcp_cmds: Remove echo test
>
>  runtest/net.tcp_cmds                         |   7 -
>  testcases/network/tcp_cmds/echo/Makefile     |  38 ---
>  testcases/network/tcp_cmds/echo/createfile.c |  52 ----
>  testcases/network/tcp_cmds/echo/echo01       | 127 ---------
>  testcases/network/tcp_cmds/echo/echoes.c     | 375
> ---------------------------
>  testcases/network/tcp_cmds/finger/Makefile   |  31 ---
>  testcases/network/tcp_cmds/finger/finger01   | 203 ---------------
>  testcases/network/tcp_cmds/rcp/Makefile      |  30 ---
>  testcases/network/tcp_cmds/rcp/rcp01         | 144 ----------
>  testcases/network/tcp_cmds/rdist/Makefile    |  30 ---
>  testcases/network/tcp_cmds/rdist/rdist01     | 187 -------------
>  testcases/network/tcp_cmds/rlogin/Makefile   |  31 ---
>  testcases/network/tcp_cmds/rlogin/rlogin01   |  90 -------
>  testcases/network/tcp_cmds/rsh/Makefile      |  31 ---
>  testcases/network/tcp_cmds/rsh/rsh01         | 115 --------
>  testcases/network/tcp_cmds/rwho/Makefile     |  31 ---
>  testcases/network/tcp_cmds/rwho/rwho01       |  91 -------
>  17 files changed, 1613 deletions(-)
>  delete mode 100644 testcases/network/tcp_cmds/echo/Makefile
>  delete mode 100644 testcases/network/tcp_cmds/echo/createfile.c
>  delete mode 100755 testcases/network/tcp_cmds/echo/echo01
>  delete mode 100644 testcases/network/tcp_cmds/echo/echoes.c
>  delete mode 100644 testcases/network/tcp_cmds/finger/Makefile
>  delete mode 100755 testcases/network/tcp_cmds/finger/finger01
>  delete mode 100644 testcases/network/tcp_cmds/rcp/Makefile
>  delete mode 100755 testcases/network/tcp_cmds/rcp/rcp01
>  delete mode 100644 testcases/network/tcp_cmds/rdist/Makefile
>  delete mode 100755 testcases/network/tcp_cmds/rdist/rdist01
>  delete mode 100644 testcases/network/tcp_cmds/rlogin/Makefile
>  delete mode 100755 testcases/network/tcp_cmds/rlogin/rlogin01
>  delete mode 100644 testcases/network/tcp_cmds/rsh/Makefile
>  delete mode 100755 testcases/network/tcp_cmds/rsh/rsh01
>  delete mode 100644 testcases/network/tcp_cmds/rwho/Makefile
>  delete mode 100755 testcases/network/tcp_cmds/rwho/rwho01
>
> --
> 2.14.2
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20171018/920121b5/attachment.html>

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [LTP] [RFC PATCH 0/7] Remove network test for ancient software
  2017-10-18 20:31 ` [LTP] [RFC PATCH 0/7] Remove network test for ancient software Mike Frysinger
@ 2017-10-19  9:33   ` Petr Vorel
  2017-10-25  8:59   ` Cyril Hrubis
  1 sibling, 0 replies; 15+ messages in thread
From: Petr Vorel @ 2017-10-19  9:33 UTC (permalink / raw)
  To: ltp

Hi Mike,

> fwiw, rsh/rcp are still used in the embedded world where security is not a
> concern, but speed/size matters much more (e.g. development)
I used dropbear even on quite low power arm. But, ok I'd agree that rsh/rcp can be still
worth to test. But I'd really drop the rest (rwho, rdist, rlogin, finger, echo).

> -mike

Kind regards,
Petr

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [LTP] [RFC PATCH 0/7] Remove network test for ancient software
  2017-10-18 20:31 ` [LTP] [RFC PATCH 0/7] Remove network test for ancient software Mike Frysinger
  2017-10-19  9:33   ` Petr Vorel
@ 2017-10-25  8:59   ` Cyril Hrubis
  1 sibling, 0 replies; 15+ messages in thread
From: Cyril Hrubis @ 2017-10-25  8:59 UTC (permalink / raw)
  To: ltp

Hi!
> fwiw, rsh/rcp are still used in the embedded world where security is not a
> concern, but speed/size matters much more (e.g. development)

The question is how much do we care about maintaing the testcases for
these. I guess that rsh and rcp may be still useful in a certain cases
but for a general usage it has been replaced by scp and ssh long time
ago.

-- 
Cyril Hrubis
chrubis@suse.cz

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [LTP] [RFC PATCH 1/7] net/tcp_cmds: Remove rwho test
  2017-10-18 13:49 ` [LTP] [RFC PATCH 1/7] net/tcp_cmds: Remove rwho test Petr Vorel
@ 2017-10-25 15:16   ` Alexey Kodanev
  2017-10-26  8:36     ` Petr Vorel
  0 siblings, 1 reply; 15+ messages in thread
From: Alexey Kodanev @ 2017-10-25 15:16 UTC (permalink / raw)
  To: ltp

On 10/18/2017 04:49 PM, Petr Vorel wrote:
> rwhod daemon is way too old to bother to test it.

As far as I remember, another problem with this test is that it's not
really applicable for automated runs because rwho requires someone to
be logged in to the machine for about 2 min to make it pass.

I'm ok with removing it.

Thanks,
Alexey


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [LTP] [RFC PATCH 1/7] net/tcp_cmds: Remove rwho test
  2017-10-25 15:16   ` Alexey Kodanev
@ 2017-10-26  8:36     ` Petr Vorel
  2017-10-26 12:57       ` Alexey Kodanev
  0 siblings, 1 reply; 15+ messages in thread
From: Petr Vorel @ 2017-10-26  8:36 UTC (permalink / raw)
  To: ltp

Hi Alexey,

> On 10/18/2017 04:49 PM, Petr Vorel wrote:
> > rwhod daemon is way too old to bother to test it.

> As far as I remember, another problem with this test is that it's not
> really applicable for automated runs because rwho requires someone to
> be logged in to the machine for about 2 min to make it pass.

> I'm ok with removing it.

> Thanks,
> Alexey

Thanks, I pushed it.

Please if you agree with other tests to be deleted, ack it.
I'd be for deleting at least finger, echo, rlogin and rdist, as Vapier asked for keeping rcp
and rsh. IMHO these project should test their code themselves, I'd prefer LTP concern more
about the Linux kernel itself, not about *anything* it runs on linux distribution
(including networking).


Kind regards,
Petr

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [LTP] [RFC PATCH 1/7] net/tcp_cmds: Remove rwho test
  2017-10-26  8:36     ` Petr Vorel
@ 2017-10-26 12:57       ` Alexey Kodanev
  2017-10-26 14:25         ` Petr Vorel
  0 siblings, 1 reply; 15+ messages in thread
From: Alexey Kodanev @ 2017-10-26 12:57 UTC (permalink / raw)
  To: ltp

On 10/26/2017 11:36 AM, Petr Vorel wrote:
> ...
> Please if you agree with other tests to be deleted, ack it.
> I'd be for deleting at least finger, echo, rlogin and rdist, as Vapier asked for keeping rcp
> and rsh. IMHO these project should test their code themselves, I'd prefer LTP concern more
> about the Linux kernel itself, not about *anything* it runs on linux distribution
> (including networking).

By running those tests youare also verifying kernel TCP stack and
network drivers.

Looking at rlogin, it's the only one among them which is convertedto
newer API
already, let's keep it along with the rcp, rsh, they are inthe same
packages.

Acked the rest. I guess we should also change default network
configuration to SSH.

Best regards,
Alexey


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [LTP] [RFC PATCH 1/7] net/tcp_cmds: Remove rwho test
  2017-10-26 12:57       ` Alexey Kodanev
@ 2017-10-26 14:25         ` Petr Vorel
  0 siblings, 0 replies; 15+ messages in thread
From: Petr Vorel @ 2017-10-26 14:25 UTC (permalink / raw)
  To: ltp

Hi Alexey,

> On 10/26/2017 11:36 AM, Petr Vorel wrote:
> > ...
> > Please if you agree with other tests to be deleted, ack it.
> > I'd be for deleting at least finger, echo, rlogin and rdist, as Vapier asked for keeping rcp
> > and rsh. IMHO these project should test their code themselves, I'd prefer LTP concern more
> > about the Linux kernel itself, not about *anything* it runs on linux distribution
> > (including networking).

> By running those tests youare also verifying kernel TCP stack and
> network drivers.
Sure :-). But it's question, whether it's a best way to test it with testing complicated
apps like FTP or DNS servers (error in these hardly ever find a problem in kernel API,
or drivers, more likely it's a bug in test itself or configuration problem).

IPsec and interface related tests looks to me much more relevant (are in a good shape
after you fixed them and use only basic user space tools like ip).

BTW content of runtest/commands might be better to have in util-linux testing repo, where
there are some anyway [1].

> Looking at rlogin, it's the only one among them which is convertedto
> newer API
> already, let's keep it along with the rcp, rsh, they are inthe same
> packages.
> Acked the rest.
Thanks for acking, I kept these three, deleted rest.

> I guess we should also change default network configuration to SSH.
+1.


Kind regards,
Petr

[1] https://git.kernel.org/pub/scm/utils/util-linux/util-linux.git/tree/tests

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2017-10-26 14:25 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-18 13:49 [LTP] [RFC PATCH 0/7] Remove network test for ancient software Petr Vorel
2017-10-18 13:49 ` [LTP] [RFC PATCH 1/7] net/tcp_cmds: Remove rwho test Petr Vorel
2017-10-25 15:16   ` Alexey Kodanev
2017-10-26  8:36     ` Petr Vorel
2017-10-26 12:57       ` Alexey Kodanev
2017-10-26 14:25         ` Petr Vorel
2017-10-18 13:49 ` [LTP] [RFC PATCH 2/7] net/tcp_cmds: Remove rdist test Petr Vorel
2017-10-18 13:49 ` [LTP] [RFC PATCH 3/7] net/tcp_cmds: Remove rlogin test Petr Vorel
2017-10-18 13:49 ` [LTP] [RFC PATCH 4/7] net/tcp_cmds: Remove rsh test Petr Vorel
2017-10-18 13:49 ` [LTP] [RFC PATCH 5/7] net/tcp_cmds: Remove rcp test Petr Vorel
2017-10-18 13:50 ` [LTP] [RFC PATCH 6/7] net/tcp_cmds: Remove finger test Petr Vorel
2017-10-18 13:50 ` [LTP] [RFC PATCH 7/7] net/tcp_cmds: Remove echo test Petr Vorel
2017-10-18 20:31 ` [LTP] [RFC PATCH 0/7] Remove network test for ancient software Mike Frysinger
2017-10-19  9:33   ` Petr Vorel
2017-10-25  8:59   ` Cyril Hrubis

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.