summaryrefslogtreecommitdiffstats
path: root/scripts/automation/regression
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/automation/regression')
-rwxr-xr-xscripts/automation/regression/stateful_tests/trex_general_test.py11
-rwxr-xr-xscripts/automation/regression/trex_unit_test.py11
2 files changed, 15 insertions, 7 deletions
diff --git a/scripts/automation/regression/stateful_tests/trex_general_test.py b/scripts/automation/regression/stateful_tests/trex_general_test.py
index 38e97597..33b954fc 100755
--- a/scripts/automation/regression/stateful_tests/trex_general_test.py
+++ b/scripts/automation/regression/stateful_tests/trex_general_test.py
@@ -274,9 +274,16 @@ class CTRexGeneral_Test(unittest.TestCase):
# raise
def unzip_client_package(self):
+ client_pkg_files = glob('%s/trex_client*.tar.gz' % CTRexScenario.scripts_path)
+ if not len(client_pkg_files):
+ raise Exception('Could not find client package')
+ if len(client_pkg_files) > 1:
+ raise Exception('Found more than one client packages')
if not os.path.exists('%s/trex_client' % CTRexScenario.scripts_path):
print('\nUnzipping package')
- CTRexScenario.trex.master_daemon.unpack_client()
+ return_code, _, stderr = misc_methods.run_command("tar -xzf %s -C %s" % (client_pkg_files[0], CTRexScenario.scripts_path))
+ if return_code:
+ raise Exception('Could not untar the client package: %s' % stderr)
else:
print('\nClient package is untarred')
@@ -304,7 +311,7 @@ class CTRexGeneral_Test(unittest.TestCase):
self.trex.force_kill(confirm = False)
if not self.is_loopback:
print('')
- if self.trex: # stateful
+ if not self.stl_trex: # stateful
self.router.load_clean_config()
self.router.clear_counters()
self.router.clear_packet_drop_stats()
diff --git a/scripts/automation/regression/trex_unit_test.py b/scripts/automation/regression/trex_unit_test.py
index d15762bf..f2cf38cb 100755
--- a/scripts/automation/regression/trex_unit_test.py
+++ b/scripts/automation/regression/trex_unit_test.py
@@ -166,6 +166,10 @@ class CTRexTestConfiguringPlugin(Plugin):
CTRexScenario.server_logs = self.server_logs
CTRexScenario.trex = CTRexClient(trex_host = self.configuration.trex['trex_name'],
verbose = self.json_verbose)
+ if not CTRexScenario.trex.check_master_connectivity():
+ print('Could not connect to master daemon')
+ sys.exit(-1)
+ CTRexScenario.scripts_path = CTRexScenario.trex.get_trex_path()
if options.ga and CTRexScenario.setup_name:
CTRexScenario.GAManager = GAmanager(GoogleID = 'UA-75220362-4',
UserID = CTRexScenario.setup_name,
@@ -179,24 +183,21 @@ class CTRexTestConfiguringPlugin(Plugin):
def begin (self):
if self.pkg and self.kill_running and not CTRexScenario.is_copied:
- if not CTRexScenario.trex.check_master_connectivity():
- print('Could not connect to master daemon')
- sys.exit(-1)
print('Updating TRex to %s' % self.pkg)
if not CTRexScenario.trex.master_daemon.update_trex(self.pkg):
print('Failed updating TRex')
sys.exit(-1)
else:
print('Updated')
- CTRexScenario.scripts_path = '/tmp/trex-scripts'
CTRexScenario.is_copied = True
if self.functional or self.collect_only:
return
+ print('Restarting TRex daemon server')
res = CTRexScenario.trex.restart_trex_daemon()
if not res:
print('Could not restart TRex daemon server')
sys.exit(-1)
- # launch TRex daemon on relevant setup
+
trex_cmds = CTRexScenario.trex.get_trex_cmds()
if trex_cmds:
if self.kill_running: