summaryrefslogtreecommitdiffstats
path: root/scripts/automation/trex_control_plane/console
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/automation/trex_control_plane/console')
-rwxr-xr-xscripts/automation/trex_control_plane/console/parsing_opts.py4
-rwxr-xr-xscripts/automation/trex_control_plane/console/trex_console.py25
2 files changed, 9 insertions, 20 deletions
diff --git a/scripts/automation/trex_control_plane/console/parsing_opts.py b/scripts/automation/trex_control_plane/console/parsing_opts.py
index 252d33bf..0e11df74 100755
--- a/scripts/automation/trex_control_plane/console/parsing_opts.py
+++ b/scripts/automation/trex_control_plane/console/parsing_opts.py
@@ -139,8 +139,8 @@ class CCmdArgParser(argparse.ArgumentParser):
opts.ports = self.stateless_client.get_port_ids()
for port in opts.ports:
- if not self.stateless_client.validate_port_list(port):
- self.error("port id {0} is not a valid port id\n".format(port))
+ if not self.stateless_client.validate_port_list([port]):
+ self.error("port id '{0}' is not a valid port id\n".format(port))
return opts
diff --git a/scripts/automation/trex_control_plane/console/trex_console.py b/scripts/automation/trex_control_plane/console/trex_console.py
index 5ba82dcb..bd79479d 100755
--- a/scripts/automation/trex_control_plane/console/trex_console.py
+++ b/scripts/automation/trex_control_plane/console/trex_console.py
@@ -195,12 +195,8 @@ class TRexConsole(cmd.Cmd):
def do_ping (self, line):
'''Ping the server\n'''
- rc = self.stateless_client.ping()
- if rc.good():
- print format_text("[SUCCESS]\n", 'green', 'bold')
- else:
- print "\n*** " + rc.err() + "\n"
- print format_text("[FAILED]\n", 'red', 'bold')
+ rc = self.stateless_client.cmd_ping()
+ if rc.bad():
return
def do_test (self, line):
@@ -230,25 +226,18 @@ class TRexConsole(cmd.Cmd):
def do_connect (self, line):
'''Connects to the server\n'''
- rc = self.stateless_client.connect()
- if rc.good():
- print format_text("[SUCCESS]\n", 'green', 'bold')
- else:
- print "\n*** " + rc.err() + "\n"
- print format_text("[FAILED]\n", 'red', 'bold')
+ rc = self.stateless_client.cmd_connect()
+ if rc.bad():
return
def do_disconnect (self, line):
'''Disconnect from the server\n'''
- if not self.stateless_client.is_connected():
- print "Not connected to server\n"
+ rc = self.stateless_client.cmd_disconnect()
+ if rc.bad():
return
- self.stateless_client.disconnect()
- print format_text("[SUCCESS]\n", 'green', 'bold')
-
############### start
@@ -332,7 +321,7 @@ class TRexConsole(cmd.Cmd):
'''Shows a graphical console\n'''
if not self.stateless_client.is_connected():
- print "Not connected to server\n"
+ print format_text("\nNot connected to server\n", 'bold')
return
self.do_verbose('off')