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.py30
1 files changed, 12 insertions, 18 deletions
diff --git a/scripts/automation/regression/trex_unit_test.py b/scripts/automation/regression/trex_unit_test.py
index 7c2e317b..7a6c4260 100755
--- a/scripts/automation/regression/trex_unit_test.py
+++ b/scripts/automation/regression/trex_unit_test.py
@@ -39,7 +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
+from trex_stl_lib.utils.GAObjClass import GAmanager_Regression
import trex
import socket
from pprint import pprint
@@ -186,6 +186,8 @@ class CTRexTestConfiguringPlugin(Plugin):
options.config_path = CTRexScenario.setup_dir
if not options.config_path:
raise Exception('Please specify path to config.yaml using --cfg parameter or env. variable SETUP_DIR')
+ options.config_path = options.config_path.rstrip('/')
+ CTRexScenario.setup_name = os.path.basename(options.config_path)
self.configuration = misc_methods.load_complete_config_file(os.path.join(options.config_path, 'config.yaml'))
self.configuration.trex['trex_name'] = address_to_ip(self.configuration.trex['trex_name']) # translate hostname to ip
self.benchmark = misc_methods.load_benchmark_config_file(os.path.join(options.config_path, 'benchmark.yaml'))
@@ -204,6 +206,7 @@ class CTRexTestConfiguringPlugin(Plugin):
CTRexScenario.modes = set(self.modes)
CTRexScenario.server_logs = self.server_logs
CTRexScenario.debug_image = options.debug_image
+ CTRexScenario.json_verbose = self.json_verbose
if not self.no_daemon:
CTRexScenario.trex = CTRexClient(trex_host = self.configuration.trex['trex_name'],
verbose = self.json_verbose,
@@ -213,14 +216,14 @@ class CTRexTestConfiguringPlugin(Plugin):
print('Could not connect to master daemon')
sys.exit(-1)
if options.ga and CTRexScenario.setup_name:
- CTRexScenario.GAManager = GAmanager(GoogleID = 'UA-75220362-4',
- UserID = CTRexScenario.setup_name,
- QueueSize = 100,
- Timeout = 5, # seconds
- UserPermission = 1,
- BlockingMode = 1,
- appName = 'TRex',
- appVer = '1.11.232')
+ CTRexScenario.GAManager = GAmanager_Regression(GoogleID = 'UA-75220362-3',
+ AnalyticsUserID = CTRexScenario.setup_name,
+ QueueSize = 100,
+ Timeout = 3, # seconds
+ UserPermission = 1,
+ BlockingMode = 0,
+ appName = 'TRex',
+ appVer = CTRexScenario.trex_version)
def begin (self):
@@ -253,15 +256,6 @@ class CTRexTestConfiguringPlugin(Plugin):
print('TRex is already running')
sys.exit(-1)
- if self.stateless:
- cores = self.configuration.trex.get('trex_cores', 1)
- if 'virt_nics' in self.modes and cores > 1:
- raise Exception('Number of cores should be 1 with virtual NICs')
- if not self.no_daemon:
- client.start_stateless(c = cores)
- CTRexScenario.stl_trex = STLClient(username = 'TRexRegression',
- server = self.configuration.trex['trex_name'],
- verbose_level = self.json_verbose)
if 'loopback' not in self.modes:
CTRexScenario.router_cfg = dict(config_dict = self.configuration.router,
forceImageReload = self.load_image,