summaryrefslogtreecommitdiffstats
path: root/extras/vpp_config/vpplib/VPPUtil.py
diff options
context:
space:
mode:
authorJohn DeNisco <jdenisco@cisco.com>2018-02-06 15:23:05 -0500
committerDamjan Marion <dmarion.lists@gmail.com>2018-02-16 08:09:27 +0000
commit9fa5cf46690601e4e25605d548671c84634363e3 (patch)
tree83f5066290114e58341b93ca614c7e22b610f063 /extras/vpp_config/vpplib/VPPUtil.py
parent56a0d06cb410b669eddf1533f22ec3afedb4b242 (diff)
Add iperf VM/vhost creation
Change-Id: I27a59203f406120558f73bfcc12dca8835ae6361 Signed-off-by: John DeNisco <jdenisco@cisco.com>
Diffstat (limited to 'extras/vpp_config/vpplib/VPPUtil.py')
-rw-r--r--extras/vpp_config/vpplib/VPPUtil.py15
1 files changed, 13 insertions, 2 deletions
diff --git a/extras/vpp_config/vpplib/VPPUtil.py b/extras/vpp_config/vpplib/VPPUtil.py
index 4ea94135b49..07d65b0d538 100644
--- a/extras/vpp_config/vpplib/VPPUtil.py
+++ b/extras/vpp_config/vpplib/VPPUtil.py
@@ -753,8 +753,10 @@ class VPPUtil(object):
:param node: VPP node.
:type node: dict
+ :returns: A list of interfaces
"""
+ ifaces = []
cmd = 'vppctl show bridge'
(ret, stdout, stderr) = VPPUtil.exec_command(cmd)
if ret != 0:
@@ -766,7 +768,7 @@ class VPPUtil(object):
for line in lines:
if line == 'no bridge-domains in use':
print line
- return
+ return ifaces
if len(line) == 0:
continue
@@ -781,4 +783,13 @@ class VPPUtil(object):
raise RuntimeError('{} failed on node {} {} {}'.
format(cmd, node['host'],
stdout, stderr))
- print stdout
+
+ lines = stdout.split('\r\n')
+ for line in lines:
+ iface = re.findall(r'[a-zA-z]+\d+/\d+/\d+', line)
+ if len(iface):
+ ifcidx ={'name': iface[0], 'index': line.split()[1] }
+ ifaces.append(ifcidx)
+
+ print stdout
+ return ifaces \ No newline at end of file