rpc: Warn when tests aren't compiled
PATCH 1/1 rpc: Warn when tests aren't compiled
Without this test failure was wrongly reported:rpc_test 1 TFAIL: tirpc_rpcb_getaddr 10.0.0.2 536875000 failed unexpectedly
--- testcases/network/rpc/rpc-tirpc/rpc_test.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
testcases/network/rpc/rpc-tirpc/rpc_test.sh +5 -3
@@ -35,10 +35,12 @@ EOF rpc_parse_args() { + local err="LTP compiled without TI-RPC support" + case "$1" in - c) CLIENT="$OPTARG" ;; - e) CLIENT_EXTRA_OPTS="$OPTARG" ;; - s) SERVER="$OPTARG" ;; + c) CLIENT="$OPTARG"; tst_cmd_available $OPTARG || tst_brk TCONF $err;; + e) CLIENT_EXTRA_OPTS="$OPTARG";; + s) SERVER="$OPTARG"; tst_cmd_available $OPTARG || tst_brk TCONF $err;; esac }
Signature · 1 line
2.26.2
PATCH 1/1 rpc: Warn when tests aren't compiled
Quoted 3 lines · Petr Vorel
Without this test failure was wrongly reported:
rpc_test1 TFAIL:tirpc_rpcb_getaddr10.0.0.2 536875000 failed unexpectedly
Hi Petr,
Quoted 13 lines
Signed-off-by Petr Vorel <[email protected]>--- testcases/network/rpc/rpc-tirpc/rpc_test.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)testcases/network/rpc/rpc-tirpc/rpc_test.sh +0
-0@@ -35,10 +35,12 @@ EOF rpc_parse_args() {
testcases/network/rpc/rpc-tirpc/rpc_test.sh EOF · line 44
Quoted 10 lines
testcases/network/rpc/rpc-tirpc/rpc_test.sh +5
-3+ local err="LTP compiled without TI-RPC support" + case "$1" in - c) CLIENT="$OPTARG" ;; - e) CLIENT_EXTRA_OPTS="$OPTARG" ;; - s) SERVER="$OPTARG" ;; + c) CLIENT="$OPTARG"; tst_cmd_available $OPTARG || tst_brk TCONF $err;; + e) CLIENT_EXTRA_OPTS="$OPTARG";; + s) SERVER="$OPTARG"; tst_cmd_available $OPTARG || tst_brk TCONF $err;; esac
Perhaps this one, to write about the missing command:tst_require_cmds $CLIENT $SERVER
or just $CLIENT because it's always used, and if the hint is needed:tst_check_cmds $CLIENT $SERVER || tst_brk TCONF "LTP compiled without TI-RPC support?"
PATCH 1/1 rpc: Warn when tests aren't compiled
Hi Alexey,
...
Quoted 16 lines
testcases/network/rpc/rpc-tirpc/rpc_test.sh EOF · line 44
Quoted 12 lines
rpc_parse_args()
{testcases/network/rpc/rpc-tirpc/rpc_test.sh +5
-3+ local err="LTP compiled without TI-RPC support" + case "$1" in - c) CLIENT="$OPTARG" ;; - e) CLIENT_EXTRA_OPTS="$OPTARG" ;; - s) SERVER="$OPTARG" ;; + c) CLIENT="$OPTARG"; tst_cmd_available $OPTARG || tst_brk TCONF $err;; + e) CLIENT_EXTRA_OPTS="$OPTARG";; + s) SERVER="$OPTARG"; tst_cmd_available $OPTARG || tst_brk TCONF $err;; esacPerhaps this one, to write about the missing command:
tst_require_cmds$CLIENT $SERVER
Quoted 2 lines
or just $CLIENT because it's always used, and if the hint is needed:
tst_check_cmds$CLIENT $SERVER ||tst_brkTCONF "LTP compiled without TI-RPC support?"
I prefer to have the hint, so I'll merge this variant.
Thanks for your review!
Kind regards,
Petr