pluto.tools.run_command

pluto.tools.run_command(args, testcase=None, validate=False, print_stdout=False)[source]

Helper function to run a shell command easier

Parameters
  • args (list) – a list of shell args to execute

  • validate (bool) – whether to check that the exit code was 0; requires testcase

  • testcase (unittest.TestCase) – a test case instance for making assertions

Returns

  • int – the command return code

  • str – the command stdout

  • str – the command stderr

Examples

Example usage:

command = [ "foo.py", "arg1", "arg2" ]
returncode, proc_stdout, proc_stderr = run_command(command, testcase = self, validate = True)