summaryrefslogtreecommitdiffstats
path: root/scripts/automation/regression
diff options
context:
space:
mode:
authorYaroslav Brustinov <ybrustin@cisco.com>2017-01-31 22:34:28 +0200
committerYaroslav Brustinov <ybrustin@cisco.com>2017-01-31 22:34:28 +0200
commit217607658e55c3622ea4702066b4327bebc38e30 (patch)
treeebf74c0672f4364e00db5415d8af1a6651d0a05c /scripts/automation/regression
parent8c3c982275c7aa19860e36f3af54c961a9f6e2a3 (diff)
regression fix elk
Change-Id: I9c064305dac5907df0cc6cb15298ebcf0bd1a62a Signed-off-by: Yaroslav Brustinov <ybrustin@cisco.com>
Diffstat (limited to 'scripts/automation/regression')
-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"))