summaryrefslogtreecommitdiffstats
path: root/tests/topotests/mgmt_rpc/test_rpc.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel@debian.org>2024-11-17 07:10:47 +0100
committerDaniel Baumann <daniel@debian.org>2024-11-17 07:10:47 +0100
commitd785318c6f0fc8ee4b0e92eed928d0fcd5debc0c (patch)
tree9656d5d79eba42e52e7e6e208f8f8ab39b63c756 /tests/topotests/mgmt_rpc/test_rpc.py
parentAdding upstream version 10.1.1. (diff)
downloadfrr-upstream/10.2.tar.xz
frr-upstream/10.2.zip
Adding upstream version 10.2.upstream/10.2
Signed-off-by: Daniel Baumann <daniel@debian.org>
Diffstat (limited to 'tests/topotests/mgmt_rpc/test_rpc.py')
-rw-r--r--tests/topotests/mgmt_rpc/test_rpc.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/tests/topotests/mgmt_rpc/test_rpc.py b/tests/topotests/mgmt_rpc/test_rpc.py
index 618d9022..4d073fd0 100644
--- a/tests/topotests/mgmt_rpc/test_rpc.py
+++ b/tests/topotests/mgmt_rpc/test_rpc.py
@@ -14,6 +14,7 @@ import os
import threading
import pytest
+from lib.common_config import retry
from lib.topogen import Topogen
from lib.topotest import json_cmp
@@ -32,7 +33,7 @@ def tgen(request):
tgen.start_topology()
router_list = tgen.routers()
- for rname, router in router_list.items():
+ for _, router in router_list.items():
router.load_frr_config("frr.conf")
tgen.start_router()
@@ -40,12 +41,20 @@ def tgen(request):
tgen.stop_topology()
+# Verify the backend test client has connected
+@retry(retry_timeout=10)
+def check_client_connect(r1):
+ out = r1.vtysh_cmd("show mgmt backend-adapter all")
+ assert "mgmtd-testc" in out
+
+
def test_backend_rpc(tgen):
if tgen.routers_have_failure():
pytest.skip(tgen.errors)
r1 = tgen.gears["r1"]
+ # Run the backend test client which registers to handle the `clear ip rip` command.
be_client_path = "/usr/lib/frr/mgmtd_testc"
rc, _, _ = r1.net.cmd_status(be_client_path + " --help")
@@ -63,6 +72,10 @@ def test_backend_rpc(tgen):
t = threading.Thread(target=run_testc)
t.start()
+ # We need to wait for mgmtd_testc to connect before issuing the command.
+ res = check_client_connect(r1)
+ assert res is None
+
r1.vtysh_cmd("clear ip rip vrf testname")
t.join()