diff options
author | ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp> | 2015-08-22 16:52:44 +0900 |
---|---|---|
committer | ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp> | 2015-08-22 17:48:57 +0900 |
commit | cbd731658749acad58759e4f7fe0849d5111a3b3 (patch) | |
tree | 4f1adbde54786b3d198c6472eb4ec3f386a55052 /test/scenario_test/lib | |
parent | ae1222b0a21201abaca26158ab63732d943c225d (diff) |
test: add a method BGPContainer.log() to get log of bgp speakers
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'test/scenario_test/lib')
-rw-r--r-- | test/scenario_test/lib/base.py | 4 | ||||
-rw-r--r-- | test/scenario_test/lib/quagga.py | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/test/scenario_test/lib/base.py b/test/scenario_test/lib/base.py index 5767fd17..d8ab74d5 100644 --- a/test/scenario_test/lib/base.py +++ b/test/scenario_test/lib/base.py @@ -211,6 +211,7 @@ class BGPContainer(Container): self.config_dir = '/'.join((TEST_BASE_DIR, TEST_PREFIX, name)) local('if [ -e {0} ]; then rm -r {0}; fi'.format(self.config_dir)) local('mkdir -p {0}'.format(self.config_dir)) + local('chmod 777 {0}'.format(self.config_dir)) self.asn = asn self.router_id = router_id self.peers = {} @@ -266,6 +267,9 @@ class BGPContainer(Container): def enable_peer(self, peer): raise Exception('implement enable_peer() method') + def log(self): + return local('cat {0}/*.log'.format(self.config_dir), capture=True) + def add_route(self, route, rf='ipv4', attribute=None, aspath=None, community=None, med=None, extendedcommunity=None, matchs=None, thens=None): diff --git a/test/scenario_test/lib/quagga.py b/test/scenario_test/lib/quagga.py index 8f2ba9a2..8d3e0612 100644 --- a/test/scenario_test/lib/quagga.py +++ b/test/scenario_test/lib/quagga.py @@ -198,7 +198,7 @@ class QuaggaBGPContainer(BGPContainer): c << 'debug bgp fsm' c << 'debug bgp updates' c << 'debug bgp events' - c << 'log file /tmp/bgpd.log'.format(self.SHARED_VOLUME) + c << 'log file {0}/bgpd.log'.format(self.SHARED_VOLUME) with open('{0}/bgpd.conf'.format(self.config_dir), 'w') as f: print colors.yellow('[{0}\'s new config]'.format(self.name)) |