All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH v2 1/4] network: Add 'net.' prefix to TI-RPC and TS-RPC tests files
@ 2017-02-08 14:44 Petr Vorel
  2017-02-08 14:44 ` [LTP] [PATCH v2 2/4] network: Add TI-RPC and TS-RPC tests into network.sh Petr Vorel
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Petr Vorel @ 2017-02-08 14:44 UTC (permalink / raw)
  To: ltp

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 runtest/{rpc_tests => net.rpc_tests}     | 0
 runtest/{tirpc_tests => net.tirpc_tests} | 0
 testcases/network/rpc/rpc-tirpc/README   | 4 ++--
 3 files changed, 2 insertions(+), 2 deletions(-)
 rename runtest/{rpc_tests => net.rpc_tests} (100%)
 rename runtest/{tirpc_tests => net.tirpc_tests} (100%)

diff --git a/runtest/rpc_tests b/runtest/net.rpc_tests
similarity index 100%
rename from runtest/rpc_tests
rename to runtest/net.rpc_tests
diff --git a/runtest/tirpc_tests b/runtest/net.tirpc_tests
similarity index 100%
rename from runtest/tirpc_tests
rename to runtest/net.tirpc_tests
diff --git a/testcases/network/rpc/rpc-tirpc/README b/testcases/network/rpc/rpc-tirpc/README
index d87024c41..139162751 100644
--- a/testcases/network/rpc/rpc-tirpc/README
+++ b/testcases/network/rpc/rpc-tirpc/README
@@ -44,8 +44,8 @@ The sources here are modified a bit to use the LTP wrapper - rpc_test.sh -
 instead of a bunch of scripts from the above web page.
 
 The basic group of test cases can be executed from
- * runtest/rpc_tests - for TS-RPC testing
- * runtest/tirpc_tests - for TI-RPC testing
+ * runtest/net.rpc_tests - for TS-RPC testing
+ * runtest/net.tirpc_tests - for TI-RPC testing
 using the LTP framework (ltp-pan, runltp and etc).
 
 Additional test cases (like stress, complex and etc) are to be integrated.
-- 
2.11.0


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

* [LTP] [PATCH v2 2/4] network: Add TI-RPC and TS-RPC tests into network.sh
  2017-02-08 14:44 [LTP] [PATCH v2 1/4] network: Add 'net.' prefix to TI-RPC and TS-RPC tests files Petr Vorel
@ 2017-02-08 14:44 ` Petr Vorel
  2017-02-13 16:42   ` Alexey Kodanev
  2017-02-08 14:44 ` [LTP] [PATCH v2 3/4] network: Minor doc, copyright and whitespace fixes Petr Vorel
  2017-02-08 14:45 ` [LTP] [PATCH v2 4/4] network: migrate rpc_test.sh to use test_net.sh Petr Vorel
  2 siblings, 1 reply; 7+ messages in thread
From: Petr Vorel @ 2017-02-08 14:44 UTC (permalink / raw)
  To: ltp

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 testscripts/network.sh | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/testscripts/network.sh b/testscripts/network.sh
index 2d2c6762c..fce59f576 100755
--- a/testscripts/network.sh
+++ b/testscripts/network.sh
@@ -24,6 +24,8 @@ usage()
 	echo "  -r    RPC tests"
 	echo "  -s    SCTP tests"
 	echo "  -t    TCP/IP command tests"
+	echo "  -c    TI-RPC tests"
+	echo "  -s    TS-RPC tests"
 	echo "  -a    Application tests (HTTP, SSH, DNS)"
 	echo "  -e    Interface stress tests"
 	echo "  -b    Stress tests with malformed ICMP packets"
@@ -40,7 +42,7 @@ usage()
 
 TEST_CASES=
 
-while getopts 6mnrstaebiTURMFf:Vvh OPTION
+while getopts 6mnrstaebcsiTURMFf:Vvh OPTION
 do
 	case $OPTION in
 	6) TEST_CASES="$TEST_CASES net.ipv6 net.ipv6_lib";;
@@ -49,6 +51,8 @@ do
 	r) TEST_CASES="$TEST_CASES net.rpc" ;;
 	s) TEST_CASES="$TEST_CASES net.sctp" ;;
 	t) TEST_CASES="$TEST_CASES net.tcp_cmds" ;;
+	c) TEST_CASES="$TEST_CASES net.rpc_tests";;
+	s) TEST_CASES="$TEST_CASES net.tirpc_tests";;
 	a) TEST_CASES="$TEST_CASES net_stress.appl";;
 	e) TEST_CASES="$TEST_CASES net_stress.interface";;
 	b) TEST_CASES="$TEST_CASES net_stress.broken_ip";;
-- 
2.11.0


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

* [LTP] [PATCH v2 3/4] network: Minor doc, copyright and whitespace fixes
  2017-02-08 14:44 [LTP] [PATCH v2 1/4] network: Add 'net.' prefix to TI-RPC and TS-RPC tests files Petr Vorel
  2017-02-08 14:44 ` [LTP] [PATCH v2 2/4] network: Add TI-RPC and TS-RPC tests into network.sh Petr Vorel
@ 2017-02-08 14:44 ` Petr Vorel
  2017-02-08 14:45 ` [LTP] [PATCH v2 4/4] network: migrate rpc_test.sh to use test_net.sh Petr Vorel
  2 siblings, 0 replies; 7+ messages in thread
From: Petr Vorel @ 2017-02-08 14:44 UTC (permalink / raw)
  To: ltp

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 testcases/lib/test_net.sh |  3 ++-
 testscripts/network.sh    | 18 +++++++++---------
 2 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/testcases/lib/test_net.sh b/testcases/lib/test_net.sh
index 37cc93914..64c17e924 100644
--- a/testcases/lib/test_net.sh
+++ b/testcases/lib/test_net.sh
@@ -1,5 +1,6 @@
 #!/bin/sh
-# Copyright (c) 2014-2015 Oracle and/or its affiliates. All Rights Reserved.
+# Copyright (c) 2014-2016 Oracle and/or its affiliates. All Rights Reserved.
+# Copyright (c) 2016-2017 Petr Vorel <pvorel@suse.cz>
 #
 # This program is free software; you can redistribute it and/or
 # modify it under the terms of the GNU General Public License as
diff --git a/testscripts/network.sh b/testscripts/network.sh
index fce59f576..ada4dec84 100755
--- a/testscripts/network.sh
+++ b/testscripts/network.sh
@@ -26,7 +26,7 @@ usage()
 	echo "  -t    TCP/IP command tests"
 	echo "  -c    TI-RPC tests"
 	echo "  -s    TS-RPC tests"
-	echo "  -a    Application tests (HTTP, SSH, DNS)"
+	echo "  -a    Application stress tests (HTTP, SSH, DNS)"
 	echo "  -e    Interface stress tests"
 	echo "  -b    Stress tests with malformed ICMP packets"
 	echo "  -i    IPsec ICMP stress tests"
@@ -46,11 +46,11 @@ while getopts 6mnrstaebcsiTURMFf:Vvh OPTION
 do
 	case $OPTION in
 	6) TEST_CASES="$TEST_CASES net.ipv6 net.ipv6_lib";;
-	m) TEST_CASES="$TEST_CASES net.multicast" ;;
-	n) TEST_CASES="$TEST_CASES net.nfs" ;;
-	r) TEST_CASES="$TEST_CASES net.rpc" ;;
-	s) TEST_CASES="$TEST_CASES net.sctp" ;;
-	t) TEST_CASES="$TEST_CASES net.tcp_cmds" ;;
+	m) TEST_CASES="$TEST_CASES net.multicast";;
+	n) TEST_CASES="$TEST_CASES net.nfs";;
+	r) TEST_CASES="$TEST_CASES net.rpc";;
+	s) TEST_CASES="$TEST_CASES net.sctp";;
+	t) TEST_CASES="$TEST_CASES net.tcp_cmds";;
 	c) TEST_CASES="$TEST_CASES net.rpc_tests";;
 	s) TEST_CASES="$TEST_CASES net.tirpc_tests";;
 	a) TEST_CASES="$TEST_CASES net_stress.appl";;
@@ -62,10 +62,10 @@ do
 	R) TEST_CASES="$TEST_CASES net_stress.route";;
 	M) TEST_CASES="$TEST_CASES net_stress.multicast";;
 	F) TEST_CASES="$TEST_CASES net.features";;
-	f) TEST_CASES=${OPTARG} ;;
+	f) TEST_CASES=${OPTARG};;
 	V|v) VERBOSE="yes";;
-	h) usage; exit 0 ;;
-	*) echo "Error: invalid option..."; usage; exit 1 ;;
+	h) usage; exit 0;;
+	*) echo "Error: invalid option..."; usage; exit 1;;
 	esac
 done
 
-- 
2.11.0


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

* [LTP] [PATCH v2 4/4] network: migrate rpc_test.sh to use test_net.sh
  2017-02-08 14:44 [LTP] [PATCH v2 1/4] network: Add 'net.' prefix to TI-RPC and TS-RPC tests files Petr Vorel
  2017-02-08 14:44 ` [LTP] [PATCH v2 2/4] network: Add TI-RPC and TS-RPC tests into network.sh Petr Vorel
  2017-02-08 14:44 ` [LTP] [PATCH v2 3/4] network: Minor doc, copyright and whitespace fixes Petr Vorel
@ 2017-02-08 14:45 ` Petr Vorel
  2017-02-14  9:50   ` Alexey Kodanev
  2 siblings, 1 reply; 7+ messages in thread
From: Petr Vorel @ 2017-02-08 14:45 UTC (permalink / raw)
  To: ltp

This fixes missing LTPROOT environment variable.

Many tests are failing when using netns.

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 testcases/network/rpc/rpc-tirpc/rpc_test.sh | 59 ++++++++++-------------------
 1 file changed, 21 insertions(+), 38 deletions(-)

diff --git a/testcases/network/rpc/rpc-tirpc/rpc_test.sh b/testcases/network/rpc/rpc-tirpc/rpc_test.sh
index 17fc5ed09..03fc70d4a 100755
--- a/testcases/network/rpc/rpc-tirpc/rpc_test.sh
+++ b/testcases/network/rpc/rpc-tirpc/rpc_test.sh
@@ -1,6 +1,7 @@
 #!/bin/sh
 #
 # Copyright (c) 2014 Oracle and/or its affiliates. All Rights Reserved.
+# Copyright (c) 2017 Petr Vorel <pvorel@suse.cz>
 #
 # This program is free software; you can redistribute it and/or
 # modify it under the terms of the GNU General Public License as
@@ -17,18 +18,8 @@
 # Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 #
 # This is a wrapper script to execute tests from the RPC/TI-RPC tests
-# suite (http://nfsv4.bullopensource.org/doc/rpc_testsuite.php) in LTP
-#
-# This wrapper uses the RHOST environment variable:
-#
-# If the RHOST variable is set, then the rpc server instance (if needed)
-# is started on RHOST, using rsh, and the client program is passed
-# the RHOST value.
-#
-# If the RHOST variable is not set, then the rpc server instance (if needed)
-# is started on the local host, and the client program is passed `hostname`.
+# suite (http://nfsv4.bullopensource.org/doc/rpc_testsuite.php) in LTP.
 
-SERVER_HOST=${RHOST:-`hostname`}
 SERVER=""
 CLIENT=""
 CLIENT_EXTRA_OPTS=""
@@ -37,38 +28,29 @@ CLEANER=""
 PROGNUMNOSVC=536875000
 SERVER_STARTUP_SLEEP=1
 
-run_cmd()
-{
-	if [ ! -z "$RHOST" ]; then
-		rsh -n "$RHOST" "$1"
-	else
-		$1
-	fi
-}
-
 cleanup()
 {
 	if [ ! -z "$SERVER" ]; then
-		run_cmd "killall -9 $SERVER"
-		run_cmd "$CLEANER $PROGNUMNOSVC"
+		tst_rhost_run -c "killall -9 $SERVER"
+		tst_rhost_run -c "$CLEANER $PROGNUMNOSVC"
 	fi
 }
 
 usage()
 {
-	echo "USAGE: $0 [-s sprog] -c clprog [ -e extra ]"
-	echo ""
-	echo "sprog   - server program binary"
-	echo "clprog  - client program binary"
-	echo "extra   - extra client options"
-	echo ""
-	echo "This scripts connects to the RHOST host by rsh and starts"
-	echo "sprog there. After that it executes clprog passing it the"
-	echo "RHOST value."
-	echo "After the test completes, this script kills sprog on RHOST"
-	echo "and performs a cleaning operation."
-	echo ""
-	echo "If RHOST is not set, the local host is used."
+	cat << EOF
+USAGE: $0 [-s sprog] -c clprog [ -e extra ]
+
+sprog   - server program binary
+clprog  - client program binary
+extra   - extra client options
+
+This scripts connects to the remote host and starts sprog there. After that it
+executes clprog passing it the remote host value.
+
+After the test completes, this script kills sprog on remote and performs a
+cleaning operation.
+EOF
 
 	exit 1
 }
@@ -99,15 +81,16 @@ fi
 TCID="$CLIENT"
 TST_TOTAL=1
 TST_COUNT=1
-. test.sh
 TST_CLEANUP=cleanup
 
+. test_net.sh
+
 if [ ! -z "$SERVER" ]; then
-	run_cmd "$SERVER $PROGNUMNOSVC" &
+	tst_rhost_run -b -c "$SERVER $PROGNUMNOSVC"
 	sleep "$SERVER_STARTUP_SLEEP"
 fi
 
-"$CLIENT" "$SERVER_HOST" "$PROGNUMNOSVC" $CLIENT_EXTRA_OPTS
+"$CLIENT" "$(tst_ipaddr rhost)" "$PROGNUMNOSVC" $CLIENT_EXTRA_OPTS
 ret=$?
 
 if [ "$ret" -eq 0 ]; then
-- 
2.11.0


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

* [LTP] [PATCH v2 2/4] network: Add TI-RPC and TS-RPC tests into network.sh
  2017-02-08 14:44 ` [LTP] [PATCH v2 2/4] network: Add TI-RPC and TS-RPC tests into network.sh Petr Vorel
@ 2017-02-13 16:42   ` Alexey Kodanev
  0 siblings, 0 replies; 7+ messages in thread
From: Alexey Kodanev @ 2017-02-13 16:42 UTC (permalink / raw)
  To: ltp

Hi,
On 08.02.2017 17:44, Petr Vorel wrote:
> Signed-off-by: Petr Vorel <pvorel@suse.cz>
> ---
>  testscripts/network.sh | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/testscripts/network.sh b/testscripts/network.sh
> index 2d2c6762c..fce59f576 100755
> --- a/testscripts/network.sh
> +++ b/testscripts/network.sh
> @@ -24,6 +24,8 @@ usage()
>  	echo "  -r    RPC tests"
>  	echo "  -s    SCTP tests"
>  	echo "  -t    TCP/IP command tests"
> +	echo "  -c    TI-RPC tests"
> +	echo "  -s    TS-RPC tests"

Unfortunately I missed it in the first version, we already has '-s'
option for SCTP.

Thanks,
Alexey

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

* [LTP] [PATCH v2 4/4] network: migrate rpc_test.sh to use test_net.sh
  2017-02-08 14:45 ` [LTP] [PATCH v2 4/4] network: migrate rpc_test.sh to use test_net.sh Petr Vorel
@ 2017-02-14  9:50   ` Alexey Kodanev
  2017-02-16 22:32     ` Petr Vorel
  0 siblings, 1 reply; 7+ messages in thread
From: Alexey Kodanev @ 2017-02-14  9:50 UTC (permalink / raw)
  To: ltp

On 08.02.2017 17:45, Petr Vorel wrote:
> This fixes missing LTPROOT environment variable.
>
> Many tests are failing when using netns.

I tried to run this tests in netns, it seems that rpcbind (listening
port)not available in netns as a results tests are failing. If we
make the clientrun in network namespace, tests pass. Actually, I had
only twofailures:

rpc_test.sh -c rpc_xprt_register
[...]
rpc_xprt_register 1 TBROK : 'rpc_xprt_register 10.0.0.2 536875000 '
failed on '': 'rpc_xprt_register: svc_fd_create: could not retrieve
local addr
rpc_xprt_register: svc.c:96: xprt_register: Assertion `xprt != ((void
*)0)' failed.
sh: line 1: 20123 Aborted                 (core dumped)
rpc_xprt_register 10.0.0.2 536875000'

and the similar one:
rpc_test.sh -c rpc_xprt_unregister


What I did (above your patch):

--- a/testcases/network/rpc/rpc-tirpc/rpc_test.sh
+++ b/testcases/network/rpc/rpc-tirpc/rpc_test.sh
@@ -31,8 +31,8 @@ SERVER_STARTUP_SLEEP=1
 cleanup()
 {
        if [ ! -z "$SERVER" ]; then
-               tst_rhost_run -c "killall -9 $SERVER"
-               tst_rhost_run -c "$CLEANER $PROGNUMNOSVC"
+               killall -9 $SERVER
+               $CLEANER $PROGNUMNOSVC
        fi
 }

@@ -86,12 +86,11 @@ TST_CLEANUP=cleanup
 . test_net.sh

 if [ ! -z "$SERVER" ]; then
-       tst_rhost_run -b -c "$SERVER $PROGNUMNOSVC"
+       $SERVER $PROGNUMNOSVC &
        sleep "$SERVER_STARTUP_SLEEP"
 fi

-"$CLIENT" "$(tst_ipaddr rhost)" "$PROGNUMNOSVC" $CLIENT_EXTRA_OPTS
-ret=$?
+tst_rhost_run -sc "$CLIENT $(tst_ipaddr) $PROGNUMNOSVC $CLIENT_EXTRA_OPTS"

Note, last command would exit the test with TBROK if something bad
happened, so we just need TPASS after that.

Best regards,
Alexey


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

* [LTP] [PATCH v2 4/4] network: migrate rpc_test.sh to use test_net.sh
  2017-02-14  9:50   ` Alexey Kodanev
@ 2017-02-16 22:32     ` Petr Vorel
  0 siblings, 0 replies; 7+ messages in thread
From: Petr Vorel @ 2017-02-16 22:32 UTC (permalink / raw)
  To: ltp

Hi Alexey,

thanks for you review, I'll post v3 with your changes.

> > Many tests are failing when using netns.

> I tried to run this tests in netns, it seems that rpcbind (listening
> port)not available in netns as a results tests are failing. If we
> make the clientrun in network namespace, tests pass. Actually, I had
> only twofailures:

> rpc_test.sh -c rpc_xprt_register
> [...]
> rpc_xprt_register 1 TBROK : 'rpc_xprt_register 10.0.0.2 536875000 '
> failed on '': 'rpc_xprt_register: svc_fd_create: could not retrieve
> local addr
> rpc_xprt_register: svc.c:96: xprt_register: Assertion `xprt != ((void
> *)0)' failed.
> sh: line 1: 20123 Aborted                 (core dumped)
> rpc_xprt_register 10.0.0.2 536875000'

> and the similar one:
> rpc_test.sh -c rpc_xprt_unregister

I got these errors:
* -c (TI-RPC tests)
rpc_clnt_broadcast 1 TBROK: 'rpc_clnt_broadcast 10.0.0.2 536875000 ' failed on '': 'RPC: Timed out
rpc_svc_destroy 1 TBROK: 'rpc_svc_destroy 10.0.0.2 536875000 ' failed on '': 'rpc_svc_destroy: svc_fd_create: could not retrieve local addr
rpc_svcfd_create 1 TBROK: 'rpc_svcfd_create 10.0.0.2 536875000 ' failed on '': 'rpc_svcfd_create: svc_fd_create: could not retrieve local addr
rpc_xprt_register 1 TBROK: 'rpc_xprt_register 10.0.0.2 536875000 ' failed on '': 'rpc_xprt_register: svc_fd_create: could not retrieve local addr
rpc_xprt_unregister 1 TBROK: 'rpc_xprt_unregister 10.0.0.2 536875000 ' failed on '': 'rpc_xprt_unregister: svc_fd_create: could not retrieve local addr

* -d (TS-RPC tests)
tirpc_authdes_create 1 TBROK: 'tirpc_authdes_create 10.0.0.2 536875000 ' failed on '': '1'
tirpc_authdes_seccreate 1 TBROK: 'tirpc_authdes_seccreate 10.0.0.2 536875000 ' failed on '': '1'

I tested it with libtirpc3 1.0.1-3 from Tumbleweed and with libtirpc1 0.2.5-1.1 on Debian
testing.
I wonder whether 'svc_fd_create: could not retrieve local addr' which comes from libtirpc
[1] is our bug or libtirpc bug or netns bug.
BTW there is also another library called ntirpc, which might be useful to test [2].

[1] http://git.linux-nfs.org/?p=steved/libtirpc.git;a=blob;f=src/svc_vc.c;h=97a76a357c7befcd2fae1a1e836506412abf0ae3;hb=HEAD#l232
[2] https://github.com/linuxbox2/ntirpc


Kind regards,
Petr

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

end of thread, other threads:[~2017-02-16 22:32 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-08 14:44 [LTP] [PATCH v2 1/4] network: Add 'net.' prefix to TI-RPC and TS-RPC tests files Petr Vorel
2017-02-08 14:44 ` [LTP] [PATCH v2 2/4] network: Add TI-RPC and TS-RPC tests into network.sh Petr Vorel
2017-02-13 16:42   ` Alexey Kodanev
2017-02-08 14:44 ` [LTP] [PATCH v2 3/4] network: Minor doc, copyright and whitespace fixes Petr Vorel
2017-02-08 14:45 ` [LTP] [PATCH v2 4/4] network: migrate rpc_test.sh to use test_net.sh Petr Vorel
2017-02-14  9:50   ` Alexey Kodanev
2017-02-16 22:32     ` Petr Vorel

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.