* [LTP] [PATCH v3 1/2] net: Remove rsh, rcp, rlogin tests
@ 2020-07-31 16:24 Petr Vorel
2020-07-31 16:24 ` [LTP] [PATCH v3 2/2] net: Update network related docs Petr Vorel
0 siblings, 1 reply; 4+ messages in thread
From: Petr Vorel @ 2020-07-31 16:24 UTC (permalink / raw)
To: ltp
as they've been replaced by ssh/scp long time ago.
As we still keep telnet test for testing basic network functionality we
can safely drop these tests.
Reviewed-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
runtest/net.tcp_cmds | 3 -
testcases/network/tcp_cmds/Makefile | 2 +-
testcases/network/tcp_cmds/rcp/Makefile | 30 ----
testcases/network/tcp_cmds/rcp/rcp01.sh | 144 ------------------
testcases/network/tcp_cmds/rlogin/Makefile | 31 ----
testcases/network/tcp_cmds/rlogin/rlogin01.sh | 91 -----------
testcases/network/tcp_cmds/rsh/Makefile | 31 ----
testcases/network/tcp_cmds/rsh/rsh01.sh | 115 --------------
8 files changed, 1 insertion(+), 446 deletions(-)
delete mode 100644 testcases/network/tcp_cmds/rcp/Makefile
delete mode 100755 testcases/network/tcp_cmds/rcp/rcp01.sh
delete mode 100644 testcases/network/tcp_cmds/rlogin/Makefile
delete mode 100755 testcases/network/tcp_cmds/rlogin/rlogin01.sh
delete mode 100644 testcases/network/tcp_cmds/rsh/Makefile
delete mode 100755 testcases/network/tcp_cmds/rsh/rsh01.sh
diff --git a/runtest/net.tcp_cmds b/runtest/net.tcp_cmds
index afe6d7c71..db47dfd5b 100644
--- a/runtest/net.tcp_cmds
+++ b/runtest/net.tcp_cmds
@@ -11,9 +11,6 @@ host host01.sh
netstat netstat01.sh
ping01 ping01.sh
ping02 ping02.sh
-rcp rcp01.sh
-rlogin rlogin01.sh
-rsh rsh01.sh
sendfile sendfile01.sh
tcpdump tcpdump01.sh
telnet telnet01.sh
diff --git a/testcases/network/tcp_cmds/Makefile b/testcases/network/tcp_cmds/Makefile
index 748e02469..5719b1fe3 100644
--- a/testcases/network/tcp_cmds/Makefile
+++ b/testcases/network/tcp_cmds/Makefile
@@ -26,7 +26,7 @@ top_srcdir ?= ../../..
include $(top_srcdir)/include/mk/env_pre.mk
ifneq ($(WITH_EXPECT),yes)
-FILTER_OUT_SUBDIRS := ftp rlogin ssh telnet
+FILTER_OUT_SUBDIRS := ftp ssh telnet
endif
INSTALL_DEPS := ../datafiles/bin.sm
diff --git a/testcases/network/tcp_cmds/rcp/Makefile b/testcases/network/tcp_cmds/rcp/Makefile
deleted file mode 100644
index f8131a986..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.sh
-
-include $(top_srcdir)/include/mk/generic_leaf_target.mk
diff --git a/testcases/network/tcp_cmds/rcp/rcp01.sh b/testcases/network/tcp_cmds/rcp/rcp01.sh
deleted file mode 100755
index 4eaeca175..000000000
--- a/testcases/network/tcp_cmds/rcp/rcp01.sh
+++ /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 >/dev/null 2>&1; 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 >/dev/null 2>&1; 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
diff --git a/testcases/network/tcp_cmds/rlogin/Makefile b/testcases/network/tcp_cmds/rlogin/Makefile
deleted file mode 100644
index 1e8d10ea4..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.sh
-
-MAKE_TARGETS :=
-
-include $(top_srcdir)/include/mk/generic_leaf_target.mk
diff --git a/testcases/network/tcp_cmds/rlogin/rlogin01.sh b/testcases/network/tcp_cmds/rlogin/rlogin01.sh
deleted file mode 100755
index c34ab1c4e..000000000
--- a/testcases/network/tcp_cmds/rlogin/rlogin01.sh
+++ /dev/null
@@ -1,91 +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
-
-TST_USE_LEGACY_API=1
-. tst_net.sh
-
-setup()
-{
- tst_require_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 rlogin 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
diff --git a/testcases/network/tcp_cmds/rsh/Makefile b/testcases/network/tcp_cmds/rsh/Makefile
deleted file mode 100644
index 00ae49d8b..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.sh
-
-MAKE_TARGETS :=
-
-include $(top_srcdir)/include/mk/generic_leaf_target.mk
diff --git a/testcases/network/tcp_cmds/rsh/rsh01.sh b/testcases/network/tcp_cmds/rsh/rsh01.sh
deleted file mode 100755
index 3968f9056..000000000
--- a/testcases/network/tcp_cmds/rsh/rsh01.sh
+++ /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.27.0
^ permalink raw reply related [flat|nested] 4+ messages in thread* [LTP] [PATCH v3 2/2] net: Update network related docs
2020-07-31 16:24 [LTP] [PATCH v3 1/2] net: Remove rsh, rcp, rlogin tests Petr Vorel
@ 2020-07-31 16:24 ` Petr Vorel
2020-08-03 12:51 ` Alexey Kodanev
0 siblings, 1 reply; 4+ messages in thread
From: Petr Vorel @ 2020-07-31 16:24 UTC (permalink / raw)
To: ltp
* testcases/network/README.md
- drop rlogin, rsh, rexec setup (removed in previous commit "net: Remove
rsh, rcp, rlogin tests")
- rewrite server side configuration (most of the services are started
thus not needed to be running, improve ftp & telnet setup; add HTTP,
NFS and TI-RPC / Sun RPC (glibc) setup)
- remove suggestion to run tests for 24 hrs (we lowered values in the
variables for stress testing in 52857efb7)
- mention testcases/network/stress/README
- update package names
- fix formatting
* INSTALL
- move everything relevant to testcases/network/README.md (rpcbind).
- drop xinetd setup (only in.telnetd is tested nowadays and does not
have to be running, just installed)
- drop /etc/securetty section (rlogin, rsh, rexec aren't used any more
and ssh access IMHO does not require pts/[0-9])
Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
INSTALL | 49 +---------------
testcases/network/README.md | 113 +++++++++++++++++-------------------
2 files changed, 54 insertions(+), 108 deletions(-)
diff --git a/INSTALL b/INSTALL
index 2056e8ea0..52d61101e 100644
--- a/INSTALL
+++ b/INSTALL
@@ -151,54 +151,7 @@ contributions are welcome.
in the CD-ROM drive. The corresponding tests will fail if either disk is
missing.
-5. The network tests are executed by running the network.sh script. The network
- tests require some configuration for them to work correctly:
-
- i) First, there MUST be another test machine setup to act as the server
- to these client side tests. This machine MUST have the LTP installed
- in the same exact location, i.e. if the client has /root/ltp, then the
- server must have /root/ltp. This is required because certain tests
- expect to find server files in certain locations. Make sure to compile
- the LTP on this server machine also.
-
- ii) Second, the server must be setup to allow the client to connect using
- the "r" commands, such as rsh. This is done by simply creating/editing
- the ".rhosts" file under /root. Place the hostname of the client
- machine in this file to allow root to remotely connect without the use
- of a password. If server has the PAM system security tool, you need
- to add the following lines to /etc/securetty:
- rlogin
- rsh
- rexec
- pts/0
- pts/1
- :
- pts/9
-
- iii) Next, certain services must be activated in order for certain tests to
- execute. The following services are activated via inetd/xinetd:
- rlogind
- ftpd
- telnetd
- echo (stream)
- fingerd
- rshd
- Also, because certain RPC programs are tested, the portmapper daemon
- (rpcbind, or portmap on old distributions) MUST be started, as well as NFS
- server AND lock services.
-
- iv) Finally, before running the network.sh script, two variables must be
- set: The "RHOST" variable should be set to the hostname of the server.
- The "PASSWD" variable should be set to root's password on the server
- machine. This is necessary for tests such as telnet01.sh and ftp01.sh.
-
- You can now successfully execute the network.sh script.
-
- You can run the test category which you are interested in, -h option shows
- the list of the test category:
- # ./network.sh -h
-
- For more info about howto run network.sh see testcases/network/README.md.
+5. The network tests related installation see testcases/network/README.md.
Cross compiling
---------------
diff --git a/testcases/network/README.md b/testcases/network/README.md
index e589adc64..34728fbeb 100644
--- a/testcases/network/README.md
+++ b/testcases/network/README.md
@@ -1,94 +1,87 @@
# LTP Network Tests
-## Pre-requisites
-Enable all the networking services on test machine(s): rshd, nfsd, fingerd.
-
-Both single and two host configurations support debugging via
-`TST_NET_RHOST_RUN_DEBUG=1` environment variable.
-
## Single Host Configuration
-It is a default configuration ('RHOST' is not defined). LTP adds 'ltp_ns'
-network namespace and auto-configure 'veth' pair according to LTP network
-environment variables.
+It's the default configuration (if the `RHOST` environment variable is not
+defined). LTP adds `ltp_ns` network namespace and auto-configure `veth` pair
+according to LTP network environment variables.
## Two Host Configuration
-This setup requires 'RHOST' environment variable to be set properly and
-configured SSH or RSH (default) access to a remote host.
+This setup requires the `RHOST` environment variable to be set properly and
+configured SSH access to a remote host.
-The 'RHOST' variable name must be set to the hostname of the server
-(test management link) and PASSWD should be set to the root password
-of the remote server.
+The `RHOST` variable must be set to the hostname of the server (test management
+link) and public key setup or login without password is required.
-In order to have RSH access:
-* Edit the "/root/.rhosts" file. Please note that the file may not exist,
-so you must create one if it does not. You must add the fully qualified
-hostname of the machine you are testing on to this file. By adding the test
-machine's hostname to this file, you will be allowing the machine to rsh to itself,
-as root, without the requirement of a password.
+SSH server needs to be configured to allow root login and use Public Key
+Authentication (`PermitRootLogin yes` and `PubkeyAuthentication yes` in
+`/etc/ssh/sshd_config`).
-```sh
-echo $client_hostname >> /root/.rhosts
-```
+Some of the network stress tests which hasn't been ported to network API were
+designed to be tested with `rsh` via `LTP_RSH` environment variable. Now it's
+by default used `ssh`, for details see `testcases/network/stress/README`.
-You may need to re-label '.rhost' file to make sure rlogind will have access to it:
+## Server Services Configuration
+Tests have various external dependencies, exit with `TCONF` when not installed.
+Some tests require additional setup.
-```sh
-/sbin/restorecon -v /root/.rhosts
-```
+### FTP and telnet setup
+FTP stress tests and telnet server tests require environment variables `RHOST`
+(remote machine), `RUSER` (remote user) and `PASSWD` (remote password). NOTE:
+`RHOST` will imply two host configuration for other tests.
-* Add rlogin, rsh, rexec into /etc/securetty file:
+If `RHOST` is set to `root`, either of these steps is required:
-```sh
-for i in rlogin rsh rexec; do echo $i >> /etc/securetty; done
+* In `/etc/ftpusers` (or `/etc/vsftpd.ftpusers`), comment the line containing
+"root" string. This file lists all those users who are not given access to do ftp
+on the current system.
+
+* If you don?t want to do the previous step, put following entry into `/root/.netrc`:
+```
+machine <remote_server_name>
+login root
+password <remote_root_password>
```
-## Server Services Configuration
-Verify that the below daemon services are running. If not, please install
-and start them:
-rsh-server, telnet-server, finger-server, rdist, rsync, dhcp-server, http-server.
+### HTTP setup
+HTTP stress tests require configured and running web server (Apache2, Nginx, etc.).
-Note: If any of the above daemon is not running on server, the test related to
-that service running from client will fail.
+### NFS setup
+NFS tests require running NFS server must be running, enable and start `nfs-server.service`
+(Debian/Ubuntu and openSUSE/SLES: `nfs-kernel-server` package, others `nfs-server` package).
-### FTP setup
-* In ?/etc/ftpusers? [or vi /etc/vsftpd.ftpusers], comment the line containing
-?root? string. This file lists all those users who are not given access to do ftp
-on the current system.
+There is no detection whether service is running, test will simply fail without warning.
-* If you don?t want to do the previous step, put following entry into /root/.netrc
-machine <remote_server_name> login root password <remote_root_password>.
-Otherwise, ftp,rlogin & telnet fails for ?root? user & hence needs to be
-executed using ?test? user to get successful results.
+### TI-RPC / Sun RPC setup
+TI-RPC (or glibc legacy Sun RPC) tests require running rpcbind (or portmap on
+old distributions), enable and start `rpcbind.service`.
## LTP setup
-Install LTP testsuite. In case of two hosts configuration, make sure LTP is installed
-on both client and server machines.
+Install LTP testsuite (see INSTALL). In case of two hosts configuration, LTP
+needs to be installed the same exact location and `LTPROOT` and `PATH`
+environment variables set on *both* client and server machines. This is
+required because some tests expect to find server files in certain locations.
-Testcases and network tools must be in PATH, e.g.:
+Example for the default prefix `/opt/ltp`:
```sh
-export PATH=/opt/ltp/testcases/bin:/usr/bin:$PATH
+export LTPROOT="/opt/ltp"; export PATH="$LTPROOT/testcases/bin:$PATH"
```
-Default values for all LTP network variables are set in testcases/lib/tst_net.sh.
-If you need to override some parameters please export them before test run or
-specify them when running ltp-pan or testscripts/network.sh.
## Running the tests
-To run the test type the following:
+The network tests are executed by running the network.sh script:
```sh
TEST_VARS ./network.sh OPTIONS
```
Where
-* TEST_VARS - non-default network parameters (see testcases/lib/tst_net.sh), they
- could be exported before test run;
-* OPTIONS - test group(s), use '-h' to see available ones.
+* `TEST_VARS` - non-default network parameters
+* `OPTIONS` - test group(s), use `-h` to see available ones.
-## Analyzing the results
-Generally this test must be run more than 24 hours. When you want to stop the test
-press CTRL+C to stop ./network.sh.
+Default values for all LTP network parameters are set in `testcases/lib/tst_net.sh`.
+Network stress parameters are documented in `testcases/network/stress/README`.
-Search failed tests in LTP logfile using grep FAIL <logfile>. For any failures,
-run the individual tests and then try to come to the conclusion.
+## Debugging
+Both single and two host configurations support debugging via
+`TST_NET_RHOST_RUN_DEBUG=1` environment variable.
--
2.27.0
^ permalink raw reply related [flat|nested] 4+ messages in thread* [LTP] [PATCH v3 2/2] net: Update network related docs
2020-07-31 16:24 ` [LTP] [PATCH v3 2/2] net: Update network related docs Petr Vorel
@ 2020-08-03 12:51 ` Alexey Kodanev
2020-08-05 10:48 ` Petr Vorel
0 siblings, 1 reply; 4+ messages in thread
From: Alexey Kodanev @ 2020-08-03 12:51 UTC (permalink / raw)
To: ltp
On 31.07.2020 19:24, Petr Vorel wrote:
> * testcases/network/README.md
> - drop rlogin, rsh, rexec setup (removed in previous commit "net: Remove
> rsh, rcp, rlogin tests")
> - rewrite server side configuration (most of the services are started
> thus not needed to be running, improve ftp & telnet setup; add HTTP,
> NFS and TI-RPC / Sun RPC (glibc) setup)
> - remove suggestion to run tests for 24 hrs (we lowered values in the
> variables for stress testing in 52857efb7)
> - mention testcases/network/stress/README
> - update package names
> - fix formatting
>
> * INSTALL
> - move everything relevant to testcases/network/README.md (rpcbind).
> - drop xinetd setup (only in.telnetd is tested nowadays and does not
> have to be running, just installed)
> - drop /etc/securetty section (rlogin, rsh, rexec aren't used any more
> and ssh access IMHO does not require pts/[0-9])
>
> Signed-off-by: Petr Vorel <pvorel@suse.cz>
> ---
> INSTALL | 49 +---------------
> testcases/network/README.md | 113 +++++++++++++++++-------------------
> 2 files changed, 54 insertions(+), 108 deletions(-)
>
> diff --git a/INSTALL b/INSTALL
> index 2056e8ea0..52d61101e 100644
> --- a/INSTALL
> +++ b/INSTALL
> @@ -151,54 +151,7 @@ contributions are welcome.
> in the CD-ROM drive. The corresponding tests will fail if either disk is
> missing.
>
> -5. The network tests are executed by running the network.sh script. The network
> - tests require some configuration for them to work correctly:
> -
> - i) First, there MUST be another test machine setup to act as the server
> - to these client side tests. This machine MUST have the LTP installed
> - in the same exact location, i.e. if the client has /root/ltp, then the
> - server must have /root/ltp. This is required because certain tests
> - expect to find server files in certain locations. Make sure to compile
> - the LTP on this server machine also.
> -
> - ii) Second, the server must be setup to allow the client to connect using
> - the "r" commands, such as rsh. This is done by simply creating/editing
> - the ".rhosts" file under /root. Place the hostname of the client
> - machine in this file to allow root to remotely connect without the use
> - of a password. If server has the PAM system security tool, you need
> - to add the following lines to /etc/securetty:
> - rlogin
> - rsh
> - rexec
> - pts/0
> - pts/1
> - :
> - pts/9
> -
> - iii) Next, certain services must be activated in order for certain tests to
> - execute. The following services are activated via inetd/xinetd:
> - rlogind
> - ftpd
> - telnetd
> - echo (stream)
> - fingerd
> - rshd
> - Also, because certain RPC programs are tested, the portmapper daemon
> - (rpcbind, or portmap on old distributions) MUST be started, as well as NFS
> - server AND lock services.
> -
> - iv) Finally, before running the network.sh script, two variables must be
> - set: The "RHOST" variable should be set to the hostname of the server.
> - The "PASSWD" variable should be set to root's password on the server
> - machine. This is necessary for tests such as telnet01.sh and ftp01.sh.
> -
> - You can now successfully execute the network.sh script.
> -
> - You can run the test category which you are interested in, -h option shows
> - the list of the test category:
> - # ./network.sh -h
> -
> - For more info about howto run network.sh see testcases/network/README.md.
> +5. The network tests related installation see testcases/network/README.md.
>
> Cross compiling
> ---------------
> diff --git a/testcases/network/README.md b/testcases/network/README.md
> index e589adc64..34728fbeb 100644
> --- a/testcases/network/README.md
> +++ b/testcases/network/README.md
> @@ -1,94 +1,87 @@
> # LTP Network Tests
>
> -## Pre-requisites
> -Enable all the networking services on test machine(s): rshd, nfsd, fingerd.
> -
> -Both single and two host configurations support debugging via
> -`TST_NET_RHOST_RUN_DEBUG=1` environment variable.
> -
> ## Single Host Configuration
>
> -It is a default configuration ('RHOST' is not defined). LTP adds 'ltp_ns'
> -network namespace and auto-configure 'veth' pair according to LTP network
> -environment variables.
> +It's the default configuration (if the `RHOST` environment variable is not
> +defined). LTP adds `ltp_ns` network namespace and auto-configure `veth` pair
> +according to LTP network environment variables.
>
> ## Two Host Configuration
>
> -This setup requires 'RHOST' environment variable to be set properly and
> -configured SSH or RSH (default) access to a remote host.
> +This setup requires the `RHOST` environment variable to be set properly and
> +configured SSH access to a remote host.
>
> -The 'RHOST' variable name must be set to the hostname of the server
> -(test management link) and PASSWD should be set to the root password
> -of the remote server.
> +The `RHOST` variable must be set to the hostname of the server (test management
> +link) and public key setup or login without password is required.
>
> -In order to have RSH access:
> -* Edit the "/root/.rhosts" file. Please note that the file may not exist,
> -so you must create one if it does not. You must add the fully qualified
> -hostname of the machine you are testing on to this file. By adding the test
> -machine's hostname to this file, you will be allowing the machine to rsh to itself,
> -as root, without the requirement of a password.
> +SSH server needs to be configured to allow root login and use Public Key
> +Authentication (`PermitRootLogin yes` and `PubkeyAuthentication yes` in
> +`/etc/ssh/sshd_config`).
>
> -```sh
> -echo $client_hostname >> /root/.rhosts
> -```
> +Some of the network stress tests which hasn't been ported to network API were
> +designed to be tested with `rsh` via `LTP_RSH` environment variable. Now it's
> +by default used `ssh`, for details see `testcases/network/stress/README`.
>
> -You may need to re-label '.rhost' file to make sure rlogind will have access to it:
> +## Server Services Configuration
> +Tests have various external dependencies, exit with `TCONF` when not installed.
> +Some tests require additional setup.
>
> -```sh
> -/sbin/restorecon -v /root/.rhosts
> -```
> +### FTP and telnet setup
> +FTP stress tests and telnet server tests require environment variables `RHOST`
> +(remote machine), `RUSER` (remote user) and `PASSWD` (remote password). NOTE:
> +`RHOST` will imply two host configuration for other tests.
>
> -* Add rlogin, rsh, rexec into /etc/securetty file:
> +If `RHOST` is set to `root`, either of these steps is required:
^
RUSER?
>
> -```sh
> -for i in rlogin rsh rexec; do echo $i >> /etc/securetty; done
> +* In `/etc/ftpusers` (or `/etc/vsftpd.ftpusers`), comment the line containing
> +"root" string. This file lists all those users who are not given access to do ftp
> +on the current system.
> +
> +* If you don?t want to do the previous step, put following entry into `/root/.netrc`:
> +```
> +machine <remote_server_name>
> +login root
> +password <remote_root_password>
> ```
>
> -## Server Services Configuration
> -Verify that the below daemon services are running. If not, please install
> -and start them:
> -rsh-server, telnet-server, finger-server, rdist, rsync, dhcp-server, http-server.
> +### HTTP setup
> +HTTP stress tests require configured and running web server (Apache2, Nginx, etc.).
>
> -Note: If any of the above daemon is not running on server, the test related to
> -that service running from client will fail.
> +### NFS setup
> +NFS tests require running NFS server must be running, enable and start `nfs-server.service`
"must be running" is redundant
> +(Debian/Ubuntu and openSUSE/SLES: `nfs-kernel-server` package, others `nfs-server` package).
>
> -### FTP setup
> -* In ?/etc/ftpusers? [or vi /etc/vsftpd.ftpusers], comment the line containing
> -?root? string. This file lists all those users who are not given access to do ftp
> -on the current system.
> +There is no detection whether service is running, test will simply fail without warning.
>
> -* If you don?t want to do the previous step, put following entry into /root/.netrc
> -machine <remote_server_name> login root password <remote_root_password>.
> -Otherwise, ftp,rlogin & telnet fails for ?root? user & hence needs to be
> -executed using ?test? user to get successful results.
> +### TI-RPC / Sun RPC setup
> +TI-RPC (or glibc legacy Sun RPC) tests require running rpcbind (or portmap on
> +old distributions), enable and start `rpcbind.service`.
>
> ## LTP setup
> -Install LTP testsuite. In case of two hosts configuration, make sure LTP is installed
> -on both client and server machines.
> +Install LTP testsuite (see INSTALL). In case of two hosts configuration, LTP
> +needs to be installed the same exact location and `LTPROOT` and `PATH`
> +environment variables set on *both* client and server machines. This is
> +required because some tests expect to find server files in certain locations.
>
> -Testcases and network tools must be in PATH, e.g.:
> +Example for the default prefix `/opt/ltp`:
>
> ```sh
> -export PATH=/opt/ltp/testcases/bin:/usr/bin:$PATH
> +export LTPROOT="/opt/ltp"; export PATH="$LTPROOT/testcases/bin:$PATH"
> ```
> -Default values for all LTP network variables are set in testcases/lib/tst_net.sh.
> -If you need to override some parameters please export them before test run or
> -specify them when running ltp-pan or testscripts/network.sh.
>
> ## Running the tests
> -To run the test type the following:
> +The network tests are executed by running the network.sh script:
>
> ```sh
> TEST_VARS ./network.sh OPTIONS
> ```
> Where
> -* TEST_VARS - non-default network parameters (see testcases/lib/tst_net.sh), they
> - could be exported before test run;
> -* OPTIONS - test group(s), use '-h' to see available ones.
> +* `TEST_VARS` - non-default network parameters
> +* `OPTIONS` - test group(s), use `-h` to see available ones.
>
> -## Analyzing the results
> -Generally this test must be run more than 24 hours. When you want to stop the test
> -press CTRL+C to stop ./network.sh.
> +Default values for all LTP network parameters are set in `testcases/lib/tst_net.sh`.
> +Network stress parameters are documented in `testcases/network/stress/README`.
>
> -Search failed tests in LTP logfile using grep FAIL <logfile>. For any failures,
> -run the individual tests and then try to come to the conclusion.
> +## Debugging
> +Both single and two host configurations support debugging via
> +`TST_NET_RHOST_RUN_DEBUG=1` environment variable.
>
Apart from the minor typos mentioned above, both patches look fine.
Acked-by: Alexey Kodanev <alexey.kodanev@oracle.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-08-05 10:48 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-07-31 16:24 [LTP] [PATCH v3 1/2] net: Remove rsh, rcp, rlogin tests Petr Vorel
2020-07-31 16:24 ` [LTP] [PATCH v3 2/2] net: Update network related docs Petr Vorel
2020-08-03 12:51 ` Alexey Kodanev
2020-08-05 10:48 ` Petr Vorel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox