summaryrefslogtreecommitdiffstats
path: root/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_port.py
diff options
context:
space:
mode:
authorimarom <imarom@cisco.com>2016-02-28 04:30:11 -0500
committerimarom <imarom@cisco.com>2016-02-28 04:30:58 -0500
commit5f17c48a1f6f7006cbb6e1b17eca2ebd6b682b78 (patch)
treed1af472bbc92962e6cf4757cf7da09bcd73edf82 /scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_port.py
parent2f42eda77b027f5c9d39cba48373d75c0e1e2155 (diff)
support for mac addr query
Diffstat (limited to 'scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_port.py')
-rw-r--r--scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_port.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_port.py b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_port.py
index ef454b8c..f2d4cd95 100644
--- a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_port.py
+++ b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_port.py
@@ -41,7 +41,7 @@ class Port(object):
STATE_PAUSE: "PAUSE"}
- def __init__ (self, port_id, speed, driver, user, comm_link, session_id):
+ def __init__ (self, port_id, speed, driver, macaddr, user, comm_link, session_id):
self.port_id = port_id
self.state = self.STATE_IDLE
self.handler = None
@@ -51,6 +51,7 @@ class Port(object):
self.user = user
self.driver = driver
self.speed = speed
+ self.macaddr = macaddr
self.streams = {}
self.profile = None
self.session_id = session_id
@@ -520,9 +521,10 @@ class Port(object):
# generate port info
def get_info (self):
info = {}
- info['speed'] = self.speed
- info['driver'] = self.driver
- info['status'] = self.get_port_state_name()
+ info['speed'] = self.speed
+ info['driver'] = self.driver
+ info['status'] = self.get_port_state_name()
+ info['macaddr'] = self.macaddr
if self.attr.get('promiscuous'):
info['prom'] = "on" if self.attr['promiscuous']['enabled'] else "off"
@@ -544,6 +546,7 @@ class Port(object):
info = self.get_info()
return {"type": info['driver'],
+ "macaddr": info['macaddr'],
"maximum": "{speed} Gb/s".format(speed=info['speed']),
"status": info['status'],
"promiscuous" : info['prom']