* [LTP] [PATCH 1/1] rpc_lib.sh: Check for running RPC
@ 2022-01-24 6:59 Petr Vorel
2022-01-24 14:26 ` Nikita Yushchenko via ltp
0 siblings, 1 reply; 4+ messages in thread
From: Petr Vorel @ 2022-01-24 6:59 UTC (permalink / raw)
To: ltp; +Cc: NeilBrown, Nikita Yushchenko
instead of just rpcbind/portmap was running.
This should fix problem for some containers where rpcbind has not been
started and calling rpcinfo should do the socket activation.
Reported-by: Nikita Yushchenko <nikita.yushchenko@virtuozzo.com>
Suggested-by: NeilBrown <neilb@suse.de>
Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
Hi all,
Nikita, does it really fix your case? Or there needs to be 2 rpcinfo -p
calls with sleep in between?
Kind regards,
Petr
.../network/rpc/basic_tests/rpc01/rpc01.sh | 2 +-
testcases/network/rpc/basic_tests/rpc_lib.sh | 22 ++++++++++++-------
.../rpc/basic_tests/rpcinfo/rpcinfo01.sh | 2 +-
testcases/network/rpc/rpc-tirpc/rpc_test.sh | 2 +-
4 files changed, 17 insertions(+), 11 deletions(-)
diff --git a/testcases/network/rpc/basic_tests/rpc01/rpc01.sh b/testcases/network/rpc/basic_tests/rpc01/rpc01.sh
index 9ca5daae62..a4989b98f2 100755
--- a/testcases/network/rpc/basic_tests/rpc01/rpc01.sh
+++ b/testcases/network/rpc/basic_tests/rpc01/rpc01.sh
@@ -19,7 +19,7 @@ do_cleanup()
do_setup()
{
- check_portmap_rpcbind
+ check_rpc
tst_res TINFO "start rpc_server"
ROD rpc_server
diff --git a/testcases/network/rpc/basic_tests/rpc_lib.sh b/testcases/network/rpc/basic_tests/rpc_lib.sh
index c7c868709b..477408bcef 100644
--- a/testcases/network/rpc/basic_tests/rpc_lib.sh
+++ b/testcases/network/rpc/basic_tests/rpc_lib.sh
@@ -1,15 +1,21 @@
#!/bin/sh
-# Copyright (c) 2020 Petr Vorel <pvorel@suse.cz>
+# Copyright (c) 2020-2021 Petr Vorel <pvorel@suse.cz>
+TST_NEEDS_CMDS="rpcinfo $TST_NEEDS_CMDS"
. tst_net.sh
-check_portmap_rpcbind()
+check_rpc()
{
- if pgrep portmap > /dev/null; then
- PORTMAPPER="portmap"
- else
- pgrep rpcbind > /dev/null && PORTMAPPER="rpcbind" || \
- tst_brk TCONF "portmap or rpcbind is not running"
+ local services
+
+ tst_res TINFO "check registered RPC with rpcinfo"
+
+ services=$(rpcinfo -p)
+
+ if [ $? -ne 0 ] || ! echo "$services" | grep -q '[0-9]'; then
+ tst_brk TCONF "no RPC services, is rpcbind/portmap running?"
fi
- tst_res TINFO "using $PORTMAPPER"
+
+ tst_res TINFO "registered RPC"
+ echo "$x"
}
diff --git a/testcases/network/rpc/basic_tests/rpcinfo/rpcinfo01.sh b/testcases/network/rpc/basic_tests/rpcinfo/rpcinfo01.sh
index 811f79ef76..ade9711223 100755
--- a/testcases/network/rpc/basic_tests/rpcinfo/rpcinfo01.sh
+++ b/testcases/network/rpc/basic_tests/rpcinfo/rpcinfo01.sh
@@ -11,7 +11,7 @@ TST_NEEDS_CMDS="rpcinfo wc"
do_setup()
{
- check_portmap_rpcbind
+ check_rpc
# Create file with 1 tcp and 1 udp line. Use for variable assignments.
rpcinfo -p $(tst_ipaddr) | grep tcp | sed -n 2p > rpc_out
diff --git a/testcases/network/rpc/rpc-tirpc/rpc_test.sh b/testcases/network/rpc/rpc-tirpc/rpc_test.sh
index 54a689649c..e1d952da81 100755
--- a/testcases/network/rpc/rpc-tirpc/rpc_test.sh
+++ b/testcases/network/rpc/rpc-tirpc/rpc_test.sh
@@ -45,7 +45,7 @@ rpc_parse_args()
setup()
{
- check_portmap_rpcbind
+ check_rpc
if [ -n "$SERVER" ]; then
CLEANER="rpc_cleaner"
--
2.34.1
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [LTP] [PATCH 1/1] rpc_lib.sh: Check for running RPC
2022-01-24 6:59 [LTP] [PATCH 1/1] rpc_lib.sh: Check for running RPC Petr Vorel
@ 2022-01-24 14:26 ` Nikita Yushchenko via ltp
2022-01-24 17:20 ` Petr Vorel
2022-01-24 21:10 ` Petr Vorel
0 siblings, 2 replies; 4+ messages in thread
From: Nikita Yushchenko via ltp @ 2022-01-24 14:26 UTC (permalink / raw)
To: Petr Vorel, ltp; +Cc: NeilBrown
24.01.2022 09:59, Petr Vorel wrote:
> instead of just rpcbind/portmap was running.
>
> This should fix problem for some containers where rpcbind has not been
> started and calling rpcinfo should do the socket activation.
>
> Reported-by: Nikita Yushchenko <nikita.yushchenko@virtuozzo.com>
> Suggested-by: NeilBrown <neilb@suse.de>
> Signed-off-by: Petr Vorel <pvorel@suse.cz>
> ---
> Hi all,
>
> Nikita, does it really fix your case? Or there needs to be 2 rpcinfo -p
> calls with sleep in between?
Yes, it fixes that.
Btw, easy test is:
systemctl stop rpcbind.service
runltp -f net.rpc
After applying your patch, that results in no TCONF from rcp01.sh, because rpcbind.socket is still
there, and systemd restarts rpcbind on request.
Nikita
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [LTP] [PATCH 1/1] rpc_lib.sh: Check for running RPC
2022-01-24 14:26 ` Nikita Yushchenko via ltp
@ 2022-01-24 17:20 ` Petr Vorel
2022-01-24 21:10 ` Petr Vorel
1 sibling, 0 replies; 4+ messages in thread
From: Petr Vorel @ 2022-01-24 17:20 UTC (permalink / raw)
To: Nikita Yushchenko; +Cc: NeilBrown, ltp
Hi Nikita,
> Yes, it fixes that.
> Btw, easy test is:
> systemctl stop rpcbind.service
> runltp -f net.rpc
> After applying your patch, that results in no TCONF from rcp01.sh, because
> rpcbind.socket is still there, and systemd restarts rpcbind on request.
Thanks for verifying it!
Kind regards,
Petr
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [LTP] [PATCH 1/1] rpc_lib.sh: Check for running RPC
2022-01-24 14:26 ` Nikita Yushchenko via ltp
2022-01-24 17:20 ` Petr Vorel
@ 2022-01-24 21:10 ` Petr Vorel
1 sibling, 0 replies; 4+ messages in thread
From: Petr Vorel @ 2022-01-24 21:10 UTC (permalink / raw)
To: Nikita Yushchenko; +Cc: NeilBrown, ltp
> > Nikita, does it really fix your case? Or there needs to be 2 rpcinfo -p
> > calls with sleep in between?
> Yes, it fixes that.
> Btw, easy test is:
> systemctl stop rpcbind.service
> runltp -f net.rpc
> After applying your patch, that results in no TCONF from rcp01.sh, because
> rpcbind.socket is still there, and systemd restarts rpcbind on request.
FYI merged, with fixing $x variable to $services.
Again, thanks both for your work.
Kind regards,
Petr
> Nikita
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-01-24 21:10 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-24 6:59 [LTP] [PATCH 1/1] rpc_lib.sh: Check for running RPC Petr Vorel
2022-01-24 14:26 ` Nikita Yushchenko via ltp
2022-01-24 17:20 ` Petr Vorel
2022-01-24 21:10 ` 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.