summaryrefslogtreecommitdiffhomepage
path: root/test/lib/bird.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/lib/bird.py')
-rw-r--r--test/lib/bird.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/test/lib/bird.py b/test/lib/bird.py
index 8077760f..1207e335 100644
--- a/test/lib/bird.py
+++ b/test/lib/bird.py
@@ -25,6 +25,7 @@ from lib.base import (
BGPContainer,
CmdBuffer,
try_several_times,
+ wait_for_completion,
)
@@ -48,6 +49,13 @@ class BirdContainer(BGPContainer):
local(cmd)
self.local('{0}/start.sh'.format(self.SHARED_VOLUME))
+ def _wait_for_boot(self):
+ def _f():
+ ret = self.local('birdc show status > /dev/null 2>&1; echo $?', capture=True)
+ return ret == '0'
+
+ return wait_for_completion(_f)
+
def run(self):
super(BirdContainer, self).run()
self.reload_config()
@@ -81,13 +89,16 @@ class BirdContainer(BGPContainer):
if 'bird' in line:
running = True
return running
+
if _is_running():
self.local('birdc configure')
else:
self._start_bird()
- time.sleep(1)
+
+ self._wait_for_boot()
if not _is_running():
raise RuntimeError()
+
try_several_times(_reload)