[LTP] [PATCH 1/1] rpc_test.sh: Check for rpcbind remote calls support

Petr Vorel pvorel@suse.cz
Fri Aug 8 09:38:14 CEST 2025


> On Mon, Aug 04, 2025 at 08:48:50PM +0200, Petr Vorel wrote:
> > client binaries rpc_pmap_rmtcall and tirpc_rpcb_rmtcall require rpcbind
> > compiled with remote calls.  rpcbind has disabled remote calls by
> > default in 1.2.5. But this was not detectable until 1.2.8, which brought
> > this info in -v flag.

> > Detect the support and skip on these 2 functions when disabled.

> > Signed-off-by: Petr Vorel <pvorel@suse.cz>
> > ---
> > Hi,

> >  testcases/network/rpc/rpc-tirpc/rpc_test.sh | 5 +++++
> >  1 file changed, 5 insertions(+)

> > diff --git a/testcases/network/rpc/rpc-tirpc/rpc_test.sh b/testcases/network/rpc/rpc-tirpc/rpc_test.sh
> > index cadae55203..1a8cf46399 100755
> > --- a/testcases/network/rpc/rpc-tirpc/rpc_test.sh
> > +++ b/testcases/network/rpc/rpc-tirpc/rpc_test.sh
> > @@ -53,6 +53,11 @@ setup()
> >  		fi
> >  	fi

> > +	if [ "$CLIENT" = 'rpc_pmap_rmtcall' -o "$CLIENT" = 'tirpc_rpcb_rmtcall' ] && \
> > +		rpcbind -v 2>/dev/null && rpcbind -v 2>&1 | grep -q 'remote calls: no'; then
> > +		tst_brk TCONF "skip due rpcbind compiled without remote calls"
> > +	fi
> Should we check rpcbind version? Since you mentioned remove call
> detectable until 1.2.8.

We would not get any benefit from it. The check skips tests only when remote
calls are disabled and it's detectable. 'rpcbind -v' is on >= 1.2.8, therefore
'rpcbind -v 2>/dev/null &&' is hidden check for rpcbind >= 1.2.8.

But looking at the code it's confusing and 'rpcbind -v 2>/dev/null && ' is
redundant (as '-v' certainly does not produce wanted output on rpcbind < 1.2.8),
therefore I'll send v2:

-               rpcbind -v 2>/dev/null && rpcbind -v 2>&1 | grep -q 'remote calls: no'; then
+               rpcbind -v 2>&1 | grep -q 'remote calls: no'; then

Kind regards,
Petr



More information about the ltp mailing list