Merge "functional: Check for processes only if there are any"

This commit is contained in:
Jenkins 2017-02-03 00:17:34 +00:00 committed by Gerrit Code Review
commit a292ae544b

View File

@ -64,7 +64,8 @@ class TestGetRootHelperChildPid(functional_base.BaseSudoTestCase):
['pstree', parent_pid], check_exit_code=False)
processes = [command.strip() for command in proc_tree.split('---')
if command]
return 'sleep' == processes[-1]
if processes:
return 'sleep' == processes[-1]
cmd = ['bash', '-c', '(sleep 100)']
proc = async_process.AsyncProcess(cmd, run_as_root=True)