File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change 1414import threading
1515
1616import pytest
17+ from lib .common_config import retry
1718from lib .topogen import Topogen
1819from lib .topotest import json_cmp
1920
@@ -40,12 +41,20 @@ def tgen(request):
4041 tgen .stop_topology ()
4142
4243
44+ # Verify the backend test client has connected
45+ @retry (retry_timeout = 10 )
46+ def check_client_connect (r1 ):
47+ out = r1 .vtysh_cmd ("show mgmt backend-adapter all" )
48+ assert "mgmtd-testc" in out
49+
50+
4351def test_backend_rpc (tgen ):
4452 if tgen .routers_have_failure ():
4553 pytest .skip (tgen .errors )
4654
4755 r1 = tgen .gears ["r1" ]
4856
57+ # Run the backend test client which registers to handle the `clear ip rip` command.
4958 be_client_path = "/usr/lib/frr/mgmtd_testc"
5059 rc , _ , _ = r1 .net .cmd_status (be_client_path + " --help" )
5160
@@ -63,6 +72,10 @@ def run_testc():
6372 t = threading .Thread (target = run_testc )
6473 t .start ()
6574
75+ # We need to wait for mgmtd_testc to connect before issuing the command.
76+ res = check_client_connect (r1 )
77+ assert res is None
78+
6679 r1 .vtysh_cmd ("clear ip rip vrf testname" )
6780
6881 t .join ()
You can’t perform that action at this time.
0 commit comments