diff options
author | IWASE Yusuke <iwase.yusuke0@gmail.com> | 2018-05-15 08:26:42 +0900 |
---|---|---|
committer | IWASE Yusuke <iwase.yusuke0@gmail.com> | 2018-05-15 09:46:16 +0900 |
commit | 2c388e07576a8ea1d7f661387f5a7ba44bc6f01e (patch) | |
tree | 703a8b4af518e778fb0e28d093410c0657b9d786 /test/lib/gobgp.py | |
parent | 3fc524a5f5d810597757c63c51106819b520680f (diff) |
scenario_test: Wait for GoBGP starting up
For the stability of some scenario tests, this patch fixes to wait for
GoBGP starting up after restarting GoBGP daemon. Currently, there are
cases that CLI command can be called without checking whether GoBGP
daemon is surely started or not.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Diffstat (limited to 'test/lib/gobgp.py')
-rw-r--r-- | test/lib/gobgp.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/test/lib/gobgp.py b/test/lib/gobgp.py index a4d697b1..3c33056b 100644 --- a/test/lib/gobgp.py +++ b/test/lib/gobgp.py @@ -15,6 +15,7 @@ from __future__ import absolute_import +import collections import json from itertools import chain from threading import Thread @@ -27,7 +28,6 @@ from fabric.utils import indent import netaddr import toml import yaml -import collections from lib.base import ( wait_for_completion, @@ -113,6 +113,12 @@ class GoBGPContainer(BGPContainer): local(cmd, capture=True) self.local("{0}/start.sh".format(self.SHARED_VOLUME), detach=True) + def start_gobgp(self, graceful_restart=False): + if self._is_running(): + raise RuntimeError('GoBGP is already running') + self._start_gobgp(graceful_restart=graceful_restart) + self._wait_for_boot() + def stop_gobgp(self): self.local("pkill -INT gobgpd") |