summaryrefslogtreecommitdiffstats
path: root/scripts/automation/trex_control_plane/stl/console/trex_console.py
diff options
context:
space:
mode:
authorimarom <imarom@cisco.com>2016-03-02 16:01:08 +0200
committerimarom <imarom@cisco.com>2016-03-02 16:01:08 +0200
commit26873712908fcfb26ee5310c961846b79f0a8249 (patch)
treea94aa192f9bdf998257b5c6764defa5dce74fcbe /scripts/automation/trex_control_plane/stl/console/trex_console.py
parent9c62e2a6f114d99a7271e259bad2601a28cd9c4a (diff)
port mapping - hardening
Diffstat (limited to 'scripts/automation/trex_control_plane/stl/console/trex_console.py')
-rwxr-xr-xscripts/automation/trex_control_plane/stl/console/trex_console.py20
1 files changed, 14 insertions, 6 deletions
diff --git a/scripts/automation/trex_control_plane/stl/console/trex_console.py b/scripts/automation/trex_control_plane/stl/console/trex_console.py
index ffad03f3..d96a7623 100755
--- a/scripts/automation/trex_control_plane/stl/console/trex_console.py
+++ b/scripts/automation/trex_control_plane/stl/console/trex_console.py
@@ -349,17 +349,25 @@ class TRexConsole(TRexGeneralCmd):
with self.stateless_client.logger.supress():
table = stl_map_ports(self.stateless_client, ports = ports)
- tmp = list(ports)
+
print format_text('\nAcquired ports topology:\n', 'bold', 'underline')
- while tmp:
- a = tmp.pop(0)
- b = table[a]
- tmp.remove(b)
- print "port {0} <--> port {1}".format(a, b)
+ # bi-dir ports
+ print format_text('Bi-directional ports:\n','underline')
+ for port_a, port_b in table['bi']:
+ print "port {0} <--> port {1}".format(port_a, port_b)
+
+ print ""
+ # unknown ports
+ print format_text('Mapping unknown:\n','underline')
+ for port in table['unknown']:
+ print "port {0}".format(port)
print ""
+
+
+
def do_history (self, line):
'''Manage the command history\n'''