@@ -1960,7 +1960,13 @@ def do_gdb_or_rr(gdb):
1960
1960
)
1961
1961
else :
1962
1962
binary = os .path .join (self .daemondir , daemon )
1963
- check_daemon_files .extend ([runbase + ".pid" , runbase + ".vty" ])
1963
+ if daemon == "zebra" :
1964
+ zapi_base = "/var/run/{}/zserv.api" .format (self .routertype )
1965
+ check_daemon_files .extend (
1966
+ [runbase + ".pid" , runbase + ".vty" , zapi_base ]
1967
+ )
1968
+ else :
1969
+ check_daemon_files .extend ([runbase + ".pid" , runbase + ".vty" ])
1964
1970
1965
1971
cmdenv = "ASAN_OPTIONS="
1966
1972
if asan_abort :
@@ -2244,17 +2250,39 @@ def emacs_gdb_ready():
2244
2250
else :
2245
2251
logger .debug ("%s: %s %s started" , self , self .routertype , daemon )
2246
2252
2253
+ # Check if the daemons are running
2254
+ def _check_daemons_running (check_daemon_files ):
2255
+ wait_time = 30 if (gdb_routers or gdb_daemons ) else 10
2256
+ timeout = Timeout (wait_time )
2257
+ for remaining in timeout :
2258
+ if not check_daemon_files :
2259
+ break
2260
+ check = check_daemon_files [0 ]
2261
+ if self .path_exists (check ):
2262
+ check_daemon_files .pop (0 )
2263
+ continue
2264
+ self .logger .debug (
2265
+ "Waiting {}s for {} to appear" .format (remaining , check )
2266
+ )
2267
+ time .sleep (0.5 )
2268
+
2247
2269
# Start mgmtd first
2248
2270
if "mgmtd" in daemons_list :
2249
2271
start_daemon ("mgmtd" )
2250
2272
while "mgmtd" in daemons_list :
2251
2273
daemons_list .remove ("mgmtd" )
2274
+ # Wait till mgmtd is up and running to some
2275
+ # very small extent before moving on
2276
+ _check_daemons_running (check_daemon_files )
2252
2277
2253
2278
# Start Zebra after mgmtd
2254
2279
if "zebra" in daemons_list :
2255
2280
start_daemon ("zebra" )
2256
2281
while "zebra" in daemons_list :
2257
2282
daemons_list .remove ("zebra" )
2283
+ # Wait till zebra is up and running to some
2284
+ # very small extent before moving on
2285
+ _check_daemons_running (check_daemon_files )
2258
2286
2259
2287
# Start staticd next if required
2260
2288
if "staticd" in daemons_list :
@@ -2290,17 +2318,7 @@ def emacs_gdb_ready():
2290
2318
start_daemon (daemon )
2291
2319
2292
2320
# Check if daemons are running.
2293
- wait_time = 30 if (gdb_routers or gdb_daemons ) else 10
2294
- timeout = Timeout (wait_time )
2295
- for remaining in timeout :
2296
- if not check_daemon_files :
2297
- break
2298
- check = check_daemon_files [0 ]
2299
- if self .path_exists (check ):
2300
- check_daemon_files .pop (0 )
2301
- continue
2302
- self .logger .debug ("Waiting {}s for {} to appear" .format (remaining , check ))
2303
- time .sleep (0.5 )
2321
+ _check_daemons_running (check_daemon_files )
2304
2322
2305
2323
if check_daemon_files :
2306
2324
assert False , "Timeout({}) waiting for {} to appear on {}" .format (
0 commit comments