summaryrefslogtreecommitdiffstats
path: root/scripts/automation/regression/stateful_tests/trex_general_test.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/automation/regression/stateful_tests/trex_general_test.py')
-rwxr-xr-xscripts/automation/regression/stateful_tests/trex_general_test.py46
1 files changed, 22 insertions, 24 deletions
diff --git a/scripts/automation/regression/stateful_tests/trex_general_test.py b/scripts/automation/regression/stateful_tests/trex_general_test.py
index 62243da7..dda379f9 100755
--- a/scripts/automation/regression/stateful_tests/trex_general_test.py
+++ b/scripts/automation/regression/stateful_tests/trex_general_test.py
@@ -75,6 +75,28 @@ class CTRexGeneral_Test(unittest.TestCase):
if not CTRexScenario.is_init:
if self.trex and not self.no_daemon: # stateful
CTRexScenario.trex_version = self.trex.get_trex_version()
+ #update elk const object
+ if self.elk:
+ timediff = timedelta(hours=2) # workaround to get IL timezone
+ date_str = CTRexScenario.trex_version['Date'].strip()
+ timestamp = datetime.strptime(date_str, '%b %d %Y , %H:%M:%S') - timediff
+
+ img = CTRexScenario.elk_info['info']['image']
+ img['sha'] = CTRexScenario.trex_version['Git SHA']
+ img['build_time'] = timestamp.strftime("%Y-%m-%d %H:%M:%S")
+ img['version'] = CTRexScenario.trex_version['Version']
+
+ setup = CTRexScenario.elk_info['info']['setup']
+ if self.is_loopback :
+ setup['dut'] = 'loopback'
+ else:
+ setup['dut'] = 'router'
+
+ if self.is_VM:
+ setup['baremetal'] = False
+ setup['hypervisor'] = 'ESXi' #TBD
+ else:
+ setup['baremetal'] = True
if not self.is_loopback:
# initilize the scenario based on received configuration, once per entire testing session
CTRexScenario.router = CPlatform(CTRexScenario.router_cfg['silent_mode'])
@@ -108,30 +130,6 @@ class CTRexGeneral_Test(unittest.TestCase):
if self.modes:
print(termstyle.green('\t!!!\tRunning with modes: %s, not suitable tests will be skipped.\t!!!' % list(self.modes)))
- #update elk const object
- if self.elk:
- timediff = timedelta(hours=2) # workaround to get IL timezone
- date_str = CTRexScenario.trex_version['Date'].strip()
- timestamp = datetime.strptime(date_str, '%b %d %Y , %H:%M:%S') - timediff
-
- img = CTRexScenario.elk_info['info']['image']
- img['sha'] = CTRexScenario.trex_version['Git SHA']
- img['build_time'] = timestamp.strftime("%Y-%m-%d %H:%M:%S")
- img['version'] = CTRexScenario.trex_version['Version']
-
- setup = CTRexScenario.elk_info['info']['setup']
- if self.is_loopback :
- setup['dut'] = 'loopback'
- else:
- setup['dut'] = 'router'
-
- if self.is_VM:
- setup['baremetal'] = False
- setup['hypervisor'] = 'ESXi' #TBD
- else:
- setup['baremetal'] = True
-
-
CTRexScenario.is_init = True
print(termstyle.green("Done instantiating TRex scenario!\n"))