1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-07-13 02:23:38 +01:00

Merge pull request from ep1cman/fixes

LinuxDevice: Added as_root to kick_off
This commit is contained in:
setrofim
2016-02-12 09:55:36 +00:00

@ -720,7 +720,7 @@ class LinuxDevice(BaseLinuxDevice):
except CalledProcessError as e: except CalledProcessError as e:
raise DeviceError(e) raise DeviceError(e)
def kick_off(self, command): def kick_off(self, command, as_root=False):
""" """
Like execute but closes adb session and returns immediately, leaving the command running on the Like execute but closes adb session and returns immediately, leaving the command running on the
device (this is different from execute(background=True) which keeps adb connection open and returns device (this is different from execute(background=True) which keeps adb connection open and returns
@ -729,7 +729,7 @@ class LinuxDevice(BaseLinuxDevice):
""" """
self._check_ready() self._check_ready()
command = 'sh -c "{}" 1>/dev/null 2>/dev/null &'.format(escape_double_quotes(command)) command = 'sh -c "{}" 1>/dev/null 2>/dev/null &'.format(escape_double_quotes(command))
return self.shell.execute(command) return self.shell.execute(command, as_root=as_root)
def get_pids_of(self, process_name): def get_pids_of(self, process_name):
"""Returns a list of PIDs of all processes with the specified name.""" """Returns a list of PIDs of all processes with the specified name."""