summaryrefslogtreecommitdiffhomepage
path: root/test/lib/quagga.py
diff options
context:
space:
mode:
authorISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>2016-04-26 09:45:14 +0000
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2016-04-26 07:10:38 +0900
commitfb6e00045726d606d24385a6f5c23c7f2048b0a0 (patch)
tree52fc75df7934a0a43bea588a30980404e2e38053 /test/lib/quagga.py
parent45050d9b97f3821c6dbdbc98678a62ddfcf81aad (diff)
test: enable pass multiple commands to vtysh()
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'test/lib/quagga.py')
-rw-r--r--test/lib/quagga.py7
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 = []