network: Add 'net.' prefix to TI-RPC and TS-RPC tests files
PATCH v2 1/4 network: Add 'net.' prefix to TI-RPC and TS-RPC tests files
---
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%)runtest/net.rpc_tests renamed from runtest/rpc_tests +0 -0
runtest/net.tirpc_tests renamed from runtest/tirpc_tests +0 -0
testcases/network/rpc/rpc-tirpc/README +2 -2
@@ -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.
Signature · 1 line
2.11.0
PATCH v2 2/4 network: Add TI-RPC and TS-RPC tests into network.sh
--- testscripts/network.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
testscripts/network.sh +5 -1
@@ -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";;
Signature · 1 line
2.11.0
PATCH v2 2/4 network: Add TI-RPC and TS-RPC tests into network.sh
Hi,
Quoted 10 lines · Petr Vorel
Signed-off-by Petr Vorel <[email protected]>--- testscripts/network.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)testscripts/network.sh +0
-0
testscripts/network.sh usage() · line 28
Quoted 5 lines
testscripts/network.sh +2
-0@@ -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
PATCH v2 3/4 network: Minor doc, copyright and whitespace fixes
In reply to Petr Vorel--- testcases/lib/test_net.sh | 3 ++- testscripts/network.sh | 18 +++++++++--------- 2 files changed, 11 insertions(+), 10 deletions(-)
testcases/lib/test_net.sh +2 -1
@@ -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 <[email protected]> # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as
testscripts/network.sh +9 -9
@@ -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
Signature · 1 line
2.11.0
PATCH v2 4/4 network: migrate rpc_test.sh to use test_net.sh
In reply to Petr VorelThis fixes missing LTPROOT environment variable.
Many tests are failing when using netns.
--- testcases/network/rpc/rpc-tirpc/rpc_test.sh | 59 ++++++++++------------------- 1 file changed, 21 insertions(+), 38 deletions(-)
testcases/network/rpc/rpc-tirpc/rpc_test.sh +21 -38
@@ -1,6 +1,7 @@ #!/bin/sh # # Copyright (c) 2014 Oracle and/or its affiliates. All Rights Reserved. +# Copyright (c) 2017 Petr Vorel <[email protected]> # # 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
Signature · 1 line
2.11.0
PATCH v2 4/4 network: migrate rpc_test.sh to use test_net.sh
Quoted 3 lines · Petr Vorel
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 addrrpc_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):
testcases/network/rpc/rpc-tirpc/rpc_test.sh +4 -5
@@ -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
PATCH v2 4/4 network: migrate rpc_test.sh to use test_net.sh
Hi Alexey,
thanks for you review, I'll post v3 with your changes.
Quoted 17 lines
Quoted 1 line
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-crpc_xprt_register
[...]rpc_xprt_register1 TBROK : 'rpc_xprt_register10.0.0.2 536875000 ' failed on '': 'rpc_xprt_register:svc_fd_create: could not retrieve local addrrpc_xprt_register: svc.c:96:xprt_register: Assertion `xprt != ((void *)0)' failed.
sh: line 1: 20123 Aborted (core dumped)rpc_xprt_register10.0.0.2 536875000'
Quoted 2 lines
and the similar one:
rpc_test.sh-crpc_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 outrpc_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