1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2024-10-06 10:51:13 +01:00

Gem5Device: Move resize shell commands to own method

Moved the commands to resize the shell to their own method. They are
now executed twice. Once as soon as the shell is connected, and a
second time as part of initialize. This latter call takes place after
the isntallation of busybox.
This commit is contained in:
Sascha Bischoff 2015-12-08 17:47:34 +00:00
parent 32cf5c0939
commit d98bdac0be
3 changed files with 20 additions and 8 deletions

View File

@ -272,14 +272,7 @@ class BaseGem5Device(object):
self.sckt.setecho(False) self.sckt.setecho(False)
self.sync_gem5_shell() self.sync_gem5_shell()
self.resize_shell()
# Try and avoid line wrapping as much as possible. Don't check the error
# codes from these command because some of them WILL fail.
self.gem5_shell('stty columns 1024', check_exit_code=False)
self.gem5_shell('{} stty columns 1024'.format(self.busybox), check_exit_code=False)
self.gem5_shell('stty cols 1024', check_exit_code=False)
self.gem5_shell('{} stty cols 1024'.format(self.busybox), check_exit_code=False)
self.gem5_shell('reset', check_exit_code=False)
def get_properties(self, context): # pylint: disable=R0801 def get_properties(self, context): # pylint: disable=R0801
""" Get the property files from the device """ """ Get the property files from the device """
@ -622,6 +615,19 @@ class BaseGem5Device(object):
self.sckt.expect([self.sckt.UNIQUE_PROMPT, self.sckt.PROMPT], timeout=self.delay) self.sckt.expect([self.sckt.UNIQUE_PROMPT, self.sckt.PROMPT], timeout=self.delay)
self.sckt.expect([self.sckt.UNIQUE_PROMPT, self.sckt.PROMPT], timeout=self.delay) self.sckt.expect([self.sckt.UNIQUE_PROMPT, self.sckt.PROMPT], timeout=self.delay)
def resize_shell(self):
"""
Resize the shell to avoid line wrapping issues.
"""
# Try and avoid line wrapping as much as possible. Don't check the error
# codes from these command because some of them WILL fail.
self.gem5_shell('stty columns 1024', check_exit_code=False)
self.gem5_shell('{} stty columns 1024'.format(self.busybox), check_exit_code=False)
self.gem5_shell('stty cols 1024', check_exit_code=False)
self.gem5_shell('{} stty cols 1024'.format(self.busybox), check_exit_code=False)
self.gem5_shell('reset', check_exit_code=False)
def move_to_temp_dir(self, source): def move_to_temp_dir(self, source):
""" """
Move a file to the temporary directory on the host for copying to the Move a file to the temporary directory on the host for copying to the

View File

@ -204,3 +204,6 @@ class Gem5AndroidDevice(BaseGem5Device, AndroidDevice):
# If we didn't manage to do the above, call the parent class. # If we didn't manage to do the above, call the parent class.
self.logger.warning("capture_screen: falling back to parent class implementation") self.logger.warning("capture_screen: falling back to parent class implementation")
AndroidDevice.capture_screen(self, filepath) AndroidDevice.capture_screen(self, filepath)
def initialize(self, context):
self.resize_shell()

View File

@ -108,3 +108,6 @@ class Gem5LinuxDevice(BaseGem5Device, LinuxDevice):
# If we didn't manage to do the above, call the parent class. # If we didn't manage to do the above, call the parent class.
self.logger.warning("capture_screen: falling back to parent class implementation") self.logger.warning("capture_screen: falling back to parent class implementation")
LinuxDevice.capture_screen(self, filepath) LinuxDevice.capture_screen(self, filepath)
def initialize(self, context):
self.resize_shell()