[LTP] [PATCH 1/1] tcp_cmds: Remove ftp01.sh test, binary data files

Wei Gao wegao@suse.com
Mon Nov 4 02:57:31 CET 2024


On Fri, Nov 01, 2024 at 05:53:54PM +0100, Petr Vorel wrote:
> FTP login tests were removed in 6282e55b5d, as out of scope of
> of kernel testing. ftp01.sh is FTP server unit test, which is also not
> relevant for kernel testing, thus removing.
> 
> Remove also binary data files bin.sm, bin.med, bin.lg, bin.jmb which are
> not needed any more.
> 
> Signed-off-by: Petr Vorel <pvorel@suse.cz>
> ---
> CI: https://github.com/pevik/ltp/actions/runs/11633078452
> 
> NOTE: The rest of the FTP tests in testcases/network/stress/ftp/ are
> downloading and sending a large amount of data over TCP and are checking
> that the data arrives the same at the other end. That is some sort of
> kernel testing, thus test kept. But better would be to migrate them to
> use LTP custom C code:
> 
> https://github.com/linux-test-project/ltp/issues/1207
> 

Reviewed-by: Wei Gao <wegao@suse.com>

>  runtest/net.tcp_cmds                    |  1 -
>  testcases/network/Makefile              |  1 -
>  testcases/network/generate.sh           | 26 ---------
>  testcases/network/tcp_cmds/Makefile     |  8 +--
>  testcases/network/tcp_cmds/Makefile.inc |  2 +-
>  testcases/network/tcp_cmds/ftp/Makefile | 30 ----------
>  testcases/network/tcp_cmds/ftp/ftp01.sh | 75 -------------------------
>  7 files changed, 3 insertions(+), 140 deletions(-)
>  delete mode 100644 testcases/network/tcp_cmds/ftp/Makefile
>  delete mode 100755 testcases/network/tcp_cmds/ftp/ftp01.sh
> 
> diff --git a/runtest/net.tcp_cmds b/runtest/net.tcp_cmds
> index 248c7371d1..aba02fb30a 100644
> --- a/runtest/net.tcp_cmds
> +++ b/runtest/net.tcp_cmds
> @@ -5,7 +5,6 @@
>  ipneigh01_arp ipneigh01.sh -c arp
>  ipneigh01_ip ipneigh01.sh -c ip
>  arping01 arping01.sh
> -ftp ftp01.sh
>  netstat netstat01.sh
>  ping01 ping01.sh
>  ping02 ping02.sh
> diff --git a/testcases/network/Makefile b/testcases/network/Makefile
> index ccc9083961..05d7f95fd8 100644
> --- a/testcases/network/Makefile
> +++ b/testcases/network/Makefile
> @@ -14,7 +14,6 @@ CLEAN_TARGETS		+= $(DIR)
>  INSTALL_DIR		:= testcases/bin
>  
>  INSTALL_TARGETS		:= $(addprefix $(DIR)/ascii.,sm med lg jmb)
> -INSTALL_TARGETS		+= $(addprefix $(DIR)/bin.,sm med lg jmb)
>  
>  RM			+= -r
>  
> diff --git a/testcases/network/generate.sh b/testcases/network/generate.sh
> index 939f792cce..af48f77381 100755
> --- a/testcases/network/generate.sh
> +++ b/testcases/network/generate.sh
> @@ -51,29 +51,3 @@ fi
>  "$make_file" "$medium_file" $medium_size
>  "$make_file" "$large_file" $large_size
>  "$make_file" "$jumbo_file" $jumbo_size
> -
> -if [ ! -e "bin.sm" ] ; then
> -	cnt=0
> -	while [ $cnt -lt 5 ] ; do
> -		gzip -1 -c -n ascii.sm >> "bin.sm"
> -		cnt=$(($cnt + 1))
> -	done
> -fi
> -
> -genfile() {
> -	local input="$1" output="$2"
> -	local cnt=19
> -
> -	[ -e "$output" ] && return $?
> -
> -	while [ $cnt -ge 0 ] ; do
> -		cat "$input" >> "$output"
> -		cnt=$(($cnt-1))
> -	done
> -}
> -
> -genfile bin.sm bin.med
> -genfile bin.med bin.lg
> -genfile bin.lg bin.jmb
> -
> -chmod 666 bin.*
> diff --git a/testcases/network/tcp_cmds/Makefile b/testcases/network/tcp_cmds/Makefile
> index 2d0f076741..ba8b879efd 100644
> --- a/testcases/network/tcp_cmds/Makefile
> +++ b/testcases/network/tcp_cmds/Makefile
> @@ -7,13 +7,9 @@ top_srcdir		?= ../../..
>  
>  include $(top_srcdir)/include/mk/env_pre.mk
>  
> -ifneq ($(WITH_EXPECT),yes)
> -FILTER_OUT_SUBDIRS	:= ftp
> -endif
> +INSTALL_DEPS		:= ../datafiles/ascii.sm
>  
> -INSTALL_DEPS		:= ../datafiles/bin.sm
> -
> -../datafiles/bin.sm:
> +../datafiles/ascii.sm:
>  	$(MAKE) -C .. -f "$(abs_srcdir)/../Makefile" generate
>  
>  include $(top_srcdir)/include/mk/generic_trunk_target.mk
> diff --git a/testcases/network/tcp_cmds/Makefile.inc b/testcases/network/tcp_cmds/Makefile.inc
> index 114141b2cd..0ca5ec0e39 100644
> --- a/testcases/network/tcp_cmds/Makefile.inc
> +++ b/testcases/network/tcp_cmds/Makefile.inc
> @@ -22,7 +22,7 @@
>  
>  GENERATE_FILE_DIR	:= ../..
>  
> -MAKE_DEPS		:= $(GENERATE_FILE_DIR)/datafiles/bin.sm
> +MAKE_DEPS		:= $(GENERATE_FILE_DIR)/datafiles/ascii.sm
>  
>  $(MAKE_DEPS):
>  	$(MAKE) -C $(GENERATE_FILE_DIR) \
> diff --git a/testcases/network/tcp_cmds/ftp/Makefile b/testcases/network/tcp_cmds/ftp/Makefile
> deleted file mode 100644
> index 35022f8b9a..0000000000
> --- a/testcases/network/tcp_cmds/ftp/Makefile
> +++ /dev/null
> @@ -1,30 +0,0 @@
> -#
> -#    network/tcp_cmds/ftp 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		:= ftp*
> -
> -include $(top_srcdir)/include/mk/generic_leaf_target.mk
> diff --git a/testcases/network/tcp_cmds/ftp/ftp01.sh b/testcases/network/tcp_cmds/ftp/ftp01.sh
> deleted file mode 100755
> index 53d1eec53a..0000000000
> --- a/testcases/network/tcp_cmds/ftp/ftp01.sh
> +++ /dev/null
> @@ -1,75 +0,0 @@
> -#!/bin/sh
> -# SPDX-License-Identifier: GPL-2.0-or-later
> -# Copyright (c) 2022 Akihiko Odaki <akihiko.odaki@daynix.com>
> -# Copyright (c) 2003 Manoj Iyer <manjo@mail.utexas.edu>
> -# Copyright (c) 2001 Robbie Williamson <robbiew@us.ibm.com>
> -
> -TST_TESTFUNC=do_test
> -TST_CNT=4
> -TST_NEEDS_CMDS='awk ftp'
> -TST_NEEDS_TMPDIR=1
> -
> -RUSER="${RUSER:-root}"
> -RHOST="${RHOST:-localhost}"
> -
> -do_test()
> -{
> -    case $1 in
> -    1) test_get binary;;
> -    2) test_get ascii;;
> -    3) test_put binary;;
> -    4) test_put ascii;;
> -    esac
> -}
> -
> -list_files()
> -{
> -    case $1 in
> -    ascii) echo 'ascii.sm ascii.med ascii.lg ascii.jmb';;
> -    binary) echo 'bin.sm bin.med bin.lg bin.jmb';;
> -    esac
> -}
> -
> -test_get()
> -{
> -    local file sum1 sum2
> -
> -    for file in $(list_files $1); do
> -        {
> -            echo user $RUSER $PASSWD
> -            echo $1
> -            echo cd $TST_NET_DATAROOT
> -            echo get $file
> -            echo quit
> -        } | ftp -nv $RHOST
> -
> -        sum1="$(ls -l $file | awk '{print $5}')"
> -        sum2="$(ls -l $TST_NET_DATAROOT/$file | awk '{print $5}')"
> -        rm -f $file
> -        EXPECT_PASS "[ '$sum1' = '$sum2' ]"
> -    done
> -}
> -
> -test_put()
> -{
> -    local file sum1 sum2
> -
> -    for file in $(list_files $1); do
> -        {
> -            echo user $RUSER $PASSWD
> -            echo lcd $TST_NET_DATAROOT
> -            echo $1
> -            echo cd $TST_TMPDIR
> -            echo put $file
> -            echo quit
> -        } | ftp -nv $RHOST
> -
> -        sum1="$(tst_rhost_run -c "sum $TST_TMPDIR/$file" -s | awk '{print $1}')"
> -        sum2="$(sum $TST_NET_DATAROOT/$file | awk '{print $1}')"
> -        tst_rhost_run -c "rm -f $TST_TMPDIR/$file"
> -        EXPECT_PASS "[ '$sum1' = '$sum2' ]"
> -    done
> -}
> -
> -. tst_net.sh
> -tst_run
> -- 
> 2.45.2
> 


More information about the ltp mailing list