diff options
author | Yan Wang <yawanng@google.com> | 2019-06-28 14:56:41 -0700 |
---|---|---|
committer | Yan Wang <yawanng@google.com> | 2019-07-10 16:20:51 -0700 |
commit | 90bc5ac1e03c4c99e417e65dca4bcfcd7374757a (patch) | |
tree | 4d31cf44c911142f9462504aab4aa1719ba1c21b /startop/scripts/lib/cmd_utils.py | |
parent | 7cd8b3fd67ee0639cf801441e62bb6bb67d2052a (diff) |
startop: Update to toggle iorapd.readahead.enable.
Test: python run_app_with_prefetch.py -p com.android.settings -a com.android.settings.Settings -r fadvise -i input --debug --simulate
Test: python run_app_with_prefetch.py -p com.android.settings -a com.android.settings.Settings -r fadvise -i input
Test: pytest run_app_with_prefetch_test.py
Bug: 135286022
Change-Id: I4576ebb66bc41124e419681a296a47591f1f3d09
Diffstat (limited to 'startop/scripts/lib/cmd_utils.py')
-rw-r--r-- | startop/scripts/lib/cmd_utils.py | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/startop/scripts/lib/cmd_utils.py b/startop/scripts/lib/cmd_utils.py index c3d96059c91c..bc5ca3140d3d 100644 --- a/startop/scripts/lib/cmd_utils.py +++ b/startop/scripts/lib/cmd_utils.py @@ -44,10 +44,16 @@ def run_shell_func(script_path: str, A tuple of running status (True=succeeded, False=failed or timed out) and std output (string contents of stdout with trailing whitespace removed) . """ - cmd = 'bash -c "source {script_path}; {func} {args}"'.format( - script_path=script_path, - func=func, - args=' '.join("'{}'".format(arg) for arg in args)) + if args: + cmd = 'bash -c "source {script_path}; {func} {args}"'.format( + script_path=script_path, + func=func, + args=' '.join("'{}'".format(arg) for arg in args)) + else: + cmd = 'bash -c "source {script_path}; {func}"'.format( + script_path=script_path, + func=func) + print_utils.debug_print(cmd) return run_shell_command(cmd) |