From c376394c69788778a32da16e140369df53cc0f45 Mon Sep 17 00:00:00 2001 From: Yaroslav Brustinov Date: Mon, 16 Jan 2017 02:46:06 +0200 Subject: another fix to elk @ regression Change-Id: I6c97c9e6c9ec9f5b12e586c03daf2b53a540cefc Signed-off-by: Yaroslav Brustinov --- .../regression/stateful_tests/trex_general_test.py | 32 ++++++++++++---------- scripts/automation/regression/trex_unit_test.py | 1 + 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/scripts/automation/regression/stateful_tests/trex_general_test.py b/scripts/automation/regression/stateful_tests/trex_general_test.py index 64f27141..68dde009 100755 --- a/scripts/automation/regression/stateful_tests/trex_general_test.py +++ b/scripts/automation/regression/stateful_tests/trex_general_test.py @@ -71,21 +71,22 @@ class CTRexGeneral_Test(unittest.TestCase): self.is_virt_nics = True if 'virt_nics' in self.modes else False self.is_VM = True if 'VM' in self.modes else False - #update elk const object - setup = CTRexScenario.elk_info['info']['setup'] + if not CTRexScenario.is_init: + #update elk const object + if self.elk: + setup = CTRexScenario.elk_info['info']['setup'] - if self.is_loopback : - setup['dut'] ='loopback' - else: - setup['dut'] ='router' + 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 self.is_VM: + setup['baremetal'] = False + setup['hypervisor'] = 'ESXi' #TBD + else: + setup['baremetal'] = True - if not CTRexScenario.is_init: if self.trex and not self.no_daemon: # stateful CTRexScenario.trex_version = self.trex.get_trex_version() if not self.is_loopback: @@ -97,11 +98,12 @@ class CTRexGeneral_Test(unittest.TestCase): CTRexScenario.router.load_platform_data_from_file(device_cfg) CTRexScenario.router.launch_connection(device_cfg) if CTRexScenario.router_cfg['forceImageReload']: - image_d=CTRexScenario.router.get_running_image_details(); + image_d = CTRexScenario.router.get_running_image_details(); running_image = image_d['image'] - setup['dut'] =image_d.get('model','router'); print('Current router image: %s' % running_image) - print('Current router model : %s' % setup['dut']) + if self.elk: + setup['dut'] = image_d.get('model','router'); + print('Current router model : %s' % setup['dut']) needed_image = device_cfg.get_image_name() if not CTRexScenario.router.is_image_matches(needed_image): print('Setting router image: %s' % needed_image) diff --git a/scripts/automation/regression/trex_unit_test.py b/scripts/automation/regression/trex_unit_test.py index 5bfe8585..c1fc416b 100755 --- a/scripts/automation/regression/trex_unit_test.py +++ b/scripts/automation/regression/trex_unit_test.py @@ -30,6 +30,7 @@ import outer_packages import datetime import nose from nose.plugins import Plugin +from nose.plugins.xunit import escape_cdata from nose.selector import Selector from nose.exc import SkipTest from nose.pyversion import force_unicode, format_exception -- cgit 1.2.3-korg