diff options
author | 2016-03-24 20:00:27 +0200 | |
---|---|---|
committer | 2016-03-24 20:00:27 +0200 | |
commit | 59f00264f39dfb95a62401776b4ed8c433682fa7 (patch) | |
tree | 96b5411f17faed9f62aa9e4722b29d767d502b1b /scripts/automation/regression | |
parent | 4e8ce34a9ef6b8883cfed47f77c9b753e1cf4248 (diff) |
gather stateful client to stf folder, create trex_client package
Diffstat (limited to 'scripts/automation/regression')
-rwxr-xr-x | scripts/automation/regression/CPlatform.py | 15 | ||||
-rwxr-xr-x | scripts/automation/regression/trex_unit_test.py | 4 |
2 files changed, 12 insertions, 7 deletions
diff --git a/scripts/automation/regression/CPlatform.py b/scripts/automation/regression/CPlatform.py index 6741d5c1..da056d23 100755 --- a/scripts/automation/regression/CPlatform.py +++ b/scripts/automation/regression/CPlatform.py @@ -650,7 +650,7 @@ class CPlatform(object): command = "dir {drive}: | include {image}".format(drive = search_drive, image = img_name) response = self.cmd_link.run_single_command(command, timeout = 10) if CShowParser.parse_image_existence(response, img_name): - self.needed_image_path = '%s:%s' % (search_drive, img_name) + self.needed_image_path = '%s:/%s' % (search_drive, img_name) print('Found image in platform:', self.needed_image_path) return True return False @@ -734,8 +734,10 @@ class CPlatform(object): boot_img_cmd = "boot system flash %s" % self.needed_image_path config_register_cmd = "config-register 0x2021" - cache.add('CONF', ["no boot system", boot_img_cmd, config_register_cmd]) - self.cmd_link.run_single_command( cache ) + cache.add('CONF', ["no boot system", boot_img_cmd, config_register_cmd, '\r']) + response = self.cmd_link.run_single_command( cache ) + print("RESPONSE:") + print(response) self.save_config_to_startup_config() def is_image_matches(self, needed_image): @@ -777,7 +779,9 @@ class CPlatform(object): Copies running-config into startup-config. """ - self.cmd_link.run_single_command('wr') + cache = CCommandCache() + cache.add('EXEC', ['wr', '\r'] ) + self.cmd_link.run_single_command(cache) def reload_platform(self, device_cfg_obj): """ reload_platform(self) -> None @@ -814,8 +818,9 @@ class CPlatform(object): time.sleep(30) self.reload_connection(device_cfg_obj) - finally: progress_thread.join() + except Exception as e: + print e def get_if_manager(self): return self.if_mngr diff --git a/scripts/automation/regression/trex_unit_test.py b/scripts/automation/regression/trex_unit_test.py index 4348d004..fb666382 100755 --- a/scripts/automation/regression/trex_unit_test.py +++ b/scripts/automation/regression/trex_unit_test.py @@ -36,8 +36,8 @@ import misc_methods from rednose import RedNose import termstyle from trex import CTRexScenario -from client.trex_client import * -from common.trex_exceptions import * +from stf.trex_client import * +from stf.trex_exceptions import * from trex_stl_lib.api import * import trex import socket |