1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-03-22 02:29:10 +00:00

LinuxDevice: Added as_root to kick_off

This commit is contained in:
Sebastian Goscik 2016-02-12 09:54:14 +00:00
parent 08663209d6
commit 5203188d9e

View File

@ -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."""