File tree 1 file changed +13
-0
lines changed
1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change 14
14
import threading
15
15
16
16
import pytest
17
+ from lib .common_config import retry
17
18
from lib .topogen import Topogen
18
19
from lib .topotest import json_cmp
19
20
@@ -40,12 +41,20 @@ def tgen(request):
40
41
tgen .stop_topology ()
41
42
42
43
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
+
43
51
def test_backend_rpc (tgen ):
44
52
if tgen .routers_have_failure ():
45
53
pytest .skip (tgen .errors )
46
54
47
55
r1 = tgen .gears ["r1" ]
48
56
57
+ # Run the backend test client which registers to handle the `clear ip rip` command.
49
58
be_client_path = "/usr/lib/frr/mgmtd_testc"
50
59
rc , _ , _ = r1 .net .cmd_status (be_client_path + " --help" )
51
60
@@ -63,6 +72,10 @@ def run_testc():
63
72
t = threading .Thread (target = run_testc )
64
73
t .start ()
65
74
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
+
66
79
r1 .vtysh_cmd ("clear ip rip vrf testname" )
67
80
68
81
t .join ()
You can’t perform that action at this time.
0 commit comments