All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH] rpc_lib.sh: fix portmapper detection in case of socket activation
@ 2022-01-20 14:37 Nikita Yushchenko via ltp
  2022-01-20 21:01   ` [LTP] " Petr Vorel
  2022-01-24 21:11 ` Petr Vorel
  0 siblings, 2 replies; 18+ messages in thread
From: Nikita Yushchenko via ltp @ 2022-01-20 14:37 UTC (permalink / raw)
  To: Petr Vorel; +Cc: kernel, ltp, Nikita Yushchenko

On systemd-based linux hosts, rpcbind service is typically started via
socket activation, when the first client connects. If no client has
connected before LTP rpc test starts, rpcbind process will not be
running at the time of check_portmap_rpcbind() execution, causing
check_portmap_rpcbind() to report TCONF error.

Fix that by adding a quiet invocation of 'rpcinfo' before checking for
rpcbind.

For portmap, similar step is likely not needed, because portmap is used
only on old systemd and those don't use systemd.

Signed-off-by: Nikita Yushchenko <nikita.yushchenko@virtuozzo.com>
---
 testcases/network/rpc/basic_tests/rpc_lib.sh | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/testcases/network/rpc/basic_tests/rpc_lib.sh b/testcases/network/rpc/basic_tests/rpc_lib.sh
index c7c868709..e882e41b3 100644
--- a/testcases/network/rpc/basic_tests/rpc_lib.sh
+++ b/testcases/network/rpc/basic_tests/rpc_lib.sh
@@ -8,6 +8,12 @@ check_portmap_rpcbind()
 	if pgrep portmap > /dev/null; then
 		PORTMAPPER="portmap"
 	else
+		# In case of systemd socket activation, rpcbind could be
+		# not started until somebody tries to connect to it's socket.
+		#
+		# To handle that case properly, run a client now.
+		rpcinfo >/dev/null 2>&1
+
 		pgrep rpcbind > /dev/null && PORTMAPPER="rpcbind" || \
 			tst_brk TCONF "portmap or rpcbind is not running"
 	fi
-- 
2.30.2


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

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

end of thread, other threads:[~2022-01-24 21:11 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-20 14:37 [LTP] [PATCH] rpc_lib.sh: fix portmapper detection in case of socket activation Nikita Yushchenko via ltp
2022-01-20 21:01 ` Petr Vorel
2022-01-20 21:01   ` [LTP] " Petr Vorel
2022-01-21  4:57   ` Nikita Yushchenko
2022-01-21  4:57     ` [LTP] " Nikita Yushchenko via ltp
2022-01-21  5:29     ` Petr Vorel
2022-01-21  5:29       ` [LTP] " Petr Vorel
2022-01-21  5:41       ` Nikita Yushchenko
2022-01-21  5:41         ` [LTP] " Nikita Yushchenko via ltp
2022-01-21  6:30         ` Petr Vorel
2022-01-21  6:30           ` [LTP] " Petr Vorel
2022-01-21  6:50           ` Nikita Yushchenko
2022-01-21  6:50             ` [LTP] " Nikita Yushchenko via ltp
2022-01-21 20:44   ` NeilBrown
2022-01-21 20:44     ` [LTP] " NeilBrown
2022-01-24  6:09     ` Petr Vorel
2022-01-24  6:09       ` [LTP] " Petr Vorel
2022-01-24 21:11 ` 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.