diff options
author | Stephen Hines <srhines@google.com> | 2017-02-08 10:42:04 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2017-02-08 10:42:04 +0000 |
commit | c5804ce784c39d6cf4f69139ab3197d989181cf9 (patch) | |
tree | 87b3a32b13c392939d66fa93105896f5df0736a6 /command_executer_timeout_test.py | |
parent | baba90fd78c18585d22430dc95c748f96ad0c772 (diff) | |
parent | 9c6fa5f9e514c743e62be0ee401c12e10c94d7f1 (diff) | |
download | toolchain-utils-c5804ce784c39d6cf4f69139ab3197d989181cf9.tar.gz |
Merge remote-tracking branch 'aosp/mirror-chromium-master' into initial_import am: 870a8df6fc
am: 9c6fa5f9e5
Change-Id: Ie306363c46445f59e341b69121c4b0e113ad79b2
Diffstat (limited to 'command_executer_timeout_test.py')
-rwxr-xr-x | command_executer_timeout_test.py | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/command_executer_timeout_test.py b/command_executer_timeout_test.py new file mode 100755 index 00000000..ba0207ef --- /dev/null +++ b/command_executer_timeout_test.py @@ -0,0 +1,33 @@ +#!/usr/bin/python2 +# +# Copyright 2010 Google Inc. All Rights Reserved. +"""Timeout test for command_executer.""" + +from __future__ import print_function + +__author__ = 'asharif@google.com (Ahmad Sharif)' + +import argparse +import sys + +from cros_utils import command_executer + + +def Usage(parser, message): + print('ERROR: %s' % message) + parser.print_help() + sys.exit(0) + + +def Main(argv): + parser = argparse.ArgumentParser() + _ = parser.parse_args(argv) + + command = 'sleep 1000' + ce = command_executer.GetCommandExecuter() + ce.RunCommand(command, command_timeout=1) + return 0 + + +if __name__ == '__main__': + Main(sys.argv[1:]) |