From 90bc5ac1e03c4c99e417e65dca4bcfcd7374757a Mon Sep 17 00:00:00 2001 From: Yan Wang Date: Fri, 28 Jun 2019 14:56:41 -0700 Subject: 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 --- startop/scripts/lib/cmd_utils.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'startop/scripts/lib/cmd_utils.py') 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) -- cgit v1.2.3