diff options
author | ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp> | 2016-04-26 09:45:14 +0000 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2016-04-26 07:10:38 +0900 |
commit | fb6e00045726d606d24385a6f5c23c7f2048b0a0 (patch) | |
tree | 52fc75df7934a0a43bea588a30980404e2e38053 /test | |
parent | 45050d9b97f3821c6dbdbc98678a62ddfcf81aad (diff) |
test: enable pass multiple commands to vtysh()
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'test')
-rw-r--r-- | test/lib/quagga.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/test/lib/quagga.py b/test/lib/quagga.py index ce53a29b..4dd42d76 100644 --- a/test/lib/quagga.py +++ b/test/lib/quagga.py @@ -228,10 +228,13 @@ class QuaggaBGPContainer(BGPContainer): f.writelines(str(c)) def vtysh(self, cmd, config=True): + if type(cmd) is not list: + cmd = [cmd] + cmd = ' '.join("-c '{0}'".format(c) for c in cmd) if config: - return self.local("vtysh -d bgpd -c 'en' -c 'conf t' -c 'router bgp {0}' -c '{1}'".format(self.asn, cmd), capture=True) + return self.local("vtysh -d bgpd -c 'en' -c 'conf t' -c 'router bgp {0}' {1}".format(self.asn, cmd), capture=True) else: - return self.local("vtysh -d bgpd -c '{0}'".format(cmd), capture=True) + return self.local("vtysh -d bgpd {0}".format(cmd), capture=True) def reload_config(self): daemon = [] |