diff options
Diffstat (limited to 'scripts/automation')
-rwxr-xr-x | scripts/automation/trex_control_plane/stl/console/trex_console.py | 21 |
1 files changed, 21 insertions, 0 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 53817464..ffad03f3 100755 --- a/scripts/automation/trex_control_plane/stl/console/trex_console.py +++ b/scripts/automation/trex_control_plane/stl/console/trex_console.py @@ -339,6 +339,27 @@ class TRexConsole(TRexGeneralCmd): def help_portattr (self): return self.do_portattr("-h") + @verify_connected + def do_map (self, line): + '''Maps ports topology\n''' + ports = self.stateless_client.get_acquired_ports() + if not ports: + print "No ports acquired\n" + + 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) + + print "" + def do_history (self, line): '''Manage the command history\n''' |