summaryrefslogtreecommitdiffstats
path: root/scripts/automation/regression/trex_unit_test.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/automation/regression/trex_unit_test.py')
-rwxr-xr-xscripts/automation/regression/trex_unit_test.py33
1 files changed, 21 insertions, 12 deletions
diff --git a/scripts/automation/regression/trex_unit_test.py b/scripts/automation/regression/trex_unit_test.py
index 5d29ff31..b9f0c05c 100755
--- a/scripts/automation/regression/trex_unit_test.py
+++ b/scripts/automation/regression/trex_unit_test.py
@@ -39,6 +39,7 @@ from trex import CTRexScenario
from trex_stf_lib.trex_client import *
from trex_stf_lib.trex_exceptions import *
from trex_stl_lib.api import *
+from trex_stl_lib.utils.GAObjClass import GAmanager
import trex
import socket
from pprint import pprint
@@ -117,9 +118,12 @@ class CTRexTestConfiguringPlugin(Plugin):
parser.add_option('--log-path', '--log_path', action='store',
dest='log_path',
help='Specify path for the tests` log to be saved at. Once applied, logs capturing by nose will be disabled.') # Default is CURRENT/WORKING/PATH/trex_log/trex_log.log')
- parser.add_option('--verbose-mode', '--verbose_mode', action="store_true", default = False,
- dest="verbose_mode",
- help="Print RPC command and router commands.")
+ parser.add_option('--json-verbose', '--json_verbose', action="store_true", default = False,
+ dest="json_verbose",
+ help="Print JSON-RPC commands.")
+ parser.add_option('--telnet-verbose', '--telnet_verbose', action="store_true", default = False,
+ dest="telnet_verbose",
+ help="Print telnet commands and responces.")
parser.add_option('--server-logs', '--server_logs', action="store_true", default = False,
dest="server_logs",
help="Print server side (TRex and trex_daemon) logs per test.")
@@ -150,17 +154,21 @@ class CTRexTestConfiguringPlugin(Plugin):
parser.add_option('--test-client-package', '--test_client_package', action="store_true", default = False,
dest="test_client_package",
help="Includes tests of client package.")
+ parser.add_option('--long', action="store_true", default = False,
+ dest="long",
+ help="Flag of long tests (stability).")
def configure(self, options, conf):
self.collect_only = options.collect_only
if self.collect_only:
return
- self.functional = options.functional
- self.stateless = options.stateless
- self.stateful = options.stateful
- self.pkg = options.pkg
- self.no_ssh = options.no_ssh
- self.verbose_mode = options.verbose_mode
+ self.functional = options.functional
+ self.stateless = options.stateless
+ self.stateful = options.stateful
+ self.pkg = options.pkg
+ self.no_ssh = options.no_ssh
+ self.json_verbose = options.json_verbose
+ self.telnet_verbose = options.telnet_verbose
if self.functional and (not self.pkg or self.no_ssh):
return
if CTRexScenario.setup_dir and options.config_path:
@@ -215,7 +223,7 @@ class CTRexTestConfiguringPlugin(Plugin):
if self.stateful:
if not self.no_ssh:
trex_remote_command(self.configuration.trex, STATEFUL_RUN_COMMAND)
- CTRexScenario.trex = CTRexClient(trex_host = self.configuration.trex['trex_name'], verbose = self.verbose_mode)
+ CTRexScenario.trex = CTRexClient(trex_host = self.configuration.trex['trex_name'], verbose = self.json_verbose)
elif self.stateless:
if not self.no_ssh:
cores = self.configuration.trex.get('trex_cores', 1)
@@ -224,11 +232,11 @@ class CTRexTestConfiguringPlugin(Plugin):
trex_remote_command(self.configuration.trex, './t-rex-64 -i -c %s' % cores, background = True)
CTRexScenario.stl_trex = STLClient(username = 'TRexRegression',
server = self.configuration.trex['trex_name'],
- verbose_level = self.verbose_mode)
+ verbose_level = self.json_verbose)
if 'loopback' not in self.modes:
CTRexScenario.router_cfg = dict(config_dict = self.configuration.router,
forceImageReload = self.load_image,
- silent_mode = not self.verbose_mode,
+ silent_mode = not self.telnet_verbose,
forceCleanConfig = self.clean_config,
tftp_config_dict = self.configuration.tftp)
try:
@@ -297,6 +305,7 @@ if __name__ == "__main__":
xml_name = 'unit_test.xml'
if CTRexScenario.setup_dir:
CTRexScenario.setup_name = os.path.basename(CTRexScenario.setup_dir)
+ CTRexScenario.GAManager = GAmanager(GoogleID='UA-75220362-4', UserID=CTRexScenario.setup_name, QueueSize=100, Timeout=5, UserPermission=1, BlockingMode=1, appName='TRex', appVer='1.11.232') #timeout in seconds
xml_name = 'report_%s.xml' % CTRexScenario.setup_name
xml_arg= '--xunit-file=%s/%s' % (CTRexScenario.report_dir, xml_name)
set_report_dir(CTRexScenario.report_dir)